[FFmpeg-cvslog] avutil/thread: add support for setting thread name on *bsd and solaris

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/6.1 | Brad Smith  | 
Sun Jan  7 00:55:51 2024 -0500| [66f2cf8958edb55545724f127d3f39ae7b1c024a] | 
committer: Brad Smith

avutil/thread: add support for setting thread name on *bsd and solaris

FreeBSD/DragonFly/Solaris use pthread_setname_np(). OpenBSD uses 
pthread_set_name_np().

Signed-off-by: Brad Smith 
Signed-off-by: Marton Balint 
(cherry picked from commit fd16d8c68cd7b820eda76c407b0645b7cf470efd)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=66f2cf8958edb55545724f127d3f39ae7b1c024a
---

 configure  | 10 ++
 libavutil/thread.h | 14 --
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index a89cfa6d95..9ca9f949b6 100755
--- a/configure
+++ b/configure
@@ -2227,6 +2227,7 @@ HEADERS_LIST="
 opencv2_core_core_c_h
 OpenGL_gl3_h
 poll_h
+pthread_np_h
 sys_param_h
 sys_resource_h
 sys_select_h
@@ -2329,6 +2330,8 @@ SYSTEM_FUNCS="
 posix_memalign
 prctl
 pthread_cancel
+pthread_set_name_np
+pthread_setname_np
 sched_getaffinity
 SecItemImport
 SetConsoleTextAttribute
@@ -6460,6 +6463,7 @@ check_headers malloc.h
 check_headers mftransform.h
 check_headers net/udplite.h
 check_headers poll.h
+check_headers pthread_np.h
 check_headers sys/param.h
 check_headers sys/resource.h
 check_headers sys/select.h
@@ -6625,6 +6629,12 @@ if ! disabled pthreads && ! enabled w32threads && ! 
enabled os2threads; then
 if enabled pthreads; then
 check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); 
sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
 check_func pthread_cancel $pthreads_extralibs
+hdrs=pthread.h
+if enabled pthread_np_h; then
+hdrs="$hdrs pthread_np.h"
+fi
+check_lib pthread_set_name_np "$hdrs" pthread_set_name_np -lpthread
+check_lib pthread_setname_np "$hdrs" pthread_setname_np -lpthread
 fi
 fi
 
diff --git a/libavutil/thread.h b/libavutil/thread.h
index 2ded498c89..fa74dd2ea7 100644
--- a/libavutil/thread.h
+++ b/libavutil/thread.h
@@ -26,6 +26,8 @@
 
 #if HAVE_PRCTL
 #include 
+#elif (HAVE_PTHREAD_SETNAME_NP || HAVE_PTHREAD_SET_NAME_NP) && 
HAVE_PTHREAD_NP_H
+#include 
 #endif
 
 #include "error.h"
@@ -213,11 +215,19 @@ static inline int ff_thread_once(char *control, void 
(*routine)(void))
 
 static inline int ff_thread_setname(const char *name)
 {
+int ret = 0;
+
 #if HAVE_PRCTL
-return AVERROR(prctl(PR_SET_NAME, name));
+ret = AVERROR(prctl(PR_SET_NAME, name));
+#elif HAVE_PTHREAD_SETNAME_NP
+ret = AVERROR(pthread_setname_np(pthread_self(), name));
+#elif HAVE_PTHREAD_SET_NAME_NP
+pthread_set_name_np(pthread_self(), name);
+#else
+ret = AVERROR(ENOSYS);
 #endif
 
-return AVERROR(ENOSYS);
+return ret;
 }
 
 #endif /* AVUTIL_THREAD_H */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/thread: fix pthread_setname_np parameters for NetBSD and Apple

2024-05-18 Thread Marton Balint
ffmpeg | branch: release/6.1 | Marton Balint  | Mon Feb  5 
00:31:27 2024 +0100| [2aad37688cedf7675a55137d326c7d931f587138] | committer: 
Brad Smith

avutil/thread: fix pthread_setname_np parameters for NetBSD and Apple

Signed-off-by: Marton Balint 
(cherry picked from commit 71ea90638efa56b4cd006bfa6cfb464d2169692d)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2aad37688cedf7675a55137d326c7d931f587138
---

 libavutil/thread.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavutil/thread.h b/libavutil/thread.h
index fa74dd2ea7..2c00c7cc35 100644
--- a/libavutil/thread.h
+++ b/libavutil/thread.h
@@ -220,7 +220,13 @@ static inline int ff_thread_setname(const char *name)
 #if HAVE_PRCTL
 ret = AVERROR(prctl(PR_SET_NAME, name));
 #elif HAVE_PTHREAD_SETNAME_NP
+#if defined(__APPLE__)
+ret = AVERROR(pthread_setname_np(name));
+#elif defined(__NetBSD__)
+ret = AVERROR(pthread_setname_np(pthread_self(), "%s", name));
+#else
 ret = AVERROR(pthread_setname_np(pthread_self(), name));
+#endif
 #elif HAVE_PTHREAD_SET_NAME_NP
 pthread_set_name_np(pthread_self(), name);
 #else

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/thread: add support for setting thread name on *bsd and solaris

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/6.0 | Brad Smith  | 
Sun Jan  7 00:55:51 2024 -0500| [ce29877f5c05fb90dc2cfb245a3b2202a2db] | 
committer: Brad Smith

avutil/thread: add support for setting thread name on *bsd and solaris

FreeBSD/DragonFly/Solaris use pthread_setname_np(). OpenBSD uses 
pthread_set_name_np().

Signed-off-by: Brad Smith 
Signed-off-by: Marton Balint 
(cherry picked from commit fd16d8c68cd7b820eda76c407b0645b7cf470efd)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ce29877f5c05fb90dc2cfb245a3b2202a2db
---

 configure  | 10 ++
 libavutil/thread.h | 14 --
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 8010310351..c27f635806 100755
--- a/configure
+++ b/configure
@@ -2191,6 +2191,7 @@ HEADERS_LIST="
 opencv2_core_core_c_h
 OpenGL_gl3_h
 poll_h
+pthread_np_h
 sys_param_h
 sys_resource_h
 sys_select_h
@@ -2293,6 +2294,8 @@ SYSTEM_FUNCS="
 posix_memalign
 prctl
 pthread_cancel
+pthread_set_name_np
+pthread_setname_np
 sched_getaffinity
 SecItemImport
 SetConsoleTextAttribute
@@ -6352,6 +6355,7 @@ check_headers malloc.h
 check_headers mftransform.h
 check_headers net/udplite.h
 check_headers poll.h
+check_headers pthread_np.h
 check_headers sys/param.h
 check_headers sys/resource.h
 check_headers sys/select.h
@@ -6515,6 +6519,12 @@ if ! disabled pthreads && ! enabled w32threads && ! 
enabled os2threads; then
 if enabled pthreads; then
 check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); 
sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
 check_func pthread_cancel $pthreads_extralibs
+hdrs=pthread.h
+if enabled pthread_np_h; then
+hdrs="$hdrs pthread_np.h"
+fi
+check_lib pthread_set_name_np "$hdrs" pthread_set_name_np -lpthread
+check_lib pthread_setname_np "$hdrs" pthread_setname_np -lpthread
 fi
 fi
 
diff --git a/libavutil/thread.h b/libavutil/thread.h
index 2f5e7e1cb5..5203edf494 100644
--- a/libavutil/thread.h
+++ b/libavutil/thread.h
@@ -26,6 +26,8 @@
 
 #if HAVE_PRCTL
 #include 
+#elif (HAVE_PTHREAD_SETNAME_NP || HAVE_PTHREAD_SET_NAME_NP) && 
HAVE_PTHREAD_NP_H
+#include 
 #endif
 
 #include "error.h"
@@ -194,11 +196,19 @@ static inline int ff_thread_once(char *control, void 
(*routine)(void))
 
 static inline int ff_thread_setname(const char *name)
 {
+int ret = 0;
+
 #if HAVE_PRCTL
-return AVERROR(prctl(PR_SET_NAME, name));
+ret = AVERROR(prctl(PR_SET_NAME, name));
+#elif HAVE_PTHREAD_SETNAME_NP
+ret = AVERROR(pthread_setname_np(pthread_self(), name));
+#elif HAVE_PTHREAD_SET_NAME_NP
+pthread_set_name_np(pthread_self(), name);
+#else
+ret = AVERROR(ENOSYS);
 #endif
 
-return AVERROR(ENOSYS);
+return ret;
 }
 
 #endif /* AVUTIL_THREAD_H */

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/thread: fix pthread_setname_np parameters for NetBSD and Apple

