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 <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi 2020-10-03 11:36:41 +02:00
parent 9e95d5e453
commit 216030aa9d
3 changed files with 16 additions and 9 deletions

View file

@ -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,