summaryrefslogtreecommitdiff
path: root/src/android/jpeg/post_processor_jpeg.cpp
diff options
context:
space:
mode:
authorHarvey Yang <chenghaoyang@chromium.org>2023-02-08 03:33:19 +0000
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2023-02-10 00:47:42 +0200
commit2403f5141f002be70c94f182e0774f257bb4ee11 (patch)
tree1dbcf8fd6e1156f31e52180b8a14e7980eccf10a /src/android/jpeg/post_processor_jpeg.cpp
parent8702b9dac7bc3785102153a3b95085db01df17f9 (diff)
android: jpeg: Add JEA implementation
This patch adds JEA implementation to replace libjpeg in CrOS platform, where hardware accelerator is available. Signed-off-by: Harvey Yang <chenghaoyang@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/android/jpeg/post_processor_jpeg.cpp')
-rw-r--r--src/android/jpeg/post_processor_jpeg.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp
index 3e676eb4..40261652 100644
--- a/src/android/jpeg/post_processor_jpeg.cpp
+++ b/src/android/jpeg/post_processor_jpeg.cpp
@@ -12,7 +12,11 @@
#include "../camera_device.h"
#include "../camera_metadata.h"
#include "../camera_request.h"
+#if defined(OS_CHROMEOS)
+#include "encoder_jea.h"
+#else /* !defined(OS_CHROMEOS) */
#include "encoder_libjpeg.h"
+#endif
#include "exif.h"
#include <libcamera/base/log.h>
@@ -46,7 +50,11 @@ int PostProcessorJpeg::configure(const StreamConfiguration &inCfg,
thumbnailer_.configure(inCfg.size, inCfg.pixelFormat);
+#if defined(OS_CHROMEOS)
+ encoder_ = std::make_unique<EncoderJea>();
+#else /* !defined(OS_CHROMEOS) */
encoder_ = std::make_unique<EncoderLibJpeg>();
+#endif
return encoder_->configure(inCfg);
}