2024-05-18 Thread Marton Balint
ffmpeg | branch: release/6.0 | Marton Balint  | Mon Feb  5 
00:31:27 2024 +0100| [9dbeb1d5d0f4fbc9bdc943c869a6e312f12074a8] | committer: 
Brad Smith

avutil/thread: fix pthread_setname_np parameters for NetBSD and Apple

Signed-off-by: Marton Balint 
(cherry picked from commit 71ea90638efa56b4cd006bfa6cfb464d2169692d)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9dbeb1d5d0f4fbc9bdc943c869a6e312f12074a8
---

 libavutil/thread.h | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavutil/thread.h b/libavutil/thread.h
index 5203edf494..8023ad303d 100644
--- a/libavutil/thread.h
+++ b/libavutil/thread.h
@@ -201,7 +201,13 @@ static inline int ff_thread_setname(const char *name)
 #if HAVE_PRCTL
 ret = AVERROR(prctl(PR_SET_NAME, name));
 #elif HAVE_PTHREAD_SETNAME_NP
+#if defined(__APPLE__)
+ret = AVERROR(pthread_setname_np(name));
+#elif defined(__NetBSD__)
+ret = AVERROR(pthread_setname_np(pthread_self(), "%s", name));
+#else
 ret = AVERROR(pthread_setname_np(pthread_self(), name));
+#endif
 #elif HAVE_PTHREAD_SET_NAME_NP
 pthread_set_name_np(pthread_self(), name);
 #else

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/7.0 | Brad Smith  | Sat May 18 
07:38:40 2024 -0400| [8b0fe91754f5250742c438f1fb574c62494d2229] | committer: 
Brad Smith

avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

Use the machdep.altivec sysctl on NetBSD for AltiVec detection
as is done with OpenBSD.

(cherry picked from commit 115c96b9bd53e775f425f23d5b73fa0a9dedbd08)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8b0fe91754f5250742c438f1fb574c62494d2229
---

 libavutil/ppc/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index bc8bb5f47c..2b13cda662 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -27,7 +27,7 @@
 #if HAVE_UNISTD_H
 #include 
 #endif
-#elif defined(__OpenBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
 #include 
 #include 
 #include 
@@ -56,8 +56,8 @@ int ff_get_cpu_flags_ppc(void)
 if (result == VECTORTYPE_ALTIVEC)
 return AV_CPU_FLAG_ALTIVEC;
 return 0;
-#elif defined(__APPLE__) || defined(__OpenBSD__)
-#ifdef __OpenBSD__
+#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
 #else
 int sels[2] = {CTL_HW, HW_VECTORUNIT};

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


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

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/7.0 | Brad Smith  | 
Sun May  5 23:59:47 2024 -0400| [6ab65792ab8e522f5a8a9f432ca11900f35a9d94] | 
committer: Brad Smith

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 
Signed-off-by: Marton Balint 
(cherry picked from commit 9e674b31606c805dd31b4bb754364a72a5877238)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6ab65792ab8e522f5a8a9f432ca11900f35a9d94
---

 libavdevice/v4l2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 51291246b3..50ac47ec5a 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -107,10 +107,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);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/6.1 | Brad Smith  | Sat May 18 
07:38:40 2024 -0400| [a01ed5273350d869017b7ec26efd3da0866b1de4] | committer: 
Brad Smith

avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

Use the machdep.altivec sysctl on NetBSD for AltiVec detection
as is done with OpenBSD.

(cherry picked from commit 115c96b9bd53e775f425f23d5b73fa0a9dedbd08)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a01ed5273350d869017b7ec26efd3da0866b1de4
---

 libavutil/ppc/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index bc8bb5f47c..2b13cda662 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -27,7 +27,7 @@
 #if HAVE_UNISTD_H
 #include 
 #endif
-#elif defined(__OpenBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
 #include 
 #include 
 #include 
@@ -56,8 +56,8 @@ int ff_get_cpu_flags_ppc(void)
 if (result == VECTORTYPE_ALTIVEC)
 return AV_CPU_FLAG_ALTIVEC;
 return 0;
-#elif defined(__APPLE__) || defined(__OpenBSD__)
-#ifdef __OpenBSD__
+#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
 #else
 int sels[2] = {CTL_HW, HW_VECTORUNIT};

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


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

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/6.1 | Brad Smith  | 
Sun May  5 23:59:47 2024 -0400| [ebb406db7c7b1fff5223d824fa3bbe3cd1402685] | 
committer: Brad Smith

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 
Signed-off-by: Marton Balint 
(cherry picked from commit 9e674b31606c805dd31b4bb754364a72a5877238)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ebb406db7c7b1fff5223d824fa3bbe3cd1402685
---

 libavdevice/v4l2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 5e85d1a2b3..33bd26ead9 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -107,10 +107,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);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/6.0 | Brad Smith  | Sat May 18 
07:38:40 2024 -0400| [4873178ee358394c467c250d197d0197917a6fe0] | committer: 
Brad Smith

avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

Use the machdep.altivec sysctl on NetBSD for AltiVec detection
as is done with OpenBSD.

(cherry picked from commit 115c96b9bd53e775f425f23d5b73fa0a9dedbd08)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4873178ee358394c467c250d197d0197917a6fe0
---

 libavutil/ppc/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index bc8bb5f47c..2b13cda662 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -27,7 +27,7 @@
 #if HAVE_UNISTD_H
 #include 
 #endif
-#elif defined(__OpenBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
 #include 
 #include 
 #include 
@@ -56,8 +56,8 @@ int ff_get_cpu_flags_ppc(void)
 if (result == VECTORTYPE_ALTIVEC)
 return AV_CPU_FLAG_ALTIVEC;
 return 0;
-#elif defined(__APPLE__) || defined(__OpenBSD__)
-#ifdef __OpenBSD__
+#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
 #else
 int sels[2] = {CTL_HW, HW_VECTORUNIT};

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


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

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/6.0 | Brad Smith  | 
Sun May  5 23:59:47 2024 -0400| [13ebc732596a2c488a38bbe97d1eec90c60a2707] | 
committer: Brad Smith

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 
Signed-off-by: Marton Balint 
(cherry picked from commit 9e674b31606c805dd31b4bb754364a72a5877238)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=13ebc732596a2c488a38bbe97d1eec90c60a2707
---

 libavdevice/v4l2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 5e85d1a2b3..33bd26ead9 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -107,10 +107,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);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


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

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/5.1 | Brad Smith  | 
Sun May  5 23:59:47 2024 -0400| [ff8eee647028933c7adeaeb446e693289691a07f] | 
committer: Brad Smith

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 
Signed-off-by: Marton Balint 
(cherry picked from commit 9e674b31606c805dd31b4bb754364a72a5877238)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ff8eee647028933c7adeaeb446e693289691a07f
---

 libavdevice/v4l2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 5340382d57..c880e6a4a9 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -106,10 +106,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);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/5.1 | Brad Smith  | Sat May 18 
07:38:40 2024 -0400| [2d50a0e84a51070d6e4c72871a6a52727f1207cd] | committer: 
Brad Smith

avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

Use the machdep.altivec sysctl on NetBSD for AltiVec detection
as is done with OpenBSD.

(cherry picked from commit 115c96b9bd53e775f425f23d5b73fa0a9dedbd08)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d50a0e84a51070d6e4c72871a6a52727f1207cd
---

 libavutil/ppc/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index bc8bb5f47c..2b13cda662 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -27,7 +27,7 @@
 #if HAVE_UNISTD_H
 #include 
 #endif
-#elif defined(__OpenBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
 #include 
 #include 
 #include 
@@ -56,8 +56,8 @@ int ff_get_cpu_flags_ppc(void)
 if (result == VECTORTYPE_ALTIVEC)
 return AV_CPU_FLAG_ALTIVEC;
 return 0;
-#elif defined(__APPLE__) || defined(__OpenBSD__)
-#ifdef __OpenBSD__
+#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
 #else
 int sels[2] = {CTL_HW, HW_VECTORUNIT};

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/ppc/cpu: Use proper header for OpenBSD PPC CPU detection

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/5.0 | Brad Smith  | Wed Mar  2 
20:34:53 2022 -0500| [537a17a16fe396e12c96d7b33dcf2eeaa7b23dcf] | committer: 
Brad Smith

avutil/ppc/cpu: Use proper header for OpenBSD PPC CPU detection

Use the proper header for PPC CPU detection code. sys/param.h includes
sys/types, but sys/types.h is the more appropriate header to be used
here.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit beaf172d75da1580532e241be5ff546c806abd41)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=537a17a16fe396e12c96d7b33dcf2eeaa7b23dcf
---

 libavutil/ppc/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index b022149fa0..96b491c716 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -28,7 +28,7 @@
 #include 
 #endif
 #elif defined(__OpenBSD__)
-#include 
+#include 
 #include 
 #include 
 #elif defined(__AMIGAOS4__)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/5.0 | Brad Smith  | Sat May 18 
07:38:40 2024 -0400| [d6bec7f83e639358f4ec0df6d573f6ea63b95c17] | committer: 
Brad Smith

avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

Use the machdep.altivec sysctl on NetBSD for AltiVec detection
as is done with OpenBSD.

(cherry picked from commit 115c96b9bd53e775f425f23d5b73fa0a9dedbd08)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d6bec7f83e639358f4ec0df6d573f6ea63b95c17
---

 libavutil/ppc/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index 96b491c716..23c3b1644a 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -27,7 +27,7 @@
 #if HAVE_UNISTD_H
 #include 
 #endif
-#elif defined(__OpenBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
 #include 
 #include 
 #include 
@@ -56,8 +56,8 @@ int ff_get_cpu_flags_ppc(void)
 if (result == VECTORTYPE_ALTIVEC)
 return AV_CPU_FLAG_ALTIVEC;
 return 0;
-#elif defined(__APPLE__) || defined(__OpenBSD__)
-#ifdef __OpenBSD__
+#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
 #else
 int sels[2] = {CTL_HW, HW_VECTORUNIT};

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


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

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/5.0 | Brad Smith  | 
Sun May  5 23:59:47 2024 -0400| [307df02e1d013a88fb704a8c6b3aab29330b83c0] | 
committer: Brad Smith

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 
Signed-off-by: Marton Balint 
(cherry picked from commit 9e674b31606c805dd31b4bb754364a72a5877238)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=307df02e1d013a88fb704a8c6b3aab29330b83c0
---

 libavdevice/v4l2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 2ecfb9fae7..9e776df0ba 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -97,10 +97,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);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/4.4 | Brad Smith  | Sat May 18 
07:38:40 2024 -0400| [a48116a2fe7a23eb6d584f4f92fd16911824f813] | committer: 
Brad Smith

avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

Use the machdep.altivec sysctl on NetBSD for AltiVec detection
as is done with OpenBSD.

(cherry picked from commit 115c96b9bd53e775f425f23d5b73fa0a9dedbd08)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a48116a2fe7a23eb6d584f4f92fd16911824f813
---

 libavutil/ppc/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index bc8bb5f47c..2b13cda662 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -27,7 +27,7 @@
 #if HAVE_UNISTD_H
 #include 
 #endif
-#elif defined(__OpenBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
 #include 
 #include 
 #include 
@@ -56,8 +56,8 @@ int ff_get_cpu_flags_ppc(void)
 if (result == VECTORTYPE_ALTIVEC)
 return AV_CPU_FLAG_ALTIVEC;
 return 0;
-#elif defined(__APPLE__) || defined(__OpenBSD__)
-#ifdef __OpenBSD__
+#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
 #else
 int sels[2] = {CTL_HW, HW_VECTORUNIT};

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avutil/ppc/cpu: Use proper header for OpenBSD PPC CPU detection

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/4.4 | Brad Smith  | Wed Mar  2 
20:34:53 2022 -0500| [8184fd878dcb48d52b1735ed09931c0a755b632c] | committer: 
Brad Smith

avutil/ppc/cpu: Use proper header for OpenBSD PPC CPU detection

Use the proper header for PPC CPU detection code. sys/param.h includes
sys/types, but sys/types.h is the more appropriate header to be used
here.

Signed-off-by: Michael Niedermayer 
(cherry picked from commit beaf172d75da1580532e241be5ff546c806abd41)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8184fd878dcb48d52b1735ed09931c0a755b632c
---

 libavutil/ppc/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index 9229b83072..bc8bb5f47c 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -28,7 +28,7 @@
 #include 
 #endif
 #elif defined(__OpenBSD__)
-#include 
+#include 
 #include 
 #include 
 #elif defined(__AMIGAOS4__)

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


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

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/4.4 | Brad Smith  | 
Sun May  5 23:59:47 2024 -0400| [008b0b4a3b0cbafa568d0dcbf78c798d56929802] | 
committer: Brad Smith

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 
Signed-off-by: Marton Balint 
(cherry picked from commit 9e674b31606c805dd31b4bb754364a72a5877238)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=008b0b4a3b0cbafa568d0dcbf78c798d56929802
---

 libavdevice/v4l2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index 365bacd771..1dcbe04bb1 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -95,10 +95,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);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] configure: use pkg-config for sndio

2024-05-18 Thread Brad Smith
ffmpeg | branch: release/4.4 | Brad Smith  | Fri Oct 29 
16:41:27 2021 -0400| [2161acff6d132091a46ac6b6354a9705c34c6137] | committer: 
Brad Smith

configure: use pkg-config for sndio

(cherry picked from commit bb813ccb458ea64a68feebcdfa76504fd6969f52)
Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2161acff6d132091a46ac6b6354a9705c34c6137
---

 configure | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index f0303caafd..742a784e77 100755
--- a/configure
+++ b/configure
@@ -6662,7 +6662,8 @@ enabled alsa && { check_pkg_config alsa alsa 
"alsa/asoundlib.h" snd_pcm_htimesta
 enabled libjack &&
 require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
 
-enabled sndio && check_lib sndio sndio.h sio_open -lsndio
+enabled sndio && { check_pkg_config sndio sndio "sndio.h" sio_open ||
+   check_lib sndio sndio.h sio_open -lsndio; }
 
 if enabled libcdio; then
 check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" 
cdio_cddap_open ||

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] Changelog: update

2024-05-18 Thread Michael Niedermayer
ffmpeg | branch: refs/remotes/origin/release/4.4 | Michael Niedermayer 
 | Sun Apr 14 20:31:14 2024 +0200| 
[568c374568b5938c5c3304eb887c92d31dedc952] | committer: Michael Niedermayer

Changelog: update

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=568c374568b5938c5c3304eb887c92d31dedc952
---

 Changelog | 150 ++
 1 file changed, 150 insertions(+)

diff --git a/Changelog b/Changelog
index 620ca2bf40..4d296caf82 100644
--- a/Changelog
+++ b/Changelog
@@ -1,6 +1,156 @@
 Entries are sorted chronologically from oldest to youngest within each release,
 releases are sorted from youngest to oldest.
 
