Re: [PATCH 2/2] media-ctl: Re-order setting format and routes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

Thank you for the patch.

On Wed, Jan 17, 2024 at 01:08:05PM +0000, Daniel Scally wrote:
> Currently media-ctl attempts to set formats that are passed to it
> with -V _before_ setting routes passed to it with -R. This is a
> problem, because the formats that one wants may not be valid until
> routing has been configured (for example, if the format is for a
> route that is inactive by default).
> 
> Reorder things so that setting routes comes before setting formats.
> 
> Signed-off-by: Daniel Scally <dan.scally@xxxxxxxxxxxxxxxx>

Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>

> ---
>  utils/media-ctl/media-ctl.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/utils/media-ctl/media-ctl.c b/utils/media-ctl/media-ctl.c
> index 961d10c8..2081f111 100644
> --- a/utils/media-ctl/media-ctl.c
> +++ b/utils/media-ctl/media-ctl.c
> @@ -751,20 +751,20 @@ int main(int argc, char **argv)
>  		}
>  	}
>  
> -	if (media_opts.formats) {
> -		ret = v4l2_subdev_parse_setup_formats(media,
> -						      media_opts.formats);
> +	if (media_opts.routes) {
> +		ret = v4l2_subdev_parse_setup_routes(media, media_opts.routes);
>  		if (ret) {
> -			printf("Unable to setup formats: %s (%d)\n",
> +			printf("Unable to setup routes: %s (%d)\n",
>  			       strerror(-ret), -ret);
>  			goto out;
>  		}
>  	}
>  
> -	if (media_opts.routes) {
> -		ret = v4l2_subdev_parse_setup_routes(media, media_opts.routes);
> +	if (media_opts.formats) {
> +		ret = v4l2_subdev_parse_setup_formats(media,
> +						      media_opts.formats);
>  		if (ret) {
> -			printf("Unable to setup routes: %s (%d)\n",
> +			printf("Unable to setup formats: %s (%d)\n",
>  			       strerror(-ret), -ret);
>  			goto out;
>  		}

-- 
Regards,

Laurent Pinchart




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux