From e3393f147e5d011c6f02447a18eb73b1cf134b4b Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Sat, 3 Oct 2020 12:00:54 +0200 Subject: android: camera_stream: Fetch format and size from configuration Fetch the format and size of the libcamera::StreamConfiguration associated with a CameraStream by accessing the configuration by index. This removes the need to store the libcamera stream format and sizes as class members and avoid duplicating information that might get out of sync. It also allows to remove the StreamConfiguration from the constructor parameters list, as it can be identified by its index. While at it, re-order the constructor parameters order. Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- src/android/camera_stream.h | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/android/camera_stream.h') diff --git a/src/android/camera_stream.h b/src/android/camera_stream.h index d8d9d8c4..f46cfd60 100644 --- a/src/android/camera_stream.h +++ b/src/android/camera_stream.h @@ -106,16 +106,11 @@ public: Internal, Mapped, }; - CameraStream(CameraDevice *cameraDevice, - camera3_stream_t *androidStream, - const libcamera::StreamConfiguration &cfg, - Type type, unsigned int index); + CameraStream(CameraDevice *cameraDevice, Type type, + camera3_stream_t *camera3Stream, unsigned int index); - const camera3_stream_t &camera3Stream() const { return *camera3Stream_; } - const libcamera::PixelFormat &format() const { return format_; } - const libcamera::Size &size() const { return size_; } Type type() const { return type_; } - + const camera3_stream_t &camera3Stream() const { return *camera3Stream_; } const libcamera::StreamConfiguration &configuration() const; libcamera::Stream *stream() const; @@ -126,13 +121,8 @@ public: private: CameraDevice *cameraDevice_; libcamera::CameraConfiguration *config_; - camera3_stream_t *camera3Stream_; Type type_; - - /* Libcamera facing format and sizes. */ - libcamera::PixelFormat format_; - libcamera::Size size_; - + camera3_stream_t *camera3Stream_; /* * The index of the libcamera StreamConfiguration as added during * configureStreams(). A single libcamera Stream may be used to deliver -- cgit v1.2.1