From f868f08c21f6e4eadb2e61b28cb9524a0bb144ed Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Wed, 2 Sep 2020 11:10:42 +0200 Subject: android: camera_device: Use Android format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When iterating the camera3_stream_t received from the Android camera framework to identify the MJPEG streams, the format check was performed on the CameraStream created when iterating the non-MJPEG streams and not on the format actually requested by Android. As the next patches will remove the creation of CameraStream instances for MJPEG streams, use the camera3_stream format to prepare for that. Reviewed-by: Hirokazu Honda Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Jacopo Mondi --- src/android/camera_device.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index e2c73ff4..af290500 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1211,7 +1211,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) stream->priv = static_cast(&streams_[i]); /* Defer handling of MJPEG streams until all others are known. */ - if (format == formats::MJPEG) + if (stream->format == HAL_PIXEL_FORMAT_BLOB) continue; StreamConfiguration streamConfiguration; @@ -1228,7 +1228,7 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list) camera3_stream_t *stream = stream_list->streams[i]; bool match = false; - if (streams_[i].format != formats::MJPEG) + if (stream->format != HAL_PIXEL_FORMAT_BLOB) continue; /* Search for a compatible stream */ -- cgit v1.2.1