mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-17 17:35:06 +03:00
libcamera: ipu3: Connect viewfinder's BufferReady signal
The viewfinder and main output require identical logic for buffer and request completion. Connect the viewfinder bufferReady signal to the slot and handle requests for both main output and viewfinder there. Update the slot logic to complete the request only when the last buffer has completed, and make sure to complete requests in the same order they have been queued to the pipeline handler. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
9f2bf7ba1e
commit
a10fbfcaaa
1 changed files with 15 additions and 3 deletions
|
@ -761,6 +761,8 @@ int PipelineHandlerIPU3::registerCameras()
|
|||
&IPU3CameraData::imguInputBufferReady);
|
||||
data->imgu_->output_.dev->bufferReady.connect(data.get(),
|
||||
&IPU3CameraData::imguOutputBufferReady);
|
||||
data->imgu_->viewfinder_.dev->bufferReady.connect(data.get(),
|
||||
&IPU3CameraData::imguOutputBufferReady);
|
||||
|
||||
/* Create and register the Camera instance. */
|
||||
std::string cameraName = cio2->sensor_->entity()->name() + " "
|
||||
|
@ -806,11 +808,21 @@ void PipelineHandlerIPU3::IPU3CameraData::imguInputBufferReady(Buffer *buffer)
|
|||
*/
|
||||
void PipelineHandlerIPU3::IPU3CameraData::imguOutputBufferReady(Buffer *buffer)
|
||||
{
|
||||
Request *request = queuedRequests_.front();
|
||||
Request *request = buffer->request();
|
||||
|
||||
if (!pipe_->completeBuffer(camera_, request, buffer))
|
||||
/* Request not completed yet, return here. */
|
||||
return;
|
||||
|
||||
/* Complete the pending requests in queuing order. */
|
||||
while (1) {
|
||||
request = queuedRequests_.front();
|
||||
if (request->hasPendingBuffers())
|
||||
break;
|
||||
|
||||
pipe_->completeBuffer(camera_, request, buffer);
|
||||
pipe_->completeRequest(camera_, request);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Handle buffers completion at the CIO2 output
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue