@@ -856,15 +856,23 @@ int Camera::queueRequest(Request *request)
*/
int Camera::start()
{
+ int ret;
+
if (disconnected_)
return -ENODEV;
if (!stateIs(CameraPrepared))
return -EACCES;
+ for (Stream *stream : activeStreams_) {
+ ret = stream->start();
+ if (ret < 0)
+ return ret;
+ }
+
LOG(Camera, Debug) << "Starting capture";
- int ret = pipe_->start(this);
+ ret = pipe_->start(this);
if (ret)
return ret;
@@ -899,6 +907,9 @@ int Camera::stop()
pipe_->stop(this);
+ for (Stream *stream : activeStreams_)
+ stream->stop();
+
return 0;
}
The FrameBuffer interface require individual streams to be started explicitly. This is needed so that the streams may perform any preparations before the pipeline and this the camera is started. The only supported stream at the moment is V4L2 streams and they need to be started so they can prepare for the use of external buffers in the case they are used. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> --- src/libcamera/camera.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)