[libcamera-devel,2/3] android: camera_stream: Support PostProcessorYuv in CameraStream
diff mbox series

Message ID 20210805134530.825065-3-hiroh@chromium.org
State Superseded
Headers show
Series
  • android: Request one stream for identica stream requests
Related show

Commit Message

Hirokazu Honda Aug. 5, 2021, 1:45 p.m. UTC
CameraStream creates PostProcessorYuv if the destination format
is NV12.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
---
 src/android/camera_stream.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Jacopo Mondi Aug. 18, 2021, 11 a.m. UTC | #1
Hi Hiro,

On Thu, Aug 05, 2021 at 10:45:29PM +0900, Hirokazu Honda wrote:
> CameraStream creates PostProcessorYuv if the destination format
> is NV12.
>
> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
   j

> ---
>  src/android/camera_stream.cpp | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
> index 86263403..8c02cb43 100644
> --- a/src/android/camera_stream.cpp
> +++ b/src/android/camera_stream.cpp
> @@ -11,6 +11,7 @@
>  #include "camera_device.h"
>  #include "camera_metadata.h"
>  #include "jpeg/post_processor_jpeg.h"
> +#include "yuv/post_processor_yuv.h"
>
>  #include <libcamera/formats.h>
>
> @@ -65,6 +66,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.32.0.554.ge1b32706d8-goog
>

Patch
diff mbox series

diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
index 86263403..8c02cb43 100644
--- a/src/android/camera_stream.cpp
+++ b/src/android/camera_stream.cpp
@@ -11,6 +11,7 @@ 
 #include "camera_device.h"
 #include "camera_metadata.h"
 #include "jpeg/post_processor_jpeg.h"
+#include "yuv/post_processor_yuv.h"
 
 #include <libcamera/formats.h>
 
@@ -65,6 +66,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;