summaryrefslogtreecommitdiff
path: root/src/android/camera_stream.cpp
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2021-09-01 17:03:01 +0900
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-09-22 10:58:37 +0300
commit13b76d6209afc98f013b080131c9f3488d38acd0 (patch)
treed4082d30872a6d2a12d36c82ba7264575a97390f /src/android/camera_stream.cpp
parent76819971b9615a28131106e29918028e8dc160a7 (diff)
android: camera_stream: Support PostProcessorYuv in CameraStream
CameraStream creates PostProcessorYuv if the destination format is NV12. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/android/camera_stream.cpp')
-rw-r--r--src/android/camera_stream.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
index 4a1658b8..e30c7ee4 100644
--- a/src/android/camera_stream.cpp
+++ b/src/android/camera_stream.cpp
@@ -9,13 +9,15 @@
#include <sys/mman.h>
+#include <libcamera/formats.h>
+
+#include "jpeg/post_processor_jpeg.h"
+#include "yuv/post_processor_yuv.h"
+
#include "camera_buffer.h"
#include "camera_capabilities.h"
#include "camera_device.h"
#include "camera_metadata.h"
-#include "jpeg/post_processor_jpeg.h"
-
-#include <libcamera/formats.h>
using namespace libcamera;
@@ -67,8 +69,14 @@ int CameraStream::configure()
cameraDevice_->capabilities()->toPixelFormat(camera3Stream_->format);
StreamConfiguration output = configuration();
output.pixelFormat = outFormat;
+ output.size.width = camera3Stream_->width;
+ output.size.height = camera3Stream_->height;
switch (outFormat) {
+ case formats::NV12:
+ postProcessor_ = std::make_unique<PostProcessorYuv>();
+ break;
+
case formats::MJPEG:
postProcessor_ = std::make_unique<PostProcessorJpeg>(cameraDevice_);
break;