parameter of VIDIOC_G_INPUT and VIDIOC_S_INPUT?
Hi,
I have a question about the parameter of VIDIOC_G_INPUT and VIDIOC_S_INPUT parameters in v4l2 specification.
The "Video for Linux Two API Specification" text says that the parameter of VIDIOC_G_INPUT and VIDIOC_S_INPUT is ...
Quoted 4 lines
[...] a pointer to an integer where the driver stores the number of the input, as in the struct
v4l2_inputindex field.
In the v4l2_input structure the index has the type of __u32.
In contrast, in <linux/videodev2.h> (as of 2.6.27) the ioctls are defined as follows:
Quoted 2 lines
#define
VIDIOC_G_INPUT_IOR('V', 38, int)
#defineVIDIOC_S_INPUT_IOWR('V', 39, int)
The problem is that '__u32' is unsigned and 'int' is signed. Furthermore one cannot be sure that sizeof(__u32) == sizeof(int) on all platforms.
I guess that the parameter of VIDIOC_G_INPUT and VIDIOC_S_INPUT should be a pointer to __u32. What do you think?
Regards,
Márton Németh
Hi,
2008/12/16 Németh Márton <[email protected]>:
Quoted 18 lines
Hi,
I have a question about the parameter of
VIDIOC_G_INPUTandVIDIOC_S_INPUTparameters in v4l2 specification.The "Video for Linux Two API Specification" text says that the parameter of
VIDIOC_G_INPUTandVIDIOC_S_INPUTis ...Quoted 4 lines
[...] a pointer to an integer where the driver stores the number of the input, as in the struct
v4l2_inputindex field.In the
v4l2_inputstructure the index has the type of__u32.In contrast, in <
linux/videodev2.h> (as of 2.6.27) the ioctls are defined as follows:
Quoted 9 lines
Quoted 2 lines
#define
VIDIOC_G_INPUT_IOR('V', 38, int)
#defineVIDIOC_S_INPUT_IOWR('V', 39, int)The problem is that '
__u32' is unsigned and 'int' is signed. Furthermore one cannot be sure thatsizeof(__u32)== sizeof(int) on all platforms.I guess that the parameter of
VIDIOC_G_INPUTandVIDIOC_S_INPUTshould be a pointer to__u32. What do you think?
seems to be sane yes. This ioctl is also handled in compat_ioctl32.c and might also get some attention there.
Markus