summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-08-01 21:50:26 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-09-30 11:15:29 +0300
commit7082f6bbec4b39295180730573a7e0152cd8b756 (patch)
treecfc477c7f935daf7a43c5b4fabe805d99a6b06c1 /src
parent919bf7302d94a3e87bb94cde561c41ea3d0f3f4c (diff)
pipeline: raspberrypi: vc4: Unconditionally create embedded data stream
The mainline Unicam driver unconditionally creates the embedded data video device. Create the corresponding stream unconditionally. Drop the warning in case of mismatch between Unicam and the CamHelper, as this becomes a normal situation when the sensor doesn't support emebedded data. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline/rpi/vc4/vc4.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
index 515cc107..392d3486 100644
--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp
+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
@@ -310,24 +310,19 @@ int PipelineHandlerVc4::platformRegister(std::unique_ptr<RPi::CameraData> &camer
return -ENOMEM;
MediaEntity *unicamImage = unicam->getEntityByName("unicam-image");
+ MediaEntity *unicamEmbedded = unicam->getEntityByName("unicam-embedded");
MediaEntity *ispOutput0 = isp->getEntityByName("bcm2835-isp0-output0");
MediaEntity *ispCapture1 = isp->getEntityByName("bcm2835-isp0-capture1");
MediaEntity *ispCapture2 = isp->getEntityByName("bcm2835-isp0-capture2");
MediaEntity *ispCapture3 = isp->getEntityByName("bcm2835-isp0-capture3");
- if (!unicamImage || !ispOutput0 || !ispCapture1 || !ispCapture2 || !ispCapture3)
+ if (!unicamImage || !unicamEmbedded ||
+ !ispOutput0 || !ispCapture1 || !ispCapture2 || !ispCapture3)
return -ENOENT;
- /* Locate and open the unicam video streams. */
+ /* Create the unicam video streams. */
data->unicam_[Unicam::Image] = RPi::Stream("Unicam Image", unicamImage);
-
- /* An embedded data node will not be present if the sensor does not support it. */
- MediaEntity *unicamEmbedded = unicam->getEntityByName("unicam-embedded");
- if (unicamEmbedded) {
- data->unicam_[Unicam::Embedded] = RPi::Stream("Unicam Embedded", unicamEmbedded);
- data->unicam_[Unicam::Embedded].dev()->bufferReady.connect(data,
- &Vc4CameraData::unicamBufferDequeue);
- }
+ data->unicam_[Unicam::Embedded] = RPi::Stream("Unicam Embedded", unicamEmbedded);
/* Tag the ISP input stream as an import stream. */
data->isp_[Isp::Input] = RPi::Stream("ISP Input", ispOutput0, StreamFlag::ImportOnly);
@@ -337,18 +332,15 @@ int PipelineHandlerVc4::platformRegister(std::unique_ptr<RPi::CameraData> &camer
/* Wire up all the buffer connections. */
data->unicam_[Unicam::Image].dev()->bufferReady.connect(data, &Vc4CameraData::unicamBufferDequeue);
+ if (data->sensorMetadata_)
+ data->unicam_[Unicam::Embedded].dev()->bufferReady.connect(data,
+ &Vc4CameraData::unicamBufferDequeue);
+
data->isp_[Isp::Input].dev()->bufferReady.connect(data, &Vc4CameraData::ispInputDequeue);
data->isp_[Isp::Output0].dev()->bufferReady.connect(data, &Vc4CameraData::ispOutputDequeue);
data->isp_[Isp::Output1].dev()->bufferReady.connect(data, &Vc4CameraData::ispOutputDequeue);
data->isp_[Isp::Stats].dev()->bufferReady.connect(data, &Vc4CameraData::ispOutputDequeue);
- if (data->sensorMetadata_ ^ !!data->unicam_[Unicam::Embedded].dev()) {
- LOG(RPI, Warning) << "Mismatch between Unicam and CamHelper for embedded data usage!";
- data->sensorMetadata_ = false;
- if (data->unicam_[Unicam::Embedded].dev())
- data->unicam_[Unicam::Embedded].dev()->bufferReady.disconnect();
- }
-
/*
* Open all Unicam and ISP streams. The exception is the embedded data
* stream, which only gets opened below if the IPA reports that the sensor