@@ -157,6 +157,7 @@ private:
void registerCameras();
ImgUDevice imgus_[IPU3_IMGU_COUNT];
+
std::shared_ptr<MediaDevice> cio2MediaDev_;
std::shared_ptr<MediaDevice> imguMediaDev_;
};
@@ -362,13 +363,32 @@ int PipelineHandlerIPU3::allocateBuffers(Camera *camera, Stream *stream)
int PipelineHandlerIPU3::freeBuffers(Camera *camera, Stream *stream)
{
IPU3CameraData *data = cameraData(camera);
+ V4L2Device *viewfinder = data->imgu->viewfinder;
+ V4L2Device *output = data->imgu->output;
+ V4L2Device *input = data->imgu->input;
V4L2Device *cio2 = data->cio2.output;
+ V4L2Device *stat = data->imgu->stat;
+ int ret;
- int ret = cio2->releaseBuffers();
- if (ret) {
- LOG(IPU3, Error) << "Failed to release memory";
- return ret;
- }
+ ret = output->releaseBuffers();
+ if (ret)
+ LOG(IPU3, Error) << "Failed to release ImgU output memory";
+
+ ret = stat->releaseBuffers();
+ if (ret)
+ LOG(IPU3, Error) << "Failed to release ImgU stat memory";
+
+ ret = viewfinder->releaseBuffers();
+ if (ret)
+ LOG(IPU3, Error) << "Failed to release ImgU viewfinder memory";
+
+ ret = input->releaseBuffers();
+ if (ret)
+ LOG(IPU3, Error) << "Failed to release ImgU input memory";
+
+ ret = cio2->releaseBuffers();
+ if (ret)
+ LOG(IPU3, Error) << "Failed to release CIO2 memory";
return 0;
}
Release buffers on all video devices in the pipeline. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> --- src/libcamera/pipeline/ipu3/ipu3.cpp | 30 +++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-)