[libcamera-devel] [PATCH] android: CameraDevice: Deny if the streams is empty

Umang Jain umang.jain at ideasonboard.com
Sat Apr 3 19:31:42 CEST 2021


Hi Hiro,

Thanks for the patch.

On 4/3/21 6:48 PM, Hirokazu Honda wrote:
> This checks if the number of streams is zero on configuration
> and then returns -EINVAL.
>
> Signed-off-by: Hirokazu Honda <hiroh at chromium.org>
> ---
>   src/android/camera_device.cpp | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index eb327978..f175ce53 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1554,6 +1554,11 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
>   		running_ = false;
>   	}
>   
> +	if (stream_list->num_streams == 0) {
> +		LOG(HAL, Error) << "Empty stream configuration";
The error message can be better, something like:

+		LOG(HAL, Error) << "Failed to find any stream for configuration";

Other than that:
Reviewed-by: Umang Jain <umang.jain at ideasonboard.com>
> +		return -EINVAL;
> +	}
> +
>   	/*
>   	 * Generate an empty configuration, and construct a StreamConfiguration
>   	 * for each camera3_stream to add to it.



More information about the libcamera-devel mailing list