mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-14 16:09:51 +03:00
android: camera_stream: Delegate Encoder construction
Delegate the construction of the encoder to the CameraStream class for streams that need post-processing. Reviewed-by: Umang Jain <email@uajain.com> 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
94c4d49ebe
commit
3c84d88193
3 changed files with 26 additions and 17 deletions
|
@ -8,11 +8,21 @@
|
|||
#include "camera_stream.h"
|
||||
|
||||
#include "jpeg/encoder.h"
|
||||
#include "jpeg/encoder_libjpeg.h"
|
||||
|
||||
using namespace libcamera;
|
||||
|
||||
CameraStream::CameraStream(PixelFormat format, Size size,
|
||||
Type type, unsigned int index, Encoder *encoder)
|
||||
: format_(format), size_(size), type_(type), index_(index), encoder_(encoder)
|
||||
CameraStream::CameraStream(PixelFormat format, Size size, Type type, unsigned int index)
|
||||
: format_(format), size_(size), type_(type), index_(index)
|
||||
{
|
||||
if (type_ == Type::Internal || type_ == Type::Mapped)
|
||||
encoder_ = std::make_unique<EncoderLibJpeg>();
|
||||
}
|
||||
|
||||
int CameraStream::configure(const libcamera::StreamConfiguration &cfg)
|
||||
{
|
||||
if (encoder_)
|
||||
return encoder_->configure(cfg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue