Re: [PATCH v5 3/7] v4l2-ctl/compliance: Add routing and streams multiplexed streams

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

 



On 29/05/2023 10:49, Tomi Valkeinen wrote:
> Add basic support for routing and streams.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@xxxxxxxxxxxxxxxx>
> ---
>  utils/v4l2-compliance/v4l2-compliance.cpp   | 120 ++++++++++++++++----
>  utils/v4l2-compliance/v4l2-compliance.h     |   8 +-
>  utils/v4l2-compliance/v4l2-test-subdevs.cpp |  43 ++++++-
>  3 files changed, 137 insertions(+), 34 deletions(-)
> 
> diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
> index e3556b1f..d7c10482 100644
> --- a/utils/v4l2-compliance/v4l2-compliance.cpp
> +++ b/utils/v4l2-compliance/v4l2-compliance.cpp
> @@ -1233,6 +1233,10 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_
>  	if (node.is_subdev()) {
>  		bool has_source = false;
>  		bool has_sink = false;
> +		struct v4l2_subdev_routing sd_routing[2] = {};
> +		struct v4l2_subdev_route sd_routes[2][256] = {};

256 comes from the same kernel check, right? Can you use the same
NUM_ROUTES_MAX define that you used in v4l2-ctl? Perhaps this define
should be added to utils/common/v4l2-info.h?

> +		bool has_routes = !!(subdevcap.capabilities & V4L2_SUBDEV_CAP_STREAMS);
> +		int ret;
>  
>  		node.frame_interval_pad = -1;
>  		node.enum_frame_interval_pad = -1;
> @@ -1244,6 +1248,22 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_
>  		}
>  		node.is_passthrough_subdev = has_source && has_sink;
>  
> +		if (has_routes) {
> +			for (unsigned which = V4L2_SUBDEV_FORMAT_TRY;
> +				which <= V4L2_SUBDEV_FORMAT_ACTIVE; which++) {
> +
> +				sd_routing[which].which = which;
> +				sd_routing[which].routes = (__u64)sd_routes[which];
> +				sd_routing[which].num_routes = 256;

Also NUM_ROUTES_MAX?

> +
> +				ret = doioctl(&node, VIDIOC_SUBDEV_G_ROUTING, &sd_routing[which]);
> +				if (ret) {
> +					fail("VIDIOC_SUBDEV_G_ROUTING: failed to get routing\n");
> +					sd_routing[which].num_routes = 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