[RFC,v1] libcamera: pipeline: uvcvideo: Reject sensor configuration
diff mbox series

Message ID 20251111092319.2313234-1-barnabas.pocze@ideasonboard.com
State Accepted
Headers show
Series
  • [RFC,v1] libcamera: pipeline: uvcvideo: Reject sensor configuration
Related show

Commit Message

Barnabás Pőcze Nov. 11, 2025, 9:23 a.m. UTC
The UVC pipeline handler cannot set the sensor configuration so if the
desired `CameraConfiguration` specifies one, then reject it.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 3 +++
 1 file changed, 3 insertions(+)

Comments

Laurent Pinchart Nov. 11, 2025, 11:27 a.m. UTC | #1
On Tue, Nov 11, 2025 at 10:23:19AM +0100, Barnabás Pőcze wrote:
> The UVC pipeline handler cannot set the sensor configuration so if the
> desired `CameraConfiguration` specifies one, then reject it.
> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

Makes sense and seems simple enough.

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

Please merge.

> ---
>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> index 4b5816dfdd..48d6b39d53 100644
> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> @@ -143,6 +143,9 @@ CameraConfiguration::Status UVCCameraConfiguration::validate()
>  	if (config_.empty())
>  		return Invalid;
>  
> +	if (sensorConfig)
> +		return Invalid;
> +
>  	if (orientation != Orientation::Rotate0) {
>  		orientation = Orientation::Rotate0;
>  		status = Adjusted;
Jacopo Mondi Nov. 21, 2025, 10:20 a.m. UTC | #2
Hi Barnabás

On Tue, Nov 11, 2025 at 10:23:19AM +0100, Barnabás Pőcze wrote:
> The UVC pipeline handler cannot set the sensor configuration so if the
> desired `CameraConfiguration` specifies one, then reject it.
>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>

As you correctly pointed out, applications using SensorConfiguration
are very specialized ones that know on which platform they run on.

On UVC controlling the sensor config is not possible, so let's refuse
it

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

> ---
>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> index 4b5816dfdd..48d6b39d53 100644
> --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
> @@ -143,6 +143,9 @@ CameraConfiguration::Status UVCCameraConfiguration::validate()
>  	if (config_.empty())
>  		return Invalid;
>
> +	if (sensorConfig)
> +		return Invalid;
> +
>  	if (orientation != Orientation::Rotate0) {
>  		orientation = Orientation::Rotate0;
>  		status = Adjusted;
> --
> 2.51.2
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
index 4b5816dfdd..48d6b39d53 100644
--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
@@ -143,6 +143,9 @@  CameraConfiguration::Status UVCCameraConfiguration::validate()
 	if (config_.empty())
 		return Invalid;
 
+	if (sensorConfig)
+		return Invalid;
+
 	if (orientation != Orientation::Rotate0) {
 		orientation = Orientation::Rotate0;
 		status = Adjusted;