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:
parent
9e95d5e453
commit
216030aa9d
3 changed files with 16 additions and 9 deletions
|
@ -33,6 +33,16 @@ CameraStream::CameraStream(CameraDevice *cameraDevice,
|
|||
encoder_ = std::make_unique<EncoderLibJpeg>();
|
||||
}
|
||||
|
||||
const StreamConfiguration &CameraStream::configuration() const
|
||||
{
|
||||
return config_->at(index_);
|
||||
}
|
||||
|
||||
Stream *CameraStream::stream() const
|
||||
{
|
||||
return configuration().stream();
|
||||
}
|
||||
|
||||
int CameraStream::configure(const libcamera::StreamConfiguration &cfg)
|
||||
{
|
||||
if (encoder_)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue