[libcamera-devel] [PATCH v2 2/3] android: camera_stream: Support PostProcessorYuv in CameraStream
Hirokazu Honda
hiroh at chromium.org
Thu Aug 19 22:12:13 CEST 2021
CameraStream creates PostProcessorYuv if the destination format
is NV12.
Signed-off-by: Hirokazu Honda <hiroh at chromium.org>
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/android/camera_stream.cpp | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
index c205cd7a..c728051f 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;
@@ -68,6 +70,12 @@ int CameraStream::configure()
StreamConfiguration output = configuration();
output.pixelFormat = outFormat;
switch (outFormat) {
+ case formats::NV12:
+ postProcessor_ = std::make_unique<PostProcessorYuv>();
+ output.size.width = camera3Stream_->width;
+ output.size.height = camera3Stream_->height;
+ break;
+
case formats::MJPEG:
postProcessor_ = std::make_unique<PostProcessorJpeg>(cameraDevice_);
break;
--
2.33.0.rc2.250.ged5fa647cd-goog
More information about the libcamera-devel
mailing list