+version 4.4.5:
+ fate/subtitles: Ignore line endings for sub-scc test
+ avformat/mxfdec: Check index_edit_rate
+ swscale/utils: Fix xInc overflow
+ avcodec/exr: Dont use 64bits to hold 6bits
+ avcodec/exr: Check for remaining bits in huf_unpack_enc_table()
+ avformat/mpegts: Reset local nb_prg on add_program() failure
+ avformat/mxfdec: Make edit_unit_byte_count unsigned
+ avformat/movenc: Check that cts fits in 32bit
+ avformat/mxfdec: Check first case of offset_temp computation for overflow
+ avfilter/vf_signature: Dont crash on no frames
+ avformat/westwood_vqa: Fix 2g packets
+ avformat/matroskadec: Check timescale
+ avformat/wavdec: satuarte next_tag_ofs, data_end
+ avformat/sbgdec: Check for negative duration
+ avformat/rpl: Use 64bit for total_audio_size and check it
+ avformat/timecode: use 64bit for intermediate for rounding in 
fps_from_frame_rate()
+ avformat/jacosubdec: Use 64bit for abs
+ avformat/concatdec: Check user_duration sum
+ avcodec/truemotion1: Height not being a multiple of 4 is unsupported
+ avcodec/hcadec: do not set hfr_group_count to invalid values
+ avformat/concatdec: clip outpoint - inpoint overflow in 
get_best_effort_duration()
+ avformat/jacosubdec: clarify code
+ avformat/cafdec: Check that data chunk end fits within 64bit
+ avformat/iff: Saturate avio_tell() + 12
+ avformat/dxa: Adjust order of operations around block align
+ avformat/cafdec: dont seek beyond 64bit
+ avformat/id3v2: read_uslt() check for the amount read
+ avcodec/proresenc_kostya: Remove bug similarity text
+ avcodec/vorbisdec: Check remaining data in vorbis_residue_decode_internal()
+ libswscale/utils: Fix bayer to yuvj
+ swscale/swscale: Check srcSliceH for bayer
+ swscale/utils: Allocate more dithererror
+ avcodec/indeo3: Round dimensions up in allocate_frame_buffers()
+ avutil/rational: Document what is to be expected from av_d2q() of doubles 
representing rational numbers
+ avfilter/signature_lookup: Do not dereference NULL pointers after malloc 
failure
+ avfilter/signature_lookup: dont leave uncleared pointers in sll_free()
+ avcodec/mpegvideo_enc: Use ptrdiff_t for stride
+ libavformat/hlsenc.c: Populate OTI using AAC profile in write_codec_attr.
+ avcodec/mpegvideo_enc: Dont copy beyond the image
+ avfilter/vf_minterpolate: Check pts before division
+ avformat/flacdec: Avoid double AVERRORS
+ avfilter/vf_vidstabdetect: Avoid double AVERRORS
+ avfilter/vf_swaprect: round coordinates down
+ avfilter/vf_swaprect: Use height for vertical variables
+ avfilter/vf_swaprect: assert that rectangles are within memory
+ avfilter/af_alimiter: Check nextpos before use
+ avfilter/af_stereowiden: Check length
+ avfilter/vf_weave: Fix odd height handling
+ avfilter/vf_gradfun: Do not overread last line
+ avformat/mov: do not set sign bit for chunk_offsets
+ avcodec/jpeglsdec: Check Jpeg-LS LSE
+ configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm
+ avformat/mov: Check if a key is longer than the atom containing it
+ avcodec/nvdec: reset bitstream_len/nb_slices when resetting bitstream pointer
+ avformat/mov: don't abort on duplicate Mastering Display Metadata boxes
+ avcodec/x86/mathops: clip constants used with shift instructions within 
inline assembly
+ avcodec/av1dec: fix matrix coefficients exposed by codec context
+ avcodec/nvdec: don't free NVDECContext->bitstream
+ avcodec/av1dec: Fix resolving zero divisor
+ avformat/mov: Ignore duplicate ftyp
+ avformat/mov: Fix integer overflow in mov_read_packet().
+ seek: Fix crashes in ff_seek_frame_binary if built with latest Clang 14
+ avcodec/4xm: Check for cfrm exhaustion
+ avformat/mov: Disallow FTYP after streams
+ doc/html: fix styling issue with Texinfo 7.0
+ doc/html: support texinfo 7.0
+ doc/t2h.pm: fix missing TOC with texinfo 6.8 and above
+ doc/t2h.pm: fix missing CSS with texinfo 6.8 and above
+ avformat/matroskadec: Fix declaration-after-statement warnings
+ avformat/rtsp: Use rtsp_st->stream_index
+ avcodec/jpeg2000dec: Check image offset
+ avformat/mxfdec: Check klv offset
+ libavutil/ppc/cpu.c: check that AT_HWCAP2 is defined
+ avcodec/h2645_parse: Avoid EAGAIN
+ avcodec/xvididct: Make c* unsigned to avoid undefined overflows
+ avformat/tmv: Check video chunk size
+ avcodec/h264_parser: saturate dts a bit
+ avformat/asfdec_f: Saturate presentation time in mar

[FFmpeg-cvslog] fate/lavf-container: add a test for VVC in mp4 muxing

2024-05-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Sat May 18 13:26:29 
2024 -0300| [7e59f02c1417ab12694781f969a8247f5dfd7ea3] | committer: James Almer

fate/lavf-container: add a test for VVC in mp4 muxing

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7e59f02c1417ab12694781f969a8247f5dfd7ea3
---

 tests/fate/lavf-container.mak | 2 ++
 tests/ref/lavf-fate/vvc.mp4   | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/tests/fate/lavf-container.mak b/tests/fate/lavf-container.mak
index d89174d221..d84117c50f 100644
--- a/tests/fate/lavf-container.mak
+++ b/tests/fate/lavf-container.mak
@@ -74,6 +74,7 @@ FATE_LAVF_CONTAINER_FATE-$(call ALLYES, IVF_DEMUXER 
AV1_DECODER AV1_PARSER MOV_M
 FATE_LAVF_CONTAINER_FATE-$(call ALLYES, IVF_DEMUXER AV1_DECODER AV1_PARSER 
MATROSKA_MUXER) += av1.mkv
 FATE_LAVF_CONTAINER_FATE-$(call ALLYES, EVC_DEMUXER EVC_PARSER MOV_MUXER)  
+= evc.mp4
 FATE_LAVF_CONTAINER_FATE-$(call ALLYES, H264_DEMUXER H264_PARSER MOV_MUXER)
+= h264.mp4
+FATE_LAVF_CONTAINER_FATE-$(call ALLYES, VVC_DEMUXER VVC_PARSER MOV_MUXER)  
+= vvc.mp4
 FATE_LAVF_CONTAINER_FATE-$(call ALLYES, MATROSKA_DEMUXER   OGG_MUXER)  
+= vp3.ogg
 FATE_LAVF_CONTAINER_FATE-$(call ALLYES, MATROSKA_DEMUXER   OGV_MUXER)  
+= vp8.ogg
 FATE_LAVF_CONTAINER_FATE-$(call ALLYES, MOV_DEMUXERLATM_MUXER) 
+= latm
@@ -91,6 +92,7 @@ fate-lavf-fate-av1.mp4: CMD = lavf_container_fate 
"av1-test-vectors/av1-1-b8-05-
 fate-lavf-fate-av1.mkv: CMD = lavf_container_fate 
"av1-test-vectors/av1-1-b8-05-mv.ivf" "-c:v av1" "-c:v copy"
 fate-lavf-fate-evc.mp4: CMD = lavf_container_fate "evc/akiyo_cif.evc" "" "-c:v 
copy"
 fate-lavf-fate-h264.mp4: CMD = lavf_container_fate "h264/intra_refresh.h264" 
"" "-c:v copy"
+fate-lavf-fate-vvc.mp4: CMD = lavf_container_fate 
"vvc-conformance/VPS_A_3.bit" "" "-c:v copy"
 fate-lavf-fate-vp3.ogg: CMD = lavf_container_fate "vp3/coeff_level64.mkv" 
"-idct auto"
 fate-lavf-fate-vp8.ogg: CMD = lavf_container_fate "vp8/RRSF49-short.webm" "" 
"-acodec copy"
 fate-lavf-fate-latm: CMD = lavf_container_fate "aac/al04_44.mp4" "" "-acodec 
copy"
diff --git a/tests/ref/lavf-fate/vvc.mp4 b/tests/ref/lavf-fate/vvc.mp4
new file mode 100644
index 00..240715884b
--- /dev/null
+++ b/tests/ref/lavf-fate/vvc.mp4
@@ -0,0 +1,3 @@
+30b856d289220b477b5a0935f60aa793 *tests/data/lavf-fate/lavf.vvc.mp4
+16625 tests/data/lavf-fate/lavf.vvc.mp4
+tests/data/lavf-fate/lavf.vvc.mp4 CRC=0x895790b1

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] configure: split ISOBMFF writer helpers into a separate component

2024-05-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri May 17 09:48:03 
2024 -0300| [3765305928bfd1a7c111d24314b07ab7f29cafbf] | committer: James Almer

configure: split ISOBMFF writer helpers into a separate component

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3765305928bfd1a7c111d24314b07ab7f29cafbf
---

 configure| 10 ++
 libavformat/Makefile | 16 
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/configure b/configure
index 275fa59bfd..b16722d83d 100755
--- a/configure
+++ b/configure
@@ -2587,6 +2587,7 @@ CONFIG_EXTRA="
 inflate_wrapper
 intrax8
 iso_media
+iso_writer
 ividsp
 jpegtables
 lgplv3
@@ -3611,7 +3612,7 @@ evc_demuxer_select="evc_frame_merge_bsf evc_parser"
 f4v_muxer_select="mov_muxer"
 fifo_muxer_deps="threads"
 flac_demuxer_select="flac_parser"
