[libcamera-devel] android: camera_stream: Set right format for processor output buffer
diff mbox series

Message ID 20211005092757.747697-1-hiroh@chromium.org
State Accepted
Headers show
Series
  • [libcamera-devel] android: camera_stream: Set right format for processor output buffer
Related show

Commit Message

Hirokazu Honda Oct. 5, 2021, 9:27 a.m. UTC
CameraStream always sets the format of processor output buffer to
MJPEG. This fixes the issue.

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

Comments

Laurent Pinchart Oct. 5, 2021, 9:58 a.m. UTC | #1
Hi Hiro,

Thank you for the patch.

On Tue, Oct 05, 2021 at 06:27:57PM +0900, Hirokazu Honda wrote:
> CameraStream always sets the format of processor output buffer to
> MJPEG. This fixes the issue.
> 
> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/android/camera_stream.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
> index e80f842d..db8d854b 100644
> --- a/src/android/camera_stream.cpp
> +++ b/src/android/camera_stream.cpp
> @@ -168,7 +168,7 @@ int CameraStream::process(const FrameBuffer &source,
>  	 * separate thread.
>  	 */
>  	const StreamConfiguration &output = configuration();
> -	CameraBuffer dest(*camera3Dest.buffer, formats::MJPEG, output.size,
> +	CameraBuffer dest(*camera3Dest.buffer, output.pixelFormat, output.size,
>  			  PROT_READ | PROT_WRITE);
>  	if (!dest.isValid()) {
>  		LOG(HAL, Error) << "Failed to map android blob buffer";
Umang Jain Oct. 5, 2021, 5:30 p.m. UTC | #2
Hello,

Thanks forĀ  the patch.

On 10/5/21 2:57 PM, Hirokazu Honda wrote:
> CameraStream always sets the format of processor output buffer to
> MJPEG. This fixes the issue.
>
> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>


Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>

I'll push the patch in sometime.

> ---
>   src/android/camera_stream.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
> index e80f842d..db8d854b 100644
> --- a/src/android/camera_stream.cpp
> +++ b/src/android/camera_stream.cpp
> @@ -168,7 +168,7 @@ int CameraStream::process(const FrameBuffer &source,
>   	 * separate thread.
>   	 */
>   	const StreamConfiguration &output = configuration();
> -	CameraBuffer dest(*camera3Dest.buffer, formats::MJPEG, output.size,
> +	CameraBuffer dest(*camera3Dest.buffer, output.pixelFormat, output.size,
>   			  PROT_READ | PROT_WRITE);
>   	if (!dest.isValid()) {
>   		LOG(HAL, Error) << "Failed to map android blob buffer";

Patch
diff mbox series

diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
index e80f842d..db8d854b 100644
--- a/src/android/camera_stream.cpp
+++ b/src/android/camera_stream.cpp
@@ -168,7 +168,7 @@  int CameraStream::process(const FrameBuffer &source,
 	 * separate thread.
 	 */
 	const StreamConfiguration &output = configuration();
-	CameraBuffer dest(*camera3Dest.buffer, formats::MJPEG, output.size,
+	CameraBuffer dest(*camera3Dest.buffer, output.pixelFormat, output.size,
 			  PROT_READ | PROT_WRITE);
 	if (!dest.isValid()) {
 		LOG(HAL, Error) << "Failed to map android blob buffer";