All of lore.kernel.org
 help / color / mirror / Atom feed
* parameter of VIDIOC_G_INPUT and VIDIOC_S_INPUT?
@ 2008-12-16  7:13 Németh Márton
  2008-12-16  8:01   ` Markus Rechberger
  0 siblings, 1 reply; 3+ messages in thread
From: Németh Márton @ 2008-12-16  7:13 UTC (permalink / raw)
  To: mschimek, video4linux-list; +Cc: LKML, em28xx

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 ...

> [...] a pointer to an integer where the driver stores the number
> of the input, as in the struct v4l2_input index field.
>
> http://v4l2spec.bytesex.org/spec/r11217.htm

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:

> #define VIDIOC_G_INPUT		_IOR('V', 38, int)
> #define VIDIOC_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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Em28xx] parameter of VIDIOC_G_INPUT and VIDIOC_S_INPUT?
  2008-12-16  7:13 parameter of VIDIOC_G_INPUT and VIDIOC_S_INPUT? Németh Márton
@ 2008-12-16  8:01   ` Markus Rechberger
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Rechberger @ 2008-12-16  8:01 UTC (permalink / raw)
  To: Németh Márton; +Cc: mschimek, video4linux-list, LKML, em28xx

Hi,

2008/12/16 Németh Márton <nm127@freemail.hu>:
> 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 ...
>
>> [...] a pointer to an integer where the driver stores the number
>> of the input, as in the struct v4l2_input index field.
>>
>> http://v4l2spec.bytesex.org/spec/r11217.htm
>
> 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:
>
>> #define VIDIOC_G_INPUT                _IOR('V', 38, int)
>> #define VIDIOC_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?
>

seems to be sane yes. This ioctl is also handled in compat_ioctl32.c and might
also get some attention there.

Markus

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Em28xx] parameter of VIDIOC_G_INPUT and VIDIOC_S_INPUT?
@ 2008-12-16  8:01   ` Markus Rechberger
  0 siblings, 0 replies; 3+ messages in thread
From: Markus Rechberger @ 2008-12-16  8:01 UTC (permalink / raw)
  To: Németh Márton; +Cc: em28xx, video4linux-list, LKML, mschimek

Hi,

2008/12/16 Németh Márton <nm127@freemail.hu>:
> 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 ...
>
>> [...] a pointer to an integer where the driver stores the number
>> of the input, as in the struct v4l2_input index field.
>>
>> http://v4l2spec.bytesex.org/spec/r11217.htm
>
> 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:
>
>> #define VIDIOC_G_INPUT                _IOR('V', 38, int)
>> #define VIDIOC_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?
>

seems to be sane yes. This ioctl is also handled in compat_ioctl32.c and might
also get some attention there.

Markus

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-12-16  8:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-16  7:13 parameter of VIDIOC_G_INPUT and VIDIOC_S_INPUT? Németh Márton
2008-12-16  8:01 ` [Em28xx] " Markus Rechberger
2008-12-16  8:01   ` Markus Rechberger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.