-flv_muxer_select="aac_adtstoasc_bsf"
+flv_muxer_select="aac_adtstoasc_bsf iso_writer"
 gxf_muxer_select="pcm_rechunk_bsf"
 hds_muxer_select="flv_muxer"
 hls_demuxer_select="aac_demuxer ac3_demuxer adts_header ac3_parser 
eac3_demuxer mov_demuxer mpegts_demuxer"
@@ -3629,12 +3630,12 @@ latm_muxer_select="aac_adtstoasc_bsf mpeg4audio"
 matroska_audio_muxer_select="matroska_muxer"
 matroska_demuxer_select="riffdec"
 matroska_demuxer_suggest="bzlib zlib"
-matroska_muxer_select="mpeg4audio riffenc aac_adtstoasc_bsf 
pgs_frame_merge_bsf vp9_superframe_bsf"
+matroska_muxer_select="iso_writer mpeg4audio riffenc aac_adtstoasc_bsf 
pgs_frame_merge_bsf vp9_superframe_bsf"
 mlp_demuxer_select="mlp_parser"
 mmf_muxer_select="riffenc"
 mov_demuxer_select="iso_media riffdec"
 mov_demuxer_suggest="iamfdec zlib"
-mov_muxer_select="iso_media riffenc rtpenc_chain vp9_superframe_bsf 
aac_adtstoasc_bsf ac3_parser"
+mov_muxer_select="iso_media iso_writer riffenc rtpenc_chain vp9_superframe_bsf 
aac_adtstoasc_bsf ac3_parser"
 mov_muxer_suggest="iamfenc"
 mp3_demuxer_select="mpegaudio_parser"
 mp3_muxer_select="mpegaudioheader"
@@ -3642,7 +3643,7 @@ mp4_muxer_select="mov_muxer"
 mpegts_demuxer_select="iso_media"
 mpegts_muxer_select="ac3_parser adts_muxer latm_muxer h264_mp4toannexb_bsf 
hevc_mp4toannexb_bsf vvc_mp4toannexb_bsf"
 mpegtsraw_demuxer_select="mpegts_demuxer"
-mxf_muxer_select="pcm_rechunk_bsf rangecoder"
+mxf_muxer_select="iso_writer pcm_rechunk_bsf rangecoder"
 mxf_d10_muxer_select="mxf_muxer"
 mxf_opatom_muxer_select="mxf_muxer"
 nut_muxer_select="riffenc"
@@ -3655,6 +3656,7 @@ ogv_muxer_select="ogg_muxer"
 opus_muxer_select="ogg_muxer"
 psp_muxer_select="mov_muxer"
 rtp_demuxer_select="sdp_demuxer"
+rtp_muxer_select="iso_writer"
 rtp_mpegts_muxer_select="mpegts_muxer rtp_muxer"
 rtpdec_select="asf_demuxer mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol 
srtp"
 rtsp_demuxer_select="http_protocol rtpdec"
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 211ccf45e5..1c4d9deccd 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -35,6 +35,7 @@ OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o
 
 # subsystems
 OBJS-$(CONFIG_ISO_MEDIA) += isom.o
+OBJS-$(CONFIG_ISO_WRITER)+= av1.o avc.o hevc.o vvc.o vpcc.o
 OBJS-$(CONFIG_IAMFDEC)   += iamf_reader.o iamf_parse.o iamf.o
 OBJS-$(CONFIG_IAMFENC)   += iamf_writer.o iamf.o
 OBJS-$(CONFIG_NETWORK)   += network.o
@@ -220,7 +221,7 @@ OBJS-$(CONFIG_FLAC_MUXER)+= flacenc.o 
flacenc_header.o \
 OBJS-$(CONFIG_FLIC_DEMUXER)  += flic.o
 OBJS-$(CONFIG_FLV_DEMUXER)   += flvdec.o
 OBJS-$(CONFIG_LIVE_FLV_DEMUXER)  += flvdec.o
-OBJS-$(CONFIG_FLV_MUXER) += flvenc.o avc.o hevc.o av1.o vpcc.o
+OBJS-$(CONFIG_FLV_MUXER) += flvenc.o
 OBJS-$(CONFIG_FOURXM_DEMUXER)+= 4xm.o
 OBJS-$(CONFIG_FRAMECRC_MUXER)+= framecrcenc.o framehash.o
 OBJS-$(CONFIG_FRAMEHASH_MUXER)   += hashenc.o framehash.o
@@ -260,7 +261,7 @@ OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
 OBJS-$(CONFIG_EVC_DEMUXER)   += evcdec.o rawdec.o
 OBJS-$(CONFIG_EVC_MUXER) += rawenc.o
 OBJS-$(CONFIG_HLS_DEMUXER)   += hls.o hls_sample_encryption.o
-OBJS-$(CONFIG_HLS_MUXER) += hlsenc.o hlsplaylist.o avc.o
+OBJS-$(CONFIG_HLS_MUXER) += hlsenc.o hlsplaylist.o
 OBJS-$(CONFIG_HNM_DEMUXER)   += hnm.o
 OBJS-$(CONFIG_IAMF_DEMUXER)  += iamfdec.o
 OBJS-$(CONFIG_IAMF_MUXER)+= iamfenc.o
@@ -349,7 +350,6 @@ OBJS-$(CONFIG_MATROSKA_DEMUXER)  += matroskadec.o 
matroska.o  \
 oggparsevorbis.o vorbiscomment.o \
 qtpalette.o replaygain.o 
dovi_isom.o
 OBJS-$(CONFIG_MATROSKA_MUXER)+= matroskaenc.o matroska.o \
-av1.o avc.o hevc.o vvc.o\
 flacenc_header.o avla

[FFmpeg-cvslog] avformat/vvc: use align_get_bits() where useful

2024-05-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Sat May 18 11:49:43 
2024 -0300| [9ab8dddf1f2e1ffb7ee24b550173247f7c63c692] | committer: James Almer

avformat/vvc: use align_get_bits() where useful

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9ab8dddf1f2e1ffb7ee24b550173247f7c63c692
---

 libavformat/vvc.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/libavformat/vvc.c b/libavformat/vvc.c
index 19143f85dd..449c933881 100644
--- a/libavformat/vvc.c
+++ b/libavformat/vvc.c
@@ -191,15 +191,13 @@ static void vvcc_parse_ptl(GetBitContext *gb,
 general_ptl.num_bytes_constraint_info = j;
 skip_bits(gb, gci_num_reserved_bits);
 }
-while (gb->index % 8 != 0)
-skip_bits1(gb);
+align_get_bits(gb);
 }
 
 for (int i = max_sub_layers_minus1 - 1; i >= 0; i--)
 general_ptl.ptl_sublayer_level_present_flag[i] = get_bits1(gb);
 
-while (gb->index % 8 != 0)
-skip_bits1(gb);
+align_get_bits(gb);
 
 for (int i = max_sub_layers_minus1 - 1; i >= 0; i--) {
 if (general_ptl.ptl_sublayer_level_present_flag[i])
@@ -307,8 +305,7 @@ static int vvcc_parse_vps(GetBitContext *gb,
 vps_ptl_max_tid[i] = vps_max_sublayers_minus1;
 }
 
-while (gb->index % 8 != 0)
-skip_bits1(gb);
+align_get_bits(gb);
 
 for (int i = 0; i <= vps_num_ptls_minus1; i++)
 vvcc_parse_ptl(gb, vvcc, vps_pt_present_flag[i], vps_ptl_max_tid[i]);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avformat/vvc: fix parsing some early VPS bitstream values

2024-05-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri May 17 16:23:41 
2024 -0300| [a48203d51aa4836150f9379448f6b2a1d5ca9d36] | committer: James Almer

avformat/vvc: fix parsing some early VPS bitstream values

vps_default_ptl_dpb_hrd_max_tid_flag needs to always be set, and
vps_direct_ref_layer_flag needs to be read even when
vps_max_tid_ref_present_flag is false.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a48203d51aa4836150f9379448f6b2a1d5ca9d36
---

 libavformat/vvc.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/vvc.c b/libavformat/vvc.c
index 09a4aa52e8..b147f44683 100644
--- a/libavformat/vvc.c
+++ b/libavformat/vvc.c
@@ -252,6 +252,8 @@ static int vvcc_parse_vps(GetBitContext *gb,
 
 if (vps_max_layers_minus1 > 0 && vps_max_sublayers_minus1 > 0)
 vps_default_ptl_dpb_hrd_max_tid_flag = get_bits1(gb);
+else
+vps_default_ptl_dpb_hrd_max_tid_flag = 0;
 if (vps_max_layers_minus1 > 0)
 vps_all_independent_layers_flag = get_bits1(gb);
 else
@@ -260,10 +262,11 @@ static int vvcc_parse_vps(GetBitContext *gb,
 for (int i = 0; i <= vps_max_layers_minus1; i++) {
 skip_bits(gb, 6);//vps_layer_id[i]
 if (i > 0 && !vps_all_independent_layers_flag) {
-if (get_bits1(gb)) {// vps_independent_layer_flag[i]
+if (!get_bits1(gb)) {   // vps_independent_layer_flag[i]
 unsigned int vps_max_tid_ref_present_flag = get_bits1(gb);
 for (int j = 0; j < i; j++) {
-if (vps_max_tid_ref_present_flag && get_bits1(gb))  // 
vps_direct_ref_layer_flag[i][j]
+unsigned int vps_direct_ref_layer_flag = get_bits1(gb);
+if (vps_max_tid_ref_present_flag && 
vps_direct_ref_layer_flag)
 skip_bits(gb, 3);   // 
vps_max_tid_il_ref_pics_plus1
 }
 }

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avformat/vvc: reduce the scope of some variables

2024-05-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Sat May 18 11:41:27 
2024 -0300| [f00b23453ca522854b69bfcb81cc47765798b760] | committer: James Almer

avformat/vvc: reduce the scope of some variables

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f00b23453ca522854b69bfcb81cc47765798b760
---

 libavformat/vvc.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavformat/vvc.c b/libavformat/vvc.c
index b147f44683..19143f85dd 100644
--- a/libavformat/vvc.c
+++ b/libavformat/vvc.c
@@ -224,8 +224,6 @@ static int vvcc_parse_vps(GetBitContext *gb,
 unsigned int vps_max_sublayers_minus1;
 unsigned int vps_default_ptl_dpb_hrd_max_tid_flag;
 unsigned int vps_all_independent_layers_flag;
-unsigned int vps_each_layer_is_an_ols_flag;
-unsigned int vps_ols_mode_idc;
 
 unsigned int vps_pt_present_flag[VVC_MAX_PTLS];
 unsigned int vps_ptl_max_tid[VVC_MAX_PTLS];
@@ -274,11 +272,13 @@ static int vvcc_parse_vps(GetBitContext *gb,
 }
 
 if (vps_max_layers_minus1 > 0) {
+unsigned int vps_each_layer_is_an_ols_flag;
 if (vps_all_independent_layers_flag)
 vps_each_layer_is_an_ols_flag = get_bits1(gb);
 else
 vps_each_layer_is_an_ols_flag = 0;
 if (!vps_each_layer_is_an_ols_flag) {
+unsigned int vps_ols_mode_idc;
 if (!vps_all_independent_layers_flag)
 vps_ols_mode_idc = get_bits(gb, 2);
 else
@@ -293,8 +293,6 @@ static int vvcc_parse_vps(GetBitContext *gb,
 }
 }
 vps_num_ptls_minus1 = get_bits(gb, 8);
-} else {
-vps_each_layer_is_an_ols_flag = 0;
 }
 
 for (int i = 0; i <= vps_num_ptls_minus1; i++) {

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avformat/vvc: remove duplicate struct

2024-05-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Fri May 17 19:15:09 
2024 -0300| [f121d52b3535278fe1bd406c4dc4797b11b96ddf] | committer: James Almer

avformat/vvc: remove duplicate struct

VVCCProfileTierLevel is the same as VVCPTLRecord since the previous commit.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f121d52b3535278fe1bd406c4dc4797b11b96ddf
---

 libavformat/vvc.c | 43 +--
 1 file changed, 13 insertions(+), 30 deletions(-)

diff --git a/libavformat/vvc.c b/libavformat/vvc.c
index af25f137ee..09a4aa52e8 100644
--- a/libavformat/vvc.c
+++ b/libavformat/vvc.c
@@ -70,32 +70,15 @@ typedef struct VVCDecoderConfigurationRecord {
 VVCCNALUnitArray *array;
 } VVCDecoderConfigurationRecord;
 
-typedef struct VVCCProfileTierLevel {
-uint8_t profile_idc;
-uint8_t tier_flag;
-uint8_t general_level_idc;
-uint8_t ptl_frame_only_constraint_flag;
-uint8_t ptl_multilayer_enabled_flag;
-// general_constraint_info
-uint8_t gci_present_flag;
-uint8_t gci_general_constraints[9];
-uint8_t num_bytes_constraint_info;
-// end general_constraint_info
-uint8_t ptl_sublayer_level_present_flag[VVC_MAX_SUBLAYERS - 1];
-uint8_t sublayer_level_idc[VVC_MAX_SUBLAYERS - 1];
-uint8_t ptl_num_sub_profiles;
-uint32_t general_sub_profile_idc[VVC_MAX_SUB_PROFILES];
-} VVCCProfileTierLevel;
-
 static void vvcc_update_ptl(VVCDecoderConfigurationRecord *vvcc,
-VVCCProfileTierLevel *ptl)
+VVCPTLRecord *ptl)
 {
 /*
  * The level indication general_level_idc must indicate a level of
  * capability equal to or greater than the highest level indicated for the
  * highest tier in all the parameter sets.
  */
-if (vvcc->ptl.general_tier_flag < ptl->tier_flag)
+if (vvcc->ptl.general_tier_flag < ptl->general_tier_flag)
 vvcc->ptl.general_level_idc = ptl->general_level_idc;
 else
 vvcc->ptl.general_level_idc =
@@ -106,7 +89,7 @@ static void vvcc_update_ptl(VVCDecoderConfigurationRecord 
*vvcc,
  * greater than the highest tier indicated in all the parameter sets.
  */
 vvcc->ptl.general_tier_flag =
-FFMAX(vvcc->ptl.general_tier_flag, ptl->tier_flag);
+FFMAX(vvcc->ptl.general_tier_flag, ptl->general_tier_flag);
 
 /*
  * The profile indication general_profile_idc must indicate a profile to
@@ -123,7 +106,7 @@ static void vvcc_update_ptl(VVCDecoderConfigurationRecord 
*vvcc,
  * Note: set the profile to the highest value for the sake of simplicity.
  */
 vvcc->ptl.general_profile_idc =
-FFMAX(vvcc->ptl.general_profile_idc, ptl->profile_idc);
+FFMAX(vvcc->ptl.general_profile_idc, ptl->general_profile_idc);
 
 /*
  * Each bit in flags may only be set if all
@@ -136,10 +119,10 @@ static void vvcc_update_ptl(VVCDecoderConfigurationRecord 
*vvcc,
 /*
  * Constraints Info
  */
-if (ptl->gci_present_flag) {
+if (ptl->num_bytes_constraint_info) {
 vvcc->ptl.num_bytes_constraint_info = ptl->num_bytes_constraint_info;
 memcpy(&vvcc->ptl.general_constraint_info[0],
-   &ptl->gci_general_constraints[0], 
ptl->num_bytes_constraint_info);
+   &ptl->general_constraint_info[0], 
ptl->num_bytes_constraint_info);
 } else {
 vvcc->ptl.num_bytes_constraint_info = 1;
 memset(&vvcc->ptl.general_constraint_info[0], 0, 
sizeof(vvcc->ptl.general_constraint_info));
@@ -186,23 +169,23 @@ static void vvcc_parse_ptl(GetBitContext *gb,
unsigned int profileTierPresentFlag,
unsigned int max_sub_layers_minus1)
 {
-VVCCProfileTierLevel general_ptl = { 0 };
+VVCPTLRecord general_ptl = { 0 };
 
 if (profileTierPresentFlag) {
-general_ptl.profile_idc = get_bits(gb, 7);
-general_ptl.tier_flag = get_bits1(gb);
+general_ptl.general_profile_idc = get_bits(gb, 7);
+general_ptl.general_tier_flag = get_bits1(gb);
 }
 general_ptl.general_level_idc = get_bits(gb, 8);
 
 general_ptl.ptl_frame_only_constraint_flag = get_bits1(gb);
 general_ptl.ptl_multilayer_enabled_flag = get_bits1(gb);
 if (profileTierPresentFlag) {   // parse constraint info
-general_ptl.gci_present_flag = get_bits1(gb);
-if (general_ptl.gci_present_flag) {
+general_ptl.num_bytes_constraint_info = get_bits1(gb); // 
gci_present_flag
+if (general_ptl.num_bytes_constraint_info) {
 int gci_num_reserved_bits, j;
 for (j = 0; j < 8; j++)
-general_ptl.gci_general_constraints[j] = get_bits(gb, 8);
-general_ptl.gci_general_constraints[j++] = get_bits(gb, 7);
+general_ptl.general_constraint_info[j] = get_bits(gb, 8);
+general_ptl.general_constraint_info[j++] = get_bits(gb, 7);
 
 gci_num_reserved_bits = get_bits(gb, 8

[FFmpeg-cvslog] avformat/vvc: fix writing general_constraint_info bytes

2024-05-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Thu May 16 11:55:00 
2024 -0300| [415dfa89e29686786085c207fdebcf2c97883a33] | committer: James Almer

avformat/vvc: fix writing general_constraint_info bytes

The existing implementation was completely broken.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=415dfa89e29686786085c207fdebcf2c97883a33
---

 libavformat/Makefile|  2 +-
 libavformat/bitstream.c |  1 +
 libavformat/vvc.c   | 35 +++
 tests/ref/fate/source   |  1 +
 4 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 2d4e0e0c95..211ccf45e5 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -727,7 +727,7 @@ OBJS-$(CONFIG_LIBSSH_PROTOCOL)   += libssh.o
 OBJS-$(CONFIG_LIBZMQ_PROTOCOL)   += libzmq.o
 
 # Objects duplicated from other libraries for shared builds
-SHLIBOBJS+= log2_tab.o to_upper4.o
+SHLIBOBJS+= log2_tab.o to_upper4.o bitstream.o
 SHLIBOBJS-$(CONFIG_ISO_MEDIA)+= mpegaudiotabs.o
 SHLIBOBJS-$(CONFIG_FLV_MUXER)+= mpeg4audio_sample_rates.o
 SHLIBOBJS-$(CONFIG_HLS_DEMUXER)  += ac3_channel_layout_tab.o
diff --git a/libavformat/bitstream.c b/libavformat/bitstream.c
new file mode 100644
index 00..2afda37c30
--- /dev/null
+++ b/libavformat/bitstream.c
@@ -0,0 +1 @@
+#include "libavcodec/bitstream.c"
diff --git a/libavformat/vvc.c b/libavformat/vvc.c
index 3123cd8d83..92773579a8 100644
--- a/libavformat/vvc.c
+++ b/libavformat/vvc.c
@@ -21,8 +21,10 @@
  */
 
 #include "libavcodec/get_bits.h"
+#include "libavcodec/put_bits.h"
 #include "libavcodec/golomb.h"
 #include "libavcodec/vvc.h"
+#include "libavutil/avassert.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/mem.h"
 #include "avc.h"
@@ -185,7 +187,7 @@ static void vvcc_parse_ptl(GetBitContext *gb,
unsigned int profileTierPresentFlag,
unsigned int max_sub_layers_minus1)
 {
-VVCCProfileTierLevel general_ptl;
+VVCCProfileTierLevel general_ptl = { 0 };
 int j;
 
 if (profileTierPresentFlag) {
@@ -326,6 +328,7 @@ static int vvcc_parse_vps(GetBitContext *gb,
 
 for (int i = 0; i <= vps_num_ptls_minus1; i++)
 vvcc_parse_ptl(gb, vvcc, vps_pt_present_flag[i], vps_ptl_max_tid[i]);
+vvcc->ptl_present_flag = 1;
 
 /* nothing useful for vvcc past this point */
 return 0;
@@ -356,8 +359,10 @@ static int vvcc_parse_sps(GetBitContext *gb,
 vvcc->chroma_format_idc = get_bits(gb, 2);
 sps_log2_ctu_size_minus5 = get_bits(gb, 2);
 
-if (get_bits1(gb))  // sps_ptl_dpb_hrd_params_present_flag
+if (get_bits1(gb)) {// sps_ptl_dpb_hrd_params_present_flag
+vvcc->ptl_present_flag = 1;
 vvcc_parse_ptl(gb, vvcc, 1, sps_max_sublayers_minus1);
+}
 
 skip_bits1(gb); // sps_gdr_enabled_flag
 if (get_bits(gb, 1))// sps_ref_pic_resampling_enabled_flag
@@ -579,10 +584,6 @@ static void vvcc_init(VVCDecoderConfigurationRecord *vvcc)
 {
 memset(vvcc, 0, sizeof(VVCDecoderConfigurationRecord));
 vvcc->lengthSizeMinusOne = 3;   // 4 bytes
-
-vvcc->ptl.num_bytes_constraint_info = 1;
-
-vvcc->ptl_present_flag = 1;
 }
 
 static void vvcc_close(VVCDecoderConfigurationRecord *vvcc)
@@ -603,7 +604,6 @@ static int vvcc_write(AVIOContext *pb, 
VVCDecoderConfigurationRecord *vvcc)
 {
 uint8_t i;
 uint16_t j, vps_count = 0, sps_count = 0, pps_count = 0;
-unsigned char *buf = NULL;
 /*
  * It's unclear how to properly compute these fields, so
  * let's always set them to values meaning 'unspecified'.
@@ -735,6 +735,10 @@ static int vvcc_write(AVIOContext *pb, 
VVCDecoderConfigurationRecord *vvcc)
 avio_w8(pb, vvcc->lengthSizeMinusOne << 1 | vvcc->ptl_present_flag | 0xf8);
 
 if (vvcc->ptl_present_flag) {
+uint8_t buf[64];
+PutBitContext pbc;
+
+init_put_bits(&pbc, buf, sizeof(buf));
 /*
  * unsigned int(9) ols_idx;
  * unsigned int(3) num_sublayers;
@@ -766,15 +770,14 @@ static int vvcc_write(AVIOContext *pb, 
VVCDecoderConfigurationRecord *vvcc)
  * unsigned int (1) ptl_frame_only_constraint_flag
  * unsigned int (1) ptl_multilayer_enabled_flag
  * unsigned int (8*num_bytes_constraint_info -2) 
general_constraint_info */
-buf =
-(unsigned char *) malloc(sizeof(unsigned char) *
- vvcc->ptl.num_bytes_constraint_info);
-*buf = vvcc->ptl.ptl_frame_only_constraint_flag << vvcc->ptl.
-num_bytes_constraint_info * 8 - 1 | vvcc->ptl.
-ptl_multilayer_enabled_flag << vvcc->ptl.num_bytes_constraint_info 
*
-8 - 2 | *vvcc->ptl.general_constraint_info >> 2;
-avio_write(pb, buf, vvcc->ptl.num_bytes_constraint_info);
-free(buf);

[FFmpeg-cvslog] avformat/vvc: generalize calculating num_bytes_constraint_info

2024-05-18 Thread James Almer
ffmpeg | branch: master | James Almer  | Thu May 16 20:51:38 
2024 -0300| [cba15ca0ec418fa169563ec63065a69ee191c1d5] | committer: James Almer

avformat/vvc: generalize calculating num_bytes_constraint_info

Will be useful for when the aditional bits are supported, as well as for the
next commit.

Signed-off-by: James Almer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cba15ca0ec418fa169563ec63065a69ee191c1d5
---

 libavformat/vvc.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavformat/vvc.c b/libavformat/vvc.c
index 92773579a8..af25f137ee 100644
--- a/libavformat/vvc.c
+++ b/libavformat/vvc.c
@@ -79,7 +79,7 @@ typedef struct VVCCProfileTierLevel {
 // general_constraint_info
 uint8_t gci_present_flag;
 uint8_t gci_general_constraints[9];
-uint8_t gci_num_reserved_bits;
+uint8_t num_bytes_constraint_info;
 // end general_constraint_info
 uint8_t ptl_sublayer_level_present_flag[VVC_MAX_SUBLAYERS - 1];
 uint8_t sublayer_level_idc[VVC_MAX_SUBLAYERS - 1];
@@ -137,13 +137,12 @@ static void vvcc_update_ptl(VVCDecoderConfigurationRecord 
*vvcc,
  * Constraints Info
  */
 if (ptl->gci_present_flag) {
-vvcc->ptl.num_bytes_constraint_info = 9;
+vvcc->ptl.num_bytes_constraint_info = ptl->num_bytes_constraint_info;
 memcpy(&vvcc->ptl.general_constraint_info[0],
-   &ptl->gci_general_constraints[0], sizeof(uint8_t) * 9);
-
+   &ptl->gci_general_constraints[0], 
ptl->num_bytes_constraint_info);
 } else {
 vvcc->ptl.num_bytes_constraint_info = 1;
-memset(&vvcc->ptl.general_constraint_info[0], 0, sizeof(uint8_t) * 9);
+memset(&vvcc->ptl.general_constraint_info[0], 0, 
sizeof(vvcc->ptl.general_constraint_info));
 }
 
 /*
@@ -188,7 +187,6 @@ static void vvcc_parse_ptl(GetBitContext *gb,
unsigned int max_sub_layers_minus1)
 {
 VVCCProfileTierLevel general_ptl = { 0 };
-int j;
 
 if (profileTierPresentFlag) {
 general_ptl.profile_idc = get_bits(gb, 7);
@@ -201,12 +199,14 @@ static void vvcc_parse_ptl(GetBitContext *gb,
 if (profileTierPresentFlag) {   // parse constraint info
 general_ptl.gci_present_flag = get_bits1(gb);
 if (general_ptl.gci_present_flag) {
+int gci_num_reserved_bits, j;
 for (j = 0; j < 8; j++)
 general_ptl.gci_general_constraints[j] = get_bits(gb, 8);
-general_ptl.gci_general_constraints[8] = get_bits(gb, 7);
+general_ptl.gci_general_constraints[j++] = get_bits(gb, 7);
 
-general_ptl.gci_num_reserved_bits = get_bits(gb, 8);
-skip_bits(gb, general_ptl.gci_num_reserved_bits);
+gci_num_reserved_bits = get_bits(gb, 8);
+general_ptl.num_bytes_constraint_info = j;
+skip_bits(gb, gci_num_reserved_bits);
 }
 while (gb->index % 8 != 0)
 skip_bits1(gb);

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-cvslog] avfilter/dnn: Refactor DNN parameter configuration system

2024-05-18 Thread Zhao Zhili
ffmpeg | branch: master | Zhao Zhili  | Wed May  8 
00:08:08 2024 +0800| [8c21f1e3b71ab6f82c8127a3a0b0b10d13c91caf] | committer: 
Guo Yejun

avfilter/dnn: Refactor DNN parameter configuration system

This patch trying to resolve mulitiple issues related to parameter
configuration:

Firstly, each DNN filters duplicate DNN_COMMON_OPTIONS, which should
be the common options of backend.

Secondly, backend options are hidden behind the scene. It's a
AV_OPT_TYPE_STRING backend_configs for user, and parsed by each
backend. We don't know each backend support what kind of options
from the help message.

Third, DNN backends duplicate DNN_BACKEND_COMMON_OPTIONS.

Last but not the least, pass backend options via AV_OPT_TYPE_STRING
makes it hard to pass AV_OPT_TYPE_BINARY to backend, if not impossible.

This patch puts backend common options and each backend options inside
DnnContext to reduce code duplication, make options user friendly, and
easy to extend for future usecase.

For example,

./ffmpeg -h filter=dnn_processing

dnn_processing AVOptions:
   dnn_backend   ..FV... DNN backend (from INT_MIN to 
INT_MAX) (default tensorflow)
 tensorflow  1..FV... tensorflow backend flag
 openvino2..FV... openvino backend flag
 torch   3..FV... torch backend flag

dnn_base AVOptions:
   model  ..F path to model file
   input  ..F input name of the model
   output ..F output name of the model
   backend_configs..F...P backend configs (deprecated)
   options..F...P backend configs (deprecated)
   nireq ..F number of request (from 0 to 
INT_MAX) (default 0)
   async ..F use DNN async inference (default 
true)
   device ..F device to run model

dnn_tensorflow AVOptions:
   sess_config..F config for SessionOptions

dnn_openvino AVOptions:
   batch_size..F batch size per request (from 1 to 
1000) (default 1)
   input_resizable   ..F can input be resizable or not 
(default false)
   layout..F input layout of model (from 0 to 
2) (default none)
 none0..F none
 nchw1..F nchw
 nhwc2..F nhwc
   scale   ..F Add scale preprocess operation. 
Divide each element of input by specified value. (from INT_MIN to INT_MAX) 
(default 0)
   mean..F Add mean preprocess operation. 
Subtract specified value from each element of input. (from INT_MIN to INT_MAX) 
(default 0)

dnn_th AVOptions:
   optimize  ..F turn on graph executor 
optimization (from 0 to 1) (default 0)

Signed-off-by: Zhao Zhili 
Reviewed-by: Wenbin Chen 
Reviewed-by: Guo Yejun 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8c21f1e3b71ab6f82c8127a3a0b0b10d13c91caf
---

 libavfilter/dnn/dnn_backend_common.h   |  13 ++-
 libavfilter/dnn/dnn_backend_openvino.c | 146 +
 libavfilter/dnn/dnn_backend_tf.c   |  82 +++---
 libavfilter/dnn/dnn_backend_torch.cpp  |  67 ++-
 libavfilter/dnn/dnn_interface.c|  90 
 libavfilter/dnn_filter_common.c|  38 -
 libavfilter/dnn_filter_common.h|  39 -
 libavfilter/dnn_interface.h|  67 +--
 libavfilter/vf_derain.c|   6 +-
 libavfilter/vf_dnn_classify.c  |   4 +-
 libavfilter/vf_dnn_detect.c|   4 +-
 libavfilter/vf_dnn_processing.c|   4 +-
 libavfilter/vf_sr.c|   6 +-
 13 files changed, 337 insertions(+), 229 deletions(-)

diff --git a/libavfilter/dnn/dnn_backend_common.h 
b/libavfilter/dnn/dnn_backend_common.h
index 42c67c7040..9f5d37b3e0 100644
--- a/libavfilter/dnn/dnn_backend_common.h
+++ b/libavfilter/dnn/dnn_backend_common.h
@@ -28,9 +28,16 @@
 #include "../dnn_interface.h"
 #include "libavutil/thread.h"
 
-#define DNN_BACKEND_COMMON_OPTIONS \
-{ "nireq",   "number of request", 
OFFSET(options.nireq),   AV_OPT_TYPE_INT,{ .i64 = 0 }, 0, 
INT_MAX, FLAGS }, \
-{ "async",   "use DNN async inference",   
OFFSET(options.async),   AV_OPT_TYPE_BOOL,   { .i64 = 1 }, 0,   
1, FLAGS },
+#define DNN_DEFINE_CLASS_EXT(name, desc, options) \
+{   \
+.class_name = desc, \
+.item_name  = av_default_item_name, \
+.option = options,  \
+.version= LIBAVUTIL_VERSION_INT,\
+.category   = AV_CLASS_CATEGORY_FILTER, \
+}
+#define DNN_DEFINE_CLASS(fname) \
+DNN_DEFINE_CLASS_EXT(fname, #fname, fname##_options)
 
 // 

[FFmpeg-cvslog] avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

2024-05-18 Thread Brad Smith
ffmpeg | branch: master | Brad Smith  | Sat May 18 07:38:40 
2024 -0400| [115c96b9bd53e775f425f23d5b73fa0a9dedbd08] | committer: Brad Smith

avutil/ppc/cpu: Also use the machdep.altivec sysctl on NetBSD

Use the machdep.altivec sysctl on NetBSD for AltiVec detection
as is done with OpenBSD.

Signed-off-by: Brad Smith 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=115c96b9bd53e775f425f23d5b73fa0a9dedbd08
---

 libavutil/ppc/cpu.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index bc8bb5f47c..2b13cda662 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -27,7 +27,7 @@
 #if HAVE_UNISTD_H
 #include 
 #endif
-#elif defined(__OpenBSD__)
+#elif defined(__NetBSD__) || defined(__OpenBSD__)
 #include 
 #include 
 #include 
@@ -56,8 +56,8 @@ int ff_get_cpu_flags_ppc(void)
 if (result == VECTORTYPE_ALTIVEC)
 return AV_CPU_FLAG_ALTIVEC;
 return 0;
-#elif defined(__APPLE__) || defined(__OpenBSD__)
-#ifdef __OpenBSD__
+#elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__NetBSD__) || defined(__OpenBSD__)
 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
 #else
 int sels[2] = {CTL_HW, HW_VECTORUNIT};

___
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".