diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2020-10-02 20:48:35 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2020-10-07 16:07:44 +0200 |
commit | 160bb0998bc47abefeb876be1ecbff9534960dbc (patch) | |
tree | a839b7dd82c276123286d674a899703afad48ebf /src/android/camera_stream.h | |
parent | 3c84d88193c8807feb6cd426ce1bfc1d12e66ffa (diff) |
android: camera_stream: Construct with Android stream
Pass the android camera3_stream_t, and a libcamera::StreamConfiguration
to identify the source and destination parameters of this stream.
Pass a CameraDevice pointer to the CameraStream constructor to allow
retrieval of the StreamConfiguration associated with the CameraStream.
Also change the format on which the CameraDevice performs checks to
decide if post-processing is required, as the libcamera facing format is
not meaningful anymore, but the Android requested format should be used
instead.
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_stream.h')
-rw-r--r-- | src/android/camera_stream.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/android/camera_stream.h b/src/android/camera_stream.h index 2f49d3d4..ccc822b4 100644 --- a/src/android/camera_stream.h +++ b/src/android/camera_stream.h @@ -9,9 +9,13 @@ #include <memory> +#include <hardware/camera3.h> + +#include <libcamera/camera.h> #include <libcamera/geometry.h> #include <libcamera/pixel_format.h> +class CameraDevice; class Encoder; class CameraStream @@ -99,9 +103,12 @@ public: Internal, Mapped, }; - CameraStream(libcamera::PixelFormat format, libcamera::Size size, + CameraStream(CameraDevice *cameraDevice, + camera3_stream_t *androidStream, + const libcamera::StreamConfiguration &cfg, Type type, 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_; } @@ -111,9 +118,15 @@ public: int configure(const libcamera::StreamConfiguration &cfg); private: + CameraDevice *cameraDevice_; + libcamera::CameraConfiguration *config_; + camera3_stream_t *camera3Stream_; + Type type_; + + /* Libcamera facing format and sizes. */ libcamera::PixelFormat format_; libcamera::Size size_; - Type type_; + /* * The index of the libcamera StreamConfiguration as added during * configureStreams(). A single libcamera Stream may be used to deliver |