summaryrefslogtreecommitdiff
path: root/src/android/jpeg/encoder_libjpeg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/jpeg/encoder_libjpeg.cpp')
-rw-r--r--src/android/jpeg/encoder_libjpeg.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/android/jpeg/encoder_libjpeg.cpp b/src/android/jpeg/encoder_libjpeg.cpp
index fd62bd9c..f4e8dfad 100644
--- a/src/android/jpeg/encoder_libjpeg.cpp
+++ b/src/android/jpeg/encoder_libjpeg.cpp
@@ -24,6 +24,8 @@
#include "libcamera/internal/formats.h"
#include "libcamera/internal/mapped_framebuffer.h"
+#include "../camera_buffer.h"
+
using namespace libcamera;
LOG_DECLARE_CATEGORY(JPEG)
@@ -178,17 +180,20 @@ void EncoderLibJpeg::compressNV(const std::vector<Span<uint8_t>> &planes)
}
}
-int EncoderLibJpeg::encode(const FrameBuffer &source, Span<uint8_t> dest,
- Span<const uint8_t> exifData, unsigned int quality)
+int EncoderLibJpeg::encode(Camera3RequestDescriptor::StreamBuffer *buffer,
+ libcamera::Span<const uint8_t> exifData,
+ unsigned int quality)
{
- MappedFrameBuffer frame(&source, MappedFrameBuffer::MapFlag::Read);
+ MappedFrameBuffer frame(buffer->srcBuffer,
+ MappedFrameBuffer::MapFlag::Read);
if (!frame.isValid()) {
LOG(JPEG, Error) << "Failed to map FrameBuffer : "
<< strerror(frame.error());
return frame.error();
}
- return encode(frame.planes(), dest, exifData, quality);
+ return encode(frame.planes(), buffer->dstBuffer->plane(0),
+ exifData, quality);
}
int EncoderLibJpeg::encode(const std::vector<Span<uint8_t>> &src,