libcamera: framebuffer: Prevent modifying the number of metadata planes

The number of metadata planes should always match the number of frame
buffer planes. Enforce this by making the vector private and providing
accessor functions.

As this changes the public API, update all in-tree users accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
This commit is contained in:
Laurent Pinchart 2021-09-02 04:29:03 +03:00
parent 9df775c757
commit 32635054bc
10 changed files with 34 additions and 20 deletions

View file

@ -211,7 +211,7 @@ void V4L2CameraProxy::updateBuffers()
switch (fmd.status) {
case FrameMetadata::FrameSuccess:
buf.bytesused = fmd.planes[0].bytesused;
buf.bytesused = fmd.planes()[0].bytesused;
buf.field = V4L2_FIELD_NONE;
buf.timestamp.tv_sec = fmd.timestamp / 1000000000;
buf.timestamp.tv_usec = fmd.timestamp % 1000000;