diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2020-10-02 19:22:24 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2020-10-07 16:07:43 +0200 |
commit | 5cf64b26a24d1430eed9523ca5899bdd3faf203b (patch) | |
tree | 1055799fd073bc7dc246d945cc4c645f9822b8c2 /src/android/camera_stream.h | |
parent | 5fbda0dfda8dbf85022356e117fff47b184461f6 (diff) |
android: camera_stream: Break out CameraStream
Break CameraStream out of the CameraDevice class.
No functional changes, only the code is moved.
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@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 | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/android/camera_stream.h b/src/android/camera_stream.h new file mode 100644 index 00000000..0de6b6fc --- /dev/null +++ b/src/android/camera_stream.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2020, Google Inc. + * + * camera_stream.h - Camera HAL stream + */ +#ifndef __ANDROID_CAMERA_STREAM_H__ +#define __ANDROID_CAMERA_STREAM_H__ + +#include <memory> + +#include <libcamera/geometry.h> +#include <libcamera/pixel_format.h> + +class Encoder; + +class CameraStream +{ +public: + CameraStream(libcamera::PixelFormat format, libcamera::Size size, + unsigned int index, Encoder *encoder = nullptr); + + const libcamera::PixelFormat &format() const { return format_; } + const libcamera::Size &size() const { return size_; } + unsigned int index() const { return index_; } + Encoder *encoder() const { return encoder_.get(); } + +private: + libcamera::PixelFormat format_; + libcamera::Size size_; + /* + * The index of the libcamera StreamConfiguration as added during + * configureStreams(). A single libcamera Stream may be used to deliver + * one or more streams to the Android framework. + */ + unsigned int index_; + std::unique_ptr<Encoder> encoder_; +}; + +#endif /* __ANDROID_CAMERA_STREAM__ */ |