diff mbox series

[FFmpeg-devel] lavd/v4l2: Use proper field type for second parameter of ioctl() with BSD's

Message ID ZjhVs5Hf12wZ9hOC@humpty.home.comstyle.com
State Accepted
Commit 9e674b31606c805dd31b4bb754364a72a5877238
Headers show
Series [FFmpeg-devel] lavd/v4l2: Use proper field type for second parameter of ioctl() with BSD's | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Brad Smith May 6, 2024, 3:59 a.m. UTC
lavd/v4l2: Use proper field type for second parameter of ioctl() with BSD's

The proper type was used until 73251678c83cbe24d08264da693411b166239bc7.

This covers all of the OS's that currently have V4L2 support, permutations
of Linux glibc/musl, Android bionic, FreeBSD, NetBSD, OpenBSD, Solaris.

Copied from FreeBSD ports patch.

Signed-off-by: Brad Smith <brad@comstyle.com>
---
 libavdevice/v4l2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Marton Balint May 7, 2024, 9:49 p.m. UTC | #1
On Sun, 5 May 2024, Brad Smith wrote:

> lavd/v4l2: Use proper field type for second parameter of ioctl() with BSD's
>
> The proper type was used until 73251678c83cbe24d08264da693411b166239bc7.
>
> This covers all of the OS's that currently have V4L2 support, permutations
> of Linux glibc/musl, Android bionic, FreeBSD, NetBSD, OpenBSD, Solaris.
>
> Copied from FreeBSD ports patch.
>
> Signed-off-by: Brad Smith <brad@comstyle.com>
> ---
> libavdevice/v4l2.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> index 3706582bc6..74f43ef6a9 100644
> --- a/libavdevice/v4l2.c
> +++ b/libavdevice/v4l2.c
> @@ -108,10 +108,10 @@ struct video_data {
>     int (*open_f)(const char *file, int oflag, ...);
>     int (*close_f)(int fd);
>     int (*dup_f)(int fd);
> -#ifdef __GLIBC__
> -    int (*ioctl_f)(int fd, unsigned long int request, ...);
> -#else
> +#if defined(__sun) || defined(__BIONIC__) || defined(__musl__) /* POSIX-like */
>     int (*ioctl_f)(int fd, int request, ...);
> +#else
> +    int (*ioctl_f)(int fd, unsigned long int request, ...);
> #endif
>     ssize_t (*read_f)(int fd, void *buffer, size_t n);
>     void *(*mmap_f)(void *start, size_t length, int prot, int flags, int fd, int64_t offset);

Will apply.

Thanks,
Marton
Brad Smith May 18, 2024, 11:27 a.m. UTC | #2
Can this be backported to 7, 6, 5 and 4.4 releases?

On 2024-05-05 11:59 p.m., Brad Smith wrote:
> lavd/v4l2: Use proper field type for second parameter of ioctl() with BSD's
>
> The proper type was used until 73251678c83cbe24d08264da693411b166239bc7.
>
> This covers all of the OS's that currently have V4L2 support, permutations
> of Linux glibc/musl, Android bionic, FreeBSD, NetBSD, OpenBSD, Solaris.
>
> Copied from FreeBSD ports patch.
>
> Signed-off-by: Brad Smith <brad@comstyle.com>
> ---
>   libavdevice/v4l2.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> index 3706582bc6..74f43ef6a9 100644
> --- a/libavdevice/v4l2.c
> +++ b/libavdevice/v4l2.c
> @@ -108,10 +108,10 @@ struct video_data {
>       int (*open_f)(const char *file, int oflag, ...);
>       int (*close_f)(int fd);
>       int (*dup_f)(int fd);
> -#ifdef __GLIBC__
> -    int (*ioctl_f)(int fd, unsigned long int request, ...);
> -#else
> +#if defined(__sun) || defined(__BIONIC__) || defined(__musl__) /* POSIX-like */
>       int (*ioctl_f)(int fd, int request, ...);
> +#else
> +    int (*ioctl_f)(int fd, unsigned long int request, ...);
>   #endif
>       ssize_t (*read_f)(int fd, void *buffer, size_t n);
>       void *(*mmap_f)(void *start, size_t length, int prot, int flags, int fd, int64_t offset);
Dennis Mungai May 18, 2024, 12:40 p.m. UTC | #3
On Sat, 18 May 2024, 14:27 Brad Smith, <brad-at-comstyle.com@ffmpeg.org>
wrote:

> Can this be backported to 7, 6, 5 and 4.4 releases?
>
> On 2024-05-05 11:59 p.m., Brad Smith wrote:
> > lavd/v4l2: Use proper field type for second parameter of ioctl() with
> BSD's
> >
> > The proper type was used until 73251678c83cbe24d08264da693411b166239bc7.
> >
> > This covers all of the OS's that currently have V4L2 support,
> permutations
> > of Linux glibc/musl, Android bionic, FreeBSD, NetBSD, OpenBSD, Solaris.
> >
> > Copied from FreeBSD ports patch.
> >
> > Signed-off-by: Brad Smith <brad@comstyle.com>
> > ---
> >   libavdevice/v4l2.c | 6 +++---
> >   1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> > index 3706582bc6..74f43ef6a9 100644
> > --- a/libavdevice/v4l2.c
> > +++ b/libavdevice/v4l2.c
> > @@ -108,10 +108,10 @@ struct video_data {
> >       int (*open_f)(const char *file, int oflag, ...);
> >       int (*close_f)(int fd);
> >       int (*dup_f)(int fd);
> > -#ifdef __GLIBC__
> > -    int (*ioctl_f)(int fd, unsigned long int request, ...);
> > -#else
> > +#if defined(__sun) || defined(__BIONIC__) || defined(__musl__) /*
> POSIX-like */
> >       int (*ioctl_f)(int fd, int request, ...);
> > +#else
> > +    int (*ioctl_f)(int fd, unsigned long int request, ...);
> >   #endif
> >       ssize_t (*read_f)(int fd, void *buffer, size_t n);
> >       void *(*mmap_f)(void *start, size_t length, int prot, int flags,
> int fd, int64_t offset);
> _".
>


Seconded, a backport would be ideal for prior releases.

>
Michael Niedermayer May 18, 2024, 7:58 p.m. UTC | #4
On Sat, May 18, 2024 at 07:27:35AM -0400, Brad Smith wrote:
> Can this be backported to 7, 6, 5 and 4.4 releases?

yes and everyone who has write access to master also has write access to
the releases branches!

thx

[...]
Brad Smith May 18, 2024, 11:53 p.m. UTC | #5
> yes and everyone who has write access to master also has write access to
> the releases branches!
>
> thx


Ok, I don't mind helping out here.
diff mbox series

Patch

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 3706582bc6..74f43ef6a9 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -108,10 +108,10 @@  struct video_data {
     int (*open_f)(const char *file, int oflag, ...);
     int (*close_f)(int fd);
     int (*dup_f)(int fd);
-#ifdef __GLIBC__
-    int (*ioctl_f)(int fd, unsigned long int request, ...);
-#else
+#if defined(__sun) || defined(__BIONIC__) || defined(__musl__) /* POSIX-like */
     int (*ioctl_f)(int fd, int request, ...);
+#else
+    int (*ioctl_f)(int fd, unsigned long int request, ...);
 #endif
     ssize_t (*read_f)(int fd, void *buffer, size_t n);
     void *(*mmap_f)(void *start, size_t length, int prot, int flags, int fd, int64_t offset);