Loading...
Searching...
No Matches
libcamera::V4L2M2MDevice Class Reference

Memory-to-Memory video device. More...

## Public Member Functions

| V4L2M2MDevice (const std::string &deviceNode)
| Create a new V4L2M2MDevice from the deviceNode.
int | open ()
| Open a V4L2 Memory to Memory device.
void | close ()
| Close the memory-to-memory device, releasing any resources acquired by open().
V4L2VideoDevice * | output ()
| Retrieve the output V4L2VideoDevice instance.
V4L2VideoDevice * | capture ()
| Retrieve the capture V4L2VideoDevice instance.

## Detailed Description

Memory-to-Memory video device.

Memory to Memory devices in the kernel using the V4L2 M2M API can operate with multiple contexts for parallel operations on a single device. Each instance of a V4L2M2MDevice represents a single context.

The V4L2M2MDevice manages two V4L2VideoDevice instances on the same deviceNode which operate together using two queues to implement the V4L2 Memory to Memory API.

Users of this class should create a new instance of the V4L2M2MDevice for each desired execution context and then open it by calling open() on the V4L2M2MDevice and close it by calling close() on the V4L2M2MDevice.

Calling V4L2VideoDevice::open() and V4L2VideoDevice::close() on the capture or output V4L2VideoDevice is not permitted.

Once the M2M device is open, users can operate on the output and capture queues represented by the V4L2VideoDevice returned by the output() and capture() functions.

## Constructor & Destructor Documentation

## V4L2M2MDevice()

libcamera::V4L2M2MDevice::V4L2M2MDevice | ( | const std::string & | deviceNode | ) |

Create a new V4L2M2MDevice from the deviceNode.

Parameters

  [in] | deviceNode | The file-system path to the video device node

## Member Function Documentation

## capture()

V4L2VideoDevice * libcamera::V4L2M2MDevice::capture | ( |  | ) |

inline

Retrieve the capture V4L2VideoDevice instance.

Returns
  The capture V4L2VideoDevice instance

## open()

int libcamera::V4L2M2MDevice::open | ( |  | ) |

Open a V4L2 Memory to Memory device.

Open the device node and prepare the two V4L2VideoDevice instances to handle their respective buffer queues.

Returns
  0 on success or a negative error code otherwise

## output()

V4L2VideoDevice * libcamera::V4L2M2MDevice::output | ( |  | ) |

inline

Retrieve the output V4L2VideoDevice instance.

Returns
  The output V4L2VideoDevice instance

The documentation for this class was generated from the following files:

- include/libcamera/internal/v4l2_videodevice.h
- src/libcamera/v4l2_videodevice.cpp