[libcamera-devel,1/2] libcamera: ipu3: Add method to retrieve camera data

Message ID 20190126162859.32031-2-jacopo@jmondi.org
State Accepted
Commit ebc4cab8626f449a5f028cfa52fd7a6eb3d57184
Headers show
Series
  • libcamera: ipu3: more review fixes
Related show

Commit Message

Jacopo Mondi Jan. 26, 2019, 4:28 p.m. UTC
Provide a method for the IPU3 pipeline handler that hides the downcast
required to return an "IPU3CameraData *" reference from the
PipelineHandler::cameraData() method.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/pipeline/ipu3/ipu3.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

Patch

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index d74655d..64f639f 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -42,6 +42,12 @@  private:
 	std::shared_ptr<MediaDevice> cio2_;
 	std::shared_ptr<MediaDevice> imgu_;
 
+	IPU3CameraData *cameraData(const Camera *camera)
+	{
+		return static_cast<IPU3CameraData *>(
+			PipelineHandler::cameraData(camera));
+	}
+
 	V4L2Device *createVideoDevice(unsigned int id);
 	void registerCameras();
 };