@@ -17,8 +17,8 @@ public:
virtual ~Encoder() {}
virtual int configure(const libcamera::StreamConfiguration &cfg) = 0;
- virtual int encode(const libcamera::FrameBuffer *source,
- const libcamera::Span<uint8_t> &destination,
+ virtual int encode(const libcamera::FrameBuffer &source,
+ libcamera::Span<uint8_t> destination,
const libcamera::Span<const uint8_t> &exifData) = 0;
};
@@ -179,11 +179,11 @@ void EncoderLibJpeg::compressNV(const libcamera::MappedBuffer *frame)
}
}
-int EncoderLibJpeg::encode(const FrameBuffer *source,
- const libcamera::Span<uint8_t> &dest,
+int EncoderLibJpeg::encode(const FrameBuffer &source,
+ libcamera::Span<uint8_t> dest,
const libcamera::Span<const uint8_t> &exifData)
{
- MappedFrameBuffer frame(source, PROT_READ);
+ MappedFrameBuffer frame(&source, PROT_READ);
if (!frame.isValid()) {
LOG(JPEG, Error) << "Failed to map FrameBuffer : "
<< strerror(frame.error());
@@ -21,8 +21,8 @@ public:
~EncoderLibJpeg();
int configure(const libcamera::StreamConfiguration &cfg) override;
- int encode(const libcamera::FrameBuffer *source,
- const libcamera::Span<uint8_t> &destination,
+ int encode(const libcamera::FrameBuffer &source,
+ libcamera::Span<uint8_t> destination,
const libcamera::Span<const uint8_t> &exifData) override;
private:
@@ -67,7 +67,7 @@ int PostProcessorJpeg::process(const libcamera::FrameBuffer &source,
if (exif.generate() != 0)
LOG(JPEG, Error) << "Failed to generate valid EXIF data";
- int jpeg_size = encoder_->encode(&source, destination, exif.data());
+ int jpeg_size = encoder_->encode(source, destination, exif.data());
if (jpeg_size < 0) {
LOG(JPEG, Error) << "Failed to encode stream image";
return jpeg_size;