android: jpeg: Pass StreamBuffer to Encoder::encoder

To prepare for support of the JEA encoder in a following commit, which
will need to access the buffer_handle_t of the destination buffer, pass
the StreamBuffer to the Encoder::encoder() function. As the StreamBuffer
contains the source FrameBuffer and the destination Span, drop them from
the function arguments and access them directly from the StreamBuffer.

Signed-off-by: Harvey Yang <chenghaoyang@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Han-Lin Chen <hanlinchen@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Harvey Yang
2023-02-08 03:33:18 +00:00
committed by Laurent Pinchart
parent 7a44534c4f
commit 8702b9dac7
4 changed files with 14 additions and 10 deletions
+3 -2
View File
@@ -12,14 +12,15 @@
#include <libcamera/framebuffer.h>
#include <libcamera/stream.h>
#include "../camera_request.h"
class Encoder
{
public:
virtual ~Encoder() = default;
virtual int configure(const libcamera::StreamConfiguration &cfg) = 0;
virtual int encode(const libcamera::FrameBuffer &source,
libcamera::Span<uint8_t> destination,
virtual int encode(Camera3RequestDescriptor::StreamBuffer *buffer,
libcamera::Span<const uint8_t> exifData,
unsigned int quality) = 0;
};