summaryrefslogtreecommitdiff
path: root/src/android/jpeg/encoder_libjpeg.h
diff options
context:
space:
mode:
authorUmang Jain <email@uajain.com>2020-10-28 02:54:45 +0530
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-10-28 15:52:51 +0000
commit25202dbb7ebbc90551751ff2fef4e876b4923d3e (patch)
treec69277fdfa7789828c3f669b4bcee68f6be0f196 /src/android/jpeg/encoder_libjpeg.h
parentc1ae9055f98ba6b2f9983366fa1b0fd5445a77d2 (diff)
android: jpeg: encoder_libjpeg: Allow encoding raw frame bytes
Allow encoding frames which are directly handed over to the encoder via a span or vector i.e. a raw frame bytes. Introduce an overloaded EncoderLibJpeg::encode() with libcamera::Span source parameter to achieve this functionality. This makes the libjpeg-encoder a bit flexible for use case such as compressing a thumbnail generated for Exif. Signed-off-by: Umang Jain <email@uajain.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/android/jpeg/encoder_libjpeg.h')
-rw-r--r--src/android/jpeg/encoder_libjpeg.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/android/jpeg/encoder_libjpeg.h b/src/android/jpeg/encoder_libjpeg.h
index 40505ddc..070f56f8 100644
--- a/src/android/jpeg/encoder_libjpeg.h
+++ b/src/android/jpeg/encoder_libjpeg.h
@@ -24,10 +24,13 @@ public:
int encode(const libcamera::FrameBuffer &source,
libcamera::Span<uint8_t> destination,
libcamera::Span<const uint8_t> exifData) override;
+ int encode(libcamera::Span<const uint8_t> source,
+ libcamera::Span<uint8_t> destination,
+ libcamera::Span<const uint8_t> exifData);
private:
- void compressRGB(const libcamera::MappedBuffer *frame);
- void compressNV(const libcamera::MappedBuffer *frame);
+ void compressRGB(libcamera::Span<const uint8_t> frame);
+ void compressNV(libcamera::Span<const uint8_t> frame);
struct jpeg_compress_struct compress_;
struct jpeg_error_mgr jerr_;