From 216030aa9d0953cff552d5892d32e5cd73864202 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Sat, 3 Oct 2020 11:36:41 +0200 Subject: android: camera_stream: Retrieve Stream and Configuration It's a common pattern to access the libcamera::Stream and libcamera::StreamConfiguration using the CameraStream instance's index. Add two methods to the CameraStream to shorten access to the two fields. This allows removing the index() method from the class interface. Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- src/android/camera_stream.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/android/camera_stream.h') diff --git a/src/android/camera_stream.h b/src/android/camera_stream.h index d95c2a38..d8d9d8c4 100644 --- a/src/android/camera_stream.h +++ b/src/android/camera_stream.h @@ -115,7 +115,9 @@ public: const libcamera::PixelFormat &format() const { return format_; } const libcamera::Size &size() const { return size_; } Type type() const { return type_; } - unsigned int index() const { return index_; } + + const libcamera::StreamConfiguration &configuration() const; + libcamera::Stream *stream() const; int configure(const libcamera::StreamConfiguration &cfg); int process(const libcamera::FrameBuffer &source, -- cgit v1.2.1