[PATCH v2] v4l2: Add support for interpreting remaining fields in VIDIOC_ENUMINPUT struct v4l2_input

Marek Vasut marex at denx.de
Mon Mar 21 02:59:30 UTC 2022


On 2/26/22 20:36, Dmitry V. Levin wrote:

Hi,

[...]

>> @@ -779,6 +782,19 @@ print_v4l2_input(struct tcb *const tcp, const kernel_ulong_t arg)
>>   		tprint_struct_next();
>>   		PRINT_FIELD_XVAL(i, type, v4l2_input_types,
>>   				 "V4L2_INPUT_TYPE_???");
>> +		tprint_struct_next();
>> +		PRINT_FIELD_X(i, audioset);
>> +		tprint_struct_next();
>> +		PRINT_FIELD_U(i, tuner);
> 
> Is "tuner" field an arbitrary integer, or should it rather be printed
> as an enum using v4l2_tuner_types, e.g.
> 	PRINT_FIELD_XVAL(i, tuner, v4l2_tuner_types, "V4L2_TUNER_???");
> ?

This should be an arbitrary integer per API documentation:

https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/vidioc-enuminput.html

__u32 tuner

Capture devices can have zero or more tuners (RF demodulators). When the 
type is set to V4L2_INPUT_TYPE_TUNER this is an RF connector and this 
field identifies the tuner. It corresponds to struct v4l2_tuner field 
index. For details on tuners see Tuners and Modulators.

Specifically

"
this is an RF connector and this field identifies the tuner
"

>> diff --git a/src/xlat/v4l2_input_capabilities_flags.in b/src/xlat/v4l2_input_capabilities_flags.in
>> new file mode 100644
>> index 000000000..cd7a13467
>> --- /dev/null
>> +++ b/src/xlat/v4l2_input_capabilities_flags.in
>> @@ -0,0 +1,4 @@
>> +#unconditional
>> +V4L2_IN_CAP_DV_TIMINGS		0x00000002
>> +V4L2_IN_CAP_STD			0x00000004
>> +V4L2_IN_CAP_NATIVE_SIZE		0x00000008
> 
> Fallback definitions for #unconditional constants have no sense,
> please do not add them.

I don't understand this one, can you clarify this in more detail ?
This is my first strace patch after all ...

[...]


More information about the Strace-devel mailing list