android: camera_device: Maintain a vector of CameraStream

Introduce a vector storing a CameraStream to track and maintain
state between an Android stream (camera3_stream_t) and a libcamera
Stream.

Only the index of the libcamera stream is stored, to facilitate identifying
the correct index for both the StreamConfiguration and Stream vectors.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Kieran Bingham 2020-07-01 16:42:13 +01:00
parent eac0542c5e
commit 2f34f5ef06
2 changed files with 29 additions and 2 deletions

View file

@ -25,6 +25,15 @@
class CameraMetadata;
struct CameraStream {
/*
* 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;
};
class CameraDevice : protected libcamera::Loggable
{
public:
@ -90,6 +99,7 @@ private:
std::vector<Camera3StreamConfiguration> streamConfigurations_;
std::map<int, libcamera::PixelFormat> formatsMap_;
std::vector<CameraStream> streams_;
int facing_;
int orientation_;