mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-25 17:45:06 +03:00
libcamera: v4l2_videodevice: Document plane handling in createBuffer()
The V4L2VideoDevice::createBuffer() calculates offsets manually when using a multi-planar pixel format and a single-planar V4L2 format. The process isn't trivial, document it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
6d98fe5b68
commit
17b9db376c
1 changed files with 9 additions and 0 deletions
|
@ -1334,10 +1334,19 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
* If we have a multi-planar format with a V4L2 single-planar buffer,
|
||||||
|
* split the single V4L2 plane into multiple FrameBuffer planes by
|
||||||
|
* computing the offsets manually.
|
||||||
|
*
|
||||||
* The format info is not guaranteed to be valid, as there are no
|
* The format info is not guaranteed to be valid, as there are no
|
||||||
* PixelFormatInfo for metadata formats, so check it first.
|
* PixelFormatInfo for metadata formats, so check it first.
|
||||||
*/
|
*/
|
||||||
if (formatInfo_->isValid() && formatInfo_->numPlanes() != numPlanes) {
|
if (formatInfo_->isValid() && formatInfo_->numPlanes() != numPlanes) {
|
||||||
|
/*
|
||||||
|
* There's no valid situation where the number of colour planes
|
||||||
|
* differs from the number of V4L2 planes and the V4L2 buffer
|
||||||
|
* has more than one plane.
|
||||||
|
*/
|
||||||
ASSERT(numPlanes == 1u);
|
ASSERT(numPlanes == 1u);
|
||||||
|
|
||||||
planes.resize(formatInfo_->numPlanes());
|
planes.resize(formatInfo_->numPlanes());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue