summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/raspberrypi
diff options
context:
space:
mode:
authorDavid Plowman <david.plowman@raspberrypi.com>2020-12-08 20:44:36 +0000
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-12-11 23:31:13 +0200
commit10bcc51ca365ba9b40f7af192884b73542cf701a (patch)
tree68a9e432d339852670f3452d915b2ab5fd6c6b05 /src/libcamera/pipeline/raspberrypi
parenta93775cab61961ac5f79f5a7a3408fde67a89da1 (diff)
libcamera: pipeline: raspberrypi: Pass the drop frame count in start, not configure
The number of frames to drop (not display) is passed back now from the start method, not configure. This means applications have a chance to set fixed exposure/gain before starting the camera and this can affect the frame drop count that is returned. Note how we need to be able to tell the very first time we start the camera from subsequent restarts, hence addition of the "firstStart_" flag. Both the IPA implementation file and the pipeline handler need matching modifications. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/raspberrypi')
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 593fd7ac..439c21ce 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -745,13 +745,6 @@ int PipelineHandlerRPi::start(Camera *camera, [[maybe_unused]] ControlList *cont
return ret;
}
- ret = queueAllBuffers(camera);
- if (ret) {
- LOG(RPI, Error) << "Failed to queue buffers";
- stop(camera);
- return ret;
- }
-
/* Check if a ScalerCrop control was specified. */
if (controls)
data->applyScalerCrop(*controls);
@@ -779,6 +772,19 @@ int PipelineHandlerRPi::start(Camera *camera, [[maybe_unused]] ControlList *cont
LOG(RPI, Error) << "V4L2 staggered set failed";
}
+ if (result.operation & RPi::IPA_CONFIG_DROP_FRAMES) {
+ /* Configure the number of dropped frames required on startup. */
+ data->dropFrameCount_ = result.data[0];
+ }
+
+ /* We need to set the dropFrameCount_ before queueing buffers. */
+ ret = queueAllBuffers(camera);
+ if (ret) {
+ LOG(RPI, Error) << "Failed to queue buffers";
+ stop(camera);
+ return ret;
+ }
+
/*
* IPA configure may have changed the sensor flips - hence the bayer
* order. Get the sensor format and set the ISP input now.
@@ -1237,11 +1243,6 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)
LOG(RPI, Error) << "V4L2 staggered set failed";
}
- if (result.operation & RPi::IPA_CONFIG_DROP_FRAMES) {
- /* Configure the number of dropped frames required on startup. */
- dropFrameCount_ = result.data[resultIdx++];
- }
-
/*
* Configure the H/V flip controls based on the combination of
* the sensor and user transform.