libcamera: pipeline_handler: Fold buffer management with start/stop

There's no need anymore to have the Camera object control how and when
pipeline handlers allocate and free the buffers for the
application-facing video devices. Fold those operations, currently
performed by importFrameBuffers() and freeFrameBuffers(), into the
start() and stop() functions. This simplifies the pipeline handler API,
its implementation, and the implementation of the Camera class.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart
2020-03-14 16:14:27 +02:00
parent 9da27d5d84
commit 33fedea818
7 changed files with 105 additions and 179 deletions

View File

@@ -915,13 +915,6 @@ int Camera::start()
LOG(Camera, Debug) << "Starting capture";
for (Stream *stream : p_->activeStreams_) {
ret = p_->pipe_->invokeMethod(&PipelineHandler::importFrameBuffers,
ConnectionTypeDirect, this, stream);
if (ret < 0)
return ret;
}
ret = p_->pipe_->invokeMethod(&PipelineHandler::start,
ConnectionTypeBlocking, this);
if (ret)
@@ -959,10 +952,6 @@ int Camera::stop()
p_->pipe_->invokeMethod(&PipelineHandler::stop, ConnectionTypeBlocking,
this);
for (Stream *stream : p_->activeStreams_)
p_->pipe_->invokeMethod(&PipelineHandler::freeFrameBuffers,
ConnectionTypeBlocking, this, stream);
return 0;
}