Re: [PATCH 2/2] v4l2-compliance: add tests for V4L2_CAP_IO_MC

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

 



On 18/03/2020 14:27, Niklas Söderlund wrote:
> Add tests to check the behavior of VIDIOC_ENUM{INPUT,OUTPUT},
> VIDIOC_G_{INPUT,OUTPUT} and VIDIOC_S_{INPUT,OUTPUT} when the
> V4L2_CAP_IO_MC  is set.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
> ---
>  utils/v4l2-compliance/v4l2-test-input-output.cpp | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/utils/v4l2-compliance/v4l2-test-input-output.cpp b/utils/v4l2-compliance/v4l2-test-input-output.cpp
> index 2bf338e6f6d7ec5a..bf937abec320f88a 100644
> --- a/utils/v4l2-compliance/v4l2-test-input-output.cpp
> +++ b/utils/v4l2-compliance/v4l2-test-input-output.cpp
> @@ -466,6 +466,13 @@ int testInput(struct node *node)
>  	if (!node->inputs && node->has_inputs)
>  		return fail("no inputs found, but input capabilities set\n");
>  	fail_on_test(node->is_m2m && node->inputs > 1);
> +	if (node->g_caps() & V4L2_CAP_IO_MC) {
> +		if (!node->is_video && !node->is_meta)
> +			return fail("media device controls none video or meta input\n");
> +
> +		if (!node->is_meta && node->inputs != 1)
> +			return fail("media device controlled input have %d inputs\n", node->inputs);

Just replace this with:

		fail_on_test(!node->is_video && !node->is_meta);
		fail_on_test(node->inputs != 1);

> +	}
>  	return 0;
>  }
>  
> @@ -836,6 +843,13 @@ int testOutput(struct node *node)
>  	if (!node->outputs && node->has_outputs)
>  		return fail("no outputs found, but output capabilities set\n");
>  	fail_on_test(node->is_m2m && node->outputs > 1);
> +	if (node->g_caps() & V4L2_CAP_IO_MC) {
> +		if (!node->is_video && !node->is_meta)
> +			return fail("media device controls none video or meta output\n");
> +
> +		if (!node->is_meta && node->outputs != 1)
> +			return fail("media device controlled output have %d outputs\n", node->outputs);

Ditto.

> +	}
>  	return 0;
>  }
>  
> 

Regards,

	Hans



[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