Skip to content

Commit 562b633

Browse files
author
Jacopo Mondi
committed
libcamera: v4l2_videodevice: Clarify V4L2M2MDevice
The documentation seems to suggest that to create a new M2M execution context it is expected users to call V4L2M2MDevice::open() multiple times on the same video device path. It is instead expected that multiple instances of the class are created, one for each required execution context. Clarify it in the documentation of the V4L2M2MDevice class. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
1 parent 493f198 commit 562b633

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/libcamera/v4l2_videodevice.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2124,15 +2124,24 @@ V4L2PixelFormat V4L2VideoDevice::toV4L2PixelFormat(const PixelFormat &pixelForma
21242124
* \class V4L2M2MDevice
21252125
* \brief Memory-to-Memory video device
21262126
*
2127+
* Memory to Memory devices in the kernel using the V4L2 M2M API can
2128+
* operate with multiple contexts for parallel operations on a single
2129+
* device. Each instance of a V4L2M2MDevice represents a single context.
2130+
*
21272131
* The V4L2M2MDevice manages two V4L2VideoDevice instances on the same
21282132
* deviceNode which operate together using two queues to implement the V4L2
21292133
* Memory to Memory API.
21302134
*
2131-
* The two devices should be opened by calling open() on the V4L2M2MDevice, and
2132-
* can be closed by calling close on the V4L2M2MDevice.
2135+
* Users of this class should create a new instance of the V4L2M2MDevice for
2136+
* each desired execution context and then open it by calling open() on the
2137+
* V4L2M2MDevice and close it by calling close() on the V4L2M2MDevice.
21332138
*
21342139
* Calling V4L2VideoDevice::open() and V4L2VideoDevice::close() on the capture
21352140
* or output V4L2VideoDevice is not permitted.
2141+
*
2142+
* Once the M2M device is open, users can operate on the output and capture
2143+
* queues represented by the V4L2VideoDevice returned by the output() and
2144+
* capture() functions.
21362145
*/
21372146

21382147
/**

0 commit comments

Comments
 (0)