Re: [FFmpeg-devel] [PATCH] libavutil/riscv: Make use of elf_aux_info() on FreeBSD / OpenBSD riscv

2024-11-24 Thread Brad Smith

On 2024-11-18 1:28 p.m., Rémi Denis-Courmont wrote:

Le maanantaina 18. marraskuuta 2024, 4.02.39 EET Brad Smith a écrit :

libavutil/riscv: Make use of elf_aux_info() on FreeBSD / OpenBSD riscv

FreeBSD/OpenBSD riscv have elf_aux_info().

Does OpenBSD use the same HWCAP encoding as Linux and FreeBSD?


Yes. All of the relevant bits were copied as is from FreeBSD and the feature
flags are the same between all of them.


On real contemporary commercial hardware, there are two CPU configurations that
affect FFmpeg, on top of the baseline RV64GC/RVA20:
- StarFive JH7110: Zba and Zbb,
- Canaan K230 and SpacemiT K1: Zba, Zbb, Zbs and V (or RVA22 + V).

The first one simply can't be handled with this encoding scheme which leaves no
room for extension without single letter designation.

The second one won't be detected properly unless the kernel understands that B
is equivalent to Zba, Zbb and Zbs (or the device tree is manually patched). It
seems that at least FreeBSD fails there:https://reviews.freebsd.org/D46277


I wasn't aware of that. My consideration for this was for the eventual 
Vector support.


Thanks for pointing out the diff. I'll see about bringing that in as a 
start.

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

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


Re: [FFmpeg-devel] [PATCH] lavu/riscv: fix compilation without Vector support

2024-11-17 Thread Brad Smith

On 2024-11-17 4:17 a.m., Rémi Denis-Courmont wrote:

The half-baked assembler in Clang 16 and earlier can't process our
RISC-V assembler. This adds yet another work around that.

If you must use Clang, please use version 17 or later.


LGTM. Fixes build with 16.



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

diff --git a/libavutil/riscv/cpu.h b/libavutil/riscv/cpu.h
index 191e4478c5..f2e6b7b430 100644
--- a/libavutil/riscv/cpu.h
+++ b/libavutil/riscv/cpu.h
@@ -56,7 +56,6 @@ static inline size_t ff_get_rv_vlenb(void)
  ".option pop\n" : "=r" (vlenb));
  return vlenb;
  }
-#endif
  
  /**

   * Checks that the vector bit-size is at least the given value.
@@ -78,3 +77,4 @@ static inline bool ff_rv_vlen_least(unsigned int bits)
  return bits <= (8 * ff_get_rv_vlenb());
  }
  #endif
+#endif /* HAVE_RVV */

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

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


[FFmpeg-devel] [PATCH] libavutil/riscv: Make use of elf_aux_info() on FreeBSD / OpenBSD riscv

2024-11-17 Thread Brad Smith
libavutil/riscv: Make use of elf_aux_info() on FreeBSD / OpenBSD riscv

FreeBSD/OpenBSD riscv have elf_aux_info().

Signed-off-by: Brad Smith 
---
 libavutil/riscv/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/riscv/cpu.c b/libavutil/riscv/cpu.c
index 4ec6d6c826..163e4fc14a 100644
--- a/libavutil/riscv/cpu.c
+++ b/libavutil/riscv/cpu.c
@@ -25,7 +25,7 @@
 #include "libavutil/log.h"
 #include "config.h"
 
-#if HAVE_GETAUXVAL
+#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
 #include 
 #define HWCAP_RV(letter) (1ul << ((letter) - 'A'))
 #endif
@@ -84,7 +84,7 @@ int ff_get_cpu_flags_riscv(void)
 default:
 }
 }
-#elif HAVE_GETAUXVAL
+#elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
 {
 const unsigned long hwcap = ff_getauxval(AT_HWCAP);
 
-- 
2.47.0

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

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


Re: [FFmpeg-devel] [PATCH] libavutil/ppc: defines involving bit shifts should be unsigned

2024-11-01 Thread Brad Smith

I had a bigger diff to handle all of the same type of flags in the same
manner, but I can post that separately.

LGTM.

On 2024-11-02 2:13 a.m., Sean McGovern wrote:

Otherwise, these can overflow at the boundaries of the integer type.
---
  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 62d495ec1d..9f9c073434 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -53,9 +53,9 @@
  #define AT_HWCAP226
  #endif
  
-#define HWCAP_PPC_VSX(1 << 7)

-#define HWCAP_PPC_ALTIVEC(1 << 28)
-#define HWCAP2_PPC_ARCH_2_07 (1 << 31)
+#define HWCAP_PPC_VSX(1U << 7)
+#define HWCAP_PPC_ALTIVEC(1U << 28)
+#define HWCAP2_PPC_ARCH_2_07 (1U << 31)
  
  /**

   * This function MAY rely on signal() or fork() in order to make sure AltiVec

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

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


Re: [FFmpeg-devel] [PATCH] libavutil/ppc: Include the hardware feature flags like the other archs

2024-11-01 Thread Brad Smith

On 2024-11-01 8:50 p.m., Michael Niedermayer wrote:

On Fri, Nov 01, 2024 at 01:45:46AM -0400, Brad Smith wrote:

ping.

it builds on my old cross compile environment on ubuntu
but i have no real ppc here to test beyond that

thx


Tested with a Linux Power8 VM.

[almalinux@ffmpeg1 tests]$ ./cpu
cpu_flags(raw) = 0x0007
cpu_flags_str(raw) = altivec vsx power8
cpu_flags(effective) = 0x0007
cpu_flags_str(effective) = altivec vsx power8
threads = auto (cpu_count = 2)



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

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


Re: [FFmpeg-devel] [PATCH] libavutil/ppc: Include the hardware feature flags like the other archs

2024-11-01 Thread Brad Smith

ping.

On 2024-10-20 3:44 a.m., Brad Smith wrote:

libavutil/ppc: Include the hardware feature flags like the other archs

Also include the hardware feature flags like the other archs do and
clean up the code a bit.

Tested on Linux POWER8.

Signed-off-by: Brad Smith 
---
  libavutil/ppc/cpu.c | 35 +--
  1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index 9381272175..62d495ec1d 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -46,6 +46,17 @@
  #include "libavutil/cpu.h"
  #include "libavutil/cpu_internal.h"
  
+#ifndef AT_HWCAP

+#define AT_HWCAP 16
+#endif
+#ifndef AT_HWCAP2
+#define AT_HWCAP226
+#endif
+
+#define HWCAP_PPC_VSX(1 << 7)
+#define HWCAP_PPC_ALTIVEC(1 << 28)
+#define HWCAP2_PPC_ARCH_2_07 (1 << 31)
+
  /**
   * This function MAY rely on signal() or fork() in order to make sure AltiVec
   * is present.
@@ -65,20 +76,14 @@ int ff_get_cpu_flags_ppc(void)
  int flags = 0;
  
  unsigned long hwcap = ff_getauxval(AT_HWCAP);

-#ifdef PPC_FEATURE2_ARCH_2_07
  unsigned long hwcap2 = ff_getauxval(AT_HWCAP2);
-#endif
  
-if (hwcap & PPC_FEATURE_HAS_ALTIVEC)

+if (hwcap & HWCAP_PPC_ALTIVEC)
 flags |= AV_CPU_FLAG_ALTIVEC;
-#ifdef PPC_FEATURE_HAS_VSX
-if (hwcap & PPC_FEATURE_HAS_VSX)
+if (hwcap & HWCAP_PPC_VSX)
 flags |= AV_CPU_FLAG_VSX;
-#endif
-#ifdef PPC_FEATURE2_ARCH_2_07
-if (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+if (hwcap2 & HWCAP2_PPC_ARCH_2_07)
 flags |= AV_CPU_FLAG_POWER8;
-#endif
  
  return flags;

  #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
@@ -112,23 +117,17 @@ int ff_get_cpu_flags_ppc(void)
  if (buf[i] == AT_NULL)
  goto out;
  if (buf[i] == AT_HWCAP) {
-if (buf[i + 1] & PPC_FEATURE_HAS_ALTIVEC)
+if (buf[i + 1] & HWCAP_PPC_ALTIVEC)
  ret = AV_CPU_FLAG_ALTIVEC;
-#ifdef PPC_FEATURE_HAS_VSX
-if (buf[i + 1] & PPC_FEATURE_HAS_VSX)
+if (buf[i + 1] & HWCAP_PPC_VSX)
  ret |= AV_CPU_FLAG_VSX;
-#endif
  if (ret & AV_CPU_FLAG_VSX)
  av_assert0(ret & AV_CPU_FLAG_ALTIVEC);
  }
-#ifdef AT_HWCAP2 /* not introduced until glibc 2.18 */
  else if (buf[i] == AT_HWCAP2) {
-#ifdef PPC_FEATURE2_ARCH_2_07
-if (buf[i + 1] & PPC_FEATURE2_ARCH_2_07)
+if (buf[i + 1] & HWCAP2_PPC_ARCH_2_07)
  ret |= AV_CPU_FLAG_POWER8;
-#endif
  }
-#endif /* AT_HWCAP2 */
  }
  }
  

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

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


[FFmpeg-devel] [PATCH] libavutil/ppc: Include the hardware feature flags like the other archs

2024-10-20 Thread Brad Smith
libavutil/ppc: Include the hardware feature flags like the other archs

Also include the hardware feature flags like the other archs do and
clean up the code a bit.

Tested on Linux POWER8.

Signed-off-by: Brad Smith 
---
 libavutil/ppc/cpu.c | 35 +--
 1 file changed, 17 insertions(+), 18 deletions(-)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index 9381272175..62d495ec1d 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -46,6 +46,17 @@
 #include "libavutil/cpu.h"
 #include "libavutil/cpu_internal.h"
 
+#ifndef AT_HWCAP
+#define AT_HWCAP 16
+#endif
+#ifndef AT_HWCAP2
+#define AT_HWCAP226
+#endif
+
+#define HWCAP_PPC_VSX(1 << 7)
+#define HWCAP_PPC_ALTIVEC(1 << 28)
+#define HWCAP2_PPC_ARCH_2_07 (1 << 31)
+
 /**
  * This function MAY rely on signal() or fork() in order to make sure AltiVec
  * is present.
@@ -65,20 +76,14 @@ int ff_get_cpu_flags_ppc(void)
 int flags = 0;
 
 unsigned long hwcap = ff_getauxval(AT_HWCAP);
-#ifdef PPC_FEATURE2_ARCH_2_07
 unsigned long hwcap2 = ff_getauxval(AT_HWCAP2);
-#endif
 
-if (hwcap & PPC_FEATURE_HAS_ALTIVEC)
+if (hwcap & HWCAP_PPC_ALTIVEC)
flags |= AV_CPU_FLAG_ALTIVEC;
-#ifdef PPC_FEATURE_HAS_VSX
-if (hwcap & PPC_FEATURE_HAS_VSX)
+if (hwcap & HWCAP_PPC_VSX)
flags |= AV_CPU_FLAG_VSX;
-#endif
-#ifdef PPC_FEATURE2_ARCH_2_07
-if (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+if (hwcap2 & HWCAP2_PPC_ARCH_2_07)
flags |= AV_CPU_FLAG_POWER8;
-#endif
 
 return flags;
 #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
@@ -112,23 +117,17 @@ int ff_get_cpu_flags_ppc(void)
 if (buf[i] == AT_NULL)
 goto out;
 if (buf[i] == AT_HWCAP) {
-if (buf[i + 1] & PPC_FEATURE_HAS_ALTIVEC)
+if (buf[i + 1] & HWCAP_PPC_ALTIVEC)
 ret = AV_CPU_FLAG_ALTIVEC;
-#ifdef PPC_FEATURE_HAS_VSX
-if (buf[i + 1] & PPC_FEATURE_HAS_VSX)
+if (buf[i + 1] & HWCAP_PPC_VSX)
 ret |= AV_CPU_FLAG_VSX;
-#endif
 if (ret & AV_CPU_FLAG_VSX)
 av_assert0(ret & AV_CPU_FLAG_ALTIVEC);
 }
-#ifdef AT_HWCAP2 /* not introduced until glibc 2.18 */
 else if (buf[i] == AT_HWCAP2) {
-#ifdef PPC_FEATURE2_ARCH_2_07
-if (buf[i + 1] & PPC_FEATURE2_ARCH_2_07)
+if (buf[i + 1] & HWCAP2_PPC_ARCH_2_07)
 ret |= AV_CPU_FLAG_POWER8;
-#endif
 }
-#endif /* AT_HWCAP2 */
 }
 }
 
-- 
2.46.2

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

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


Re: [FFmpeg-devel] [PATCH] ppc: Recognize the PPC VSX and Power8 CPU flags

2024-09-27 Thread Brad Smith

ping.

On 2024-09-21 5:05 a.m., Brad Smith wrote:

ppc: Recognize the PPC VSX and Power8 CPU flags

Signed-off-by: Brad Smith 
---
  libavutil/cpu.c   | 2 ++
  libavutil/tests/cpu.c | 2 ++
  2 files changed, 4 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index df00bd541f..44cbb9e9ff 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -120,6 +120,8 @@ int av_parse_cpu_caps(unsigned *flags, const char *s)
  { "flags"   , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, INT64_MAX, 
.unit = "flags" },
  #if   ARCH_PPC
  { "altivec" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ALTIVEC  },
.unit = "flags" },
+{ "vsx" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VSX  },
.unit = "flags" },
+{ "power8"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_POWER8   },
.unit = "flags" },
  #elif ARCH_X86
  { "mmx" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_MMX  },
.unit = "flags" },
  { "mmx2", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_MMX2 },
.unit = "flags" },
diff --git a/libavutil/tests/cpu.c b/libavutil/tests/cpu.c
index 0a459c1d9e..53e9f99950 100644
--- a/libavutil/tests/cpu.c
+++ b/libavutil/tests/cpu.c
@@ -51,6 +51,8 @@ static const struct {
  { AV_CPU_FLAG_SETEND,"setend" },
  #elif ARCH_PPC
  { AV_CPU_FLAG_ALTIVEC,   "altivec"},
+{ AV_CPU_FLAG_VSX,   "vsx"},
+{ AV_CPU_FLAG_POWER8,"power8" },
  #elif ARCH_MIPS
  { AV_CPU_FLAG_MMI,   "mmi"},
  { AV_CPU_FLAG_MSA,   "msa"},

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

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


[FFmpeg-devel] [PATCH] ppc: Recognize the PPC VSX and Power8 CPU flags

2024-09-21 Thread Brad Smith
ppc: Recognize the PPC VSX and Power8 CPU flags

Signed-off-by: Brad Smith 
---
 libavutil/cpu.c   | 2 ++
 libavutil/tests/cpu.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index df00bd541f..44cbb9e9ff 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -120,6 +120,8 @@ int av_parse_cpu_caps(unsigned *flags, const char *s)
 { "flags"   , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, 
INT64_MAX, .unit = "flags" },
 #if   ARCH_PPC
 { "altivec" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ALTIVEC 
 },.unit = "flags" },
+{ "vsx" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VSX 
 },.unit = "flags" },
+{ "power8"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_POWER8  
 },.unit = "flags" },
 #elif ARCH_X86
 { "mmx" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_MMX 
 },.unit = "flags" },
 { "mmx2", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_MMX2
 },.unit = "flags" },
diff --git a/libavutil/tests/cpu.c b/libavutil/tests/cpu.c
index 0a459c1d9e..53e9f99950 100644
--- a/libavutil/tests/cpu.c
+++ b/libavutil/tests/cpu.c
@@ -51,6 +51,8 @@ static const struct {
 { AV_CPU_FLAG_SETEND,"setend" },
 #elif ARCH_PPC
 { AV_CPU_FLAG_ALTIVEC,   "altivec"},
+{ AV_CPU_FLAG_VSX,   "vsx"},
+{ AV_CPU_FLAG_POWER8,"power8" },
 #elif ARCH_MIPS
 { AV_CPU_FLAG_MMI,   "mmi"},
 { AV_CPU_FLAG_MSA,   "msa"},
-- 
2.46.0

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

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


Re: [FFmpeg-devel] [PATCH v3] libavutil/ppc: Make use of getauxval() and elf_aux_info() on ppc

2024-09-20 Thread Brad Smith

ping.

On 2024-09-15 1:40 a.m., Brad Smith wrote:

libavutil/ppc: Make use of getauxval() and elf_aux_info() on ppc

Modern Linux has getauxval() and FreeBSD/OpenBSD ppc have elf_aux_info().

Signed-off-by: Brad Smith 
---
v2: adjust to build with older glibc.
v3: freebsd/ppc requires machine/cpu.h header for feature flags.

  libavutil/ppc/cpu.c | 25 +
  1 file changed, 25 insertions(+)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index 2b13cda662..9381272175 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -20,6 +20,11 @@
  
  #ifdef __APPLE__

  #include 
+#elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
+#ifdef __FreeBSD__
+#include 
+#endif
+#include 
  #elif defined(__linux__)
  #include 
  #include 
@@ -56,6 +61,26 @@ int ff_get_cpu_flags_ppc(void)
  if (result == VECTORTYPE_ALTIVEC)
  return AV_CPU_FLAG_ALTIVEC;
  return 0;
+#elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
+int flags = 0;
+
+unsigned long hwcap = ff_getauxval(AT_HWCAP);
+#ifdef PPC_FEATURE2_ARCH_2_07
+unsigned long hwcap2 = ff_getauxval(AT_HWCAP2);
+#endif
+
+if (hwcap & PPC_FEATURE_HAS_ALTIVEC)
+   flags |= AV_CPU_FLAG_ALTIVEC;
+#ifdef PPC_FEATURE_HAS_VSX
+if (hwcap & PPC_FEATURE_HAS_VSX)
+   flags |= AV_CPU_FLAG_VSX;
+#endif
+#ifdef PPC_FEATURE2_ARCH_2_07
+if (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+   flags |= AV_CPU_FLAG_POWER8;
+#endif
+
+return flags;
  #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
  #if defined(__NetBSD__) || defined(__OpenBSD__)
  int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};

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

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


[FFmpeg-devel] [PATCH v3] libavutil/ppc: Make use of getauxval() and elf_aux_info() on ppc

2024-09-14 Thread Brad Smith
libavutil/ppc: Make use of getauxval() and elf_aux_info() on ppc

Modern Linux has getauxval() and FreeBSD/OpenBSD ppc have elf_aux_info().

Signed-off-by: Brad Smith 
---
v2: adjust to build with older glibc.
v3: freebsd/ppc requires machine/cpu.h header for feature flags.

 libavutil/ppc/cpu.c | 25 +
 1 file changed, 25 insertions(+)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index 2b13cda662..9381272175 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -20,6 +20,11 @@
 
 #ifdef __APPLE__
 #include 
+#elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
+#ifdef __FreeBSD__
+#include 
+#endif
+#include 
 #elif defined(__linux__)
 #include 
 #include 
@@ -56,6 +61,26 @@ int ff_get_cpu_flags_ppc(void)
 if (result == VECTORTYPE_ALTIVEC)
 return AV_CPU_FLAG_ALTIVEC;
 return 0;
+#elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
+int flags = 0;
+
+unsigned long hwcap = ff_getauxval(AT_HWCAP);
+#ifdef PPC_FEATURE2_ARCH_2_07
+unsigned long hwcap2 = ff_getauxval(AT_HWCAP2);
+#endif
+
+if (hwcap & PPC_FEATURE_HAS_ALTIVEC)
+   flags |= AV_CPU_FLAG_ALTIVEC;
+#ifdef PPC_FEATURE_HAS_VSX
+if (hwcap & PPC_FEATURE_HAS_VSX)
+   flags |= AV_CPU_FLAG_VSX;
+#endif
+#ifdef PPC_FEATURE2_ARCH_2_07
+if (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+   flags |= AV_CPU_FLAG_POWER8;
+#endif
+
+return flags;
 #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
-- 
2.46.0

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

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


[FFmpeg-devel] [PATCH v2] libavutil/ppc: Make use of getauxval() and elf_aux_info() on ppc

2024-09-13 Thread Brad Smith
Subject: [PATCH] libavutil/ppc: Make use of getauxval() and elf_aux_info() on 
ppc

Modern Linux has getauxval() and FreeBSD/OpenBSD ppc have elf_aux_info().

Signed-off-by: Brad Smith 
---
adjust to build with older glibc.

 libavutil/ppc/cpu.c | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index 2b13cda662..5dd23013fb 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -20,6 +20,8 @@
 
 #ifdef __APPLE__
 #include 
+#elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
+#include 
 #elif defined(__linux__)
 #include 
 #include 
@@ -56,6 +58,26 @@ int ff_get_cpu_flags_ppc(void)
 if (result == VECTORTYPE_ALTIVEC)
 return AV_CPU_FLAG_ALTIVEC;
 return 0;
+#elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
+int flags = 0;
+
+unsigned long hwcap = ff_getauxval(AT_HWCAP);
+#ifdef PPC_FEATURE2_ARCH_2_07
+unsigned long hwcap2 = ff_getauxval(AT_HWCAP2);
+#endif
+
+if (hwcap & PPC_FEATURE_HAS_ALTIVEC)
+   flags |= AV_CPU_FLAG_ALTIVEC;
+#ifdef PPC_FEATURE_HAS_VSX
+if (hwcap & PPC_FEATURE_HAS_VSX)
+   flags |= AV_CPU_FLAG_VSX;
+#endif
+#ifdef PPC_FEATURE2_ARCH_2_07
+if (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+   flags |= AV_CPU_FLAG_POWER8;
+#endif
+
+return flags;
 #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
-- 
2.46.0

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

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


[FFmpeg-devel] [PATCH] libavutil/ppc: Make use of getauxval() and elf_aux_info() on ppc

2024-09-09 Thread Brad Smith
libavutil/ppc: Make use of getauxval() and elf_aux_info() on ppc

Modern Linux has getauxval() and FreeBSD/OpenBSD ppc have elf_aux_info().

Signed-off-by: Brad Smith 
---
 libavutil/ppc/cpu.c | 16 
 1 file changed, 16 insertions(+)

diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index 2b13cda662..6dc1961e7a 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -20,6 +20,8 @@
 
 #ifdef __APPLE__
 #include 
+#elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
+#include 
 #elif defined(__linux__)
 #include 
 #include 
@@ -56,6 +58,20 @@ int ff_get_cpu_flags_ppc(void)
 if (result == VECTORTYPE_ALTIVEC)
 return AV_CPU_FLAG_ALTIVEC;
 return 0;
+#elif HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
+int flags = 0;
+
+unsigned long hwcap = ff_getauxval(AT_HWCAP);
+unsigned long hwcap2 = ff_getauxval(AT_HWCAP2);
+
+if (hwcap & PPC_FEATURE_HAS_ALTIVEC)
+   flags |= AV_CPU_FLAG_ALTIVEC;
+if (hwcap & PPC_FEATURE_HAS_VSX)
+   flags |= AV_CPU_FLAG_VSX;
+if (hwcap2 & PPC_FEATURE2_ARCH_2_07)
+   flags |= AV_CPU_FLAG_POWER8;
+
+return flags;
 #elif defined(__APPLE__) || defined(__NetBSD__) || defined(__OpenBSD__)
 #if defined(__NetBSD__) || defined(__OpenBSD__)
 int sels[2] = {CTL_MACHDEP, CPU_ALTIVEC};
-- 
2.46.0

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

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


Re: [FFmpeg-devel] aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD

2024-09-09 Thread Brad Smith

On 2024-09-09 7:11 a.m., Ramiro Polla wrote:

On Mon, Sep 9, 2024 at 1:06 PM Brad Smith
 wrote:

On 2024-09-09 7:00 a.m., Martin Storsjö wrote:

On Mon, 9 Sep 2024, Brad Smith wrote:


aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD

FreeBSD 12.0+, OpenBSD -current and what will be OpenBSD 7.6 support
elf_aux_info(3).

Signed-off-by: Brad Smith
---
configure   | 2 ++
libavutil/aarch64/cpu.c | 2 +-
libavutil/cpu.c | 9 -
3 files changed, 11 insertions(+), 2 deletions(-)

LGTM, thanks. (I guess the same change as in aarch64/cpu.c also could
be done in other architectures' cpu.c?)

I was looking at ppc for ppc64. Adding some sort of /proc/self/auxv
fallback to ff_getauxval() and then
re-writting all that to use ff_getauxval() and have support for
FreeBSD/powerpc64 and OpenBSD/powerpc64.
FFmpeg is the only project I have come across so far that does not use
getauxval() on ppc64.

Patches welcome :). Do you have such a system for testing?



I have a Linux ppc64 VM so I can test that part.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD

2024-09-09 Thread Brad Smith

On 2024-09-09 7:00 a.m., Martin Storsjö wrote:

On Mon, 9 Sep 2024, Brad Smith wrote:


aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD

FreeBSD 12.0+, OpenBSD -current and what will be OpenBSD 7.6 support
elf_aux_info(3).

Signed-off-by: Brad Smith 
---
configure   | 2 ++
libavutil/aarch64/cpu.c | 2 +-
libavutil/cpu.c | 9 -
3 files changed, 11 insertions(+), 2 deletions(-)


LGTM, thanks. (I guess the same change as in aarch64/cpu.c also could 
be done in other architectures' cpu.c?)


// Martin


I was looking at ppc for ppc64. Adding some sort of /proc/self/auxv 
fallback to ff_getauxval() and then
re-writting all that to use ff_getauxval() and have support for 
FreeBSD/powerpc64 and OpenBSD/powerpc64.
FFmpeg is the only project I have come across so far that does not use 
getauxval() on ppc64.


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

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


[FFmpeg-devel] aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD

2024-09-09 Thread Brad Smith
aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD

FreeBSD 12.0+, OpenBSD -current and what will be OpenBSD 7.6 support
elf_aux_info(3).

Signed-off-by: Brad Smith 
---
 configure   | 2 ++
 libavutil/aarch64/cpu.c | 2 +-
 libavutil/cpu.c | 9 -
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index a8e67d230c..d3bd46f382 100755
--- a/configure
+++ b/configure
@@ -2367,6 +2367,7 @@ SYSTEM_FUNCS="
 clock_gettime
 closesocket
 CommandLineToArgvW
+elf_aux_info
 fcntl
 getaddrinfo
 getauxval
@@ -6579,6 +6580,7 @@ check_func_headers mach/mach_time.h mach_absolute_time
 check_func_headers stdlib.h getenv
 check_func_headers sys/stat.h lstat
 check_func_headers sys/auxv.h getauxval
+check_func_headers sys/auxv.h elf_aux_info
 check_func_headers sys/sysctl.h sysctlbyname
 
 check_func_headers windows.h GetModuleHandle
diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
index 084c81e999..7631d13de0 100644
--- a/libavutil/aarch64/cpu.c
+++ b/libavutil/aarch64/cpu.c
@@ -20,7 +20,7 @@
 #include "libavutil/cpu_internal.h"
 #include "config.h"
 
-#if (defined(__linux__) || defined(__ANDROID__)) && HAVE_GETAUXVAL
+#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
 #include 
 #include 
 
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 61c1cf3faf..df00bd541f 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -49,7 +49,7 @@
 #include 
 #endif
 
-#if HAVE_GETAUXVAL
+#if HAVE_GETAUXVAL || HAVE_ELF_AUX_INFO
 #include 
 #endif
 
@@ -292,6 +292,13 @@ unsigned long ff_getauxval(unsigned long type)
 {
 #if HAVE_GETAUXVAL
 return getauxval(type);
+#elif HAVE_ELF_AUX_INFO
+unsigned long aux = 0;
+int ret = elf_aux_info(type, &aux, sizeof(aux));
+if (ret != 0) {
+errno = ret;
+}
+return aux;
 #else
 errno = ENOSYS;
 return 0;
-- 
2.46.0

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

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


Re: [FFmpeg-devel] [PATCH] avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()

2024-09-09 Thread Brad Smith

On 2024-09-09 5:55 a.m., Ramiro Polla wrote:

On Mon, Sep 9, 2024 at 11:34 AM Brad Smith  wrote:

On 2024-09-09 5:23 a.m., Ramiro Polla wrote:

On Sat, Aug 24, 2024 at 3:30 PM Brad Smith
 wrote:

avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()

Initially used for getauxval() but will be used to add support for
other API.

I'm curious, what other API do you have in mind? Is ff_getauxval()
going to simulate getauxval() on other platforms? If that's the case,
wouldn't it be better to create a function to get hardware
capabilities instead (which may use getauxval or other API under the
hood)?

elf_aux_info() for FreeBSD / OpenBSD.

Perhaps add this to the commit message as well?

Will do so.


Either way the patch looks good to me too. Thanks!


It would probably make sense
to move the /proc/self/auxv fallback path for Linux there too.

Yes, that makes sense to me.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

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

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


Re: [FFmpeg-devel] [PATCH] avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()

2024-09-09 Thread Brad Smith

On 2024-09-09 5:23 a.m., Ramiro Polla wrote:

On Sat, Aug 24, 2024 at 3:30 PM Brad Smith
 wrote:

avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()

Initially used for getauxval() but will be used to add support for
other API.

I'm curious, what other API do you have in mind? Is ff_getauxval()
going to simulate getauxval() on other platforms? If that's the case,
wouldn't it be better to create a function to get hardware
capabilities instead (which may use getauxval or other API under the
hood)?


elf_aux_info() for FreeBSD / OpenBSD. It would probably make sense
to move the /proc/self/auxv fallback path for Linux there too.

No, it will not.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()

2024-09-08 Thread Brad Smith

ping.

On 2024-08-24 9:19 a.m., Brad Smith wrote:

avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()

Initially used for getauxval() but will be used to add support for
other API.

Signed-off-by: Brad Smith 
---
  libavutil/aarch64/cpu.c   |  4 ++--
  libavutil/arm/cpu.c   |  2 +-
  libavutil/cpu.c   | 14 ++
  libavutil/cpu_internal.h  |  2 ++
  libavutil/loongarch/cpu.c |  2 +-
  libavutil/mips/cpu.c  |  2 +-
  libavutil/riscv/cpu.c |  2 +-
  7 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
index cfa9306663..084c81e999 100644
--- a/libavutil/aarch64/cpu.c
+++ b/libavutil/aarch64/cpu.c
@@ -31,8 +31,8 @@ static int detect_flags(void)
  {
  int flags = 0;
  
-unsigned long hwcap = getauxval(AT_HWCAP);

-unsigned long hwcap2 = getauxval(AT_HWCAP2);
+unsigned long hwcap = ff_getauxval(AT_HWCAP);
+unsigned long hwcap2 = ff_getauxval(AT_HWCAP2);
  
  if (hwcap & HWCAP_AARCH64_ASIMDDP)

  flags |= AV_CPU_FLAG_DOTPROD;
diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c
index c84a655c37..b84882005a 100644
--- a/libavutil/arm/cpu.c
+++ b/libavutil/arm/cpu.c
@@ -55,7 +55,7 @@
  static int get_auxval(uint32_t *hwcap)
  {
  #if HAVE_GETAUXVAL
-unsigned long ret = getauxval(AT_HWCAP);
+unsigned long ret = ff_getauxval(AT_HWCAP);
  if (ret == 0)
  return -1;
  *hwcap = ret;
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 41cee7fa77..61c1cf3faf 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -49,6 +49,10 @@
  #include 
  #endif
  
+#if HAVE_GETAUXVAL

+#include 
+#endif
+
  static atomic_int cpu_flags = -1;
  static atomic_int cpu_count = -1;
  
@@ -283,3 +287,13 @@ size_t av_cpu_max_align(void)
  
  return 8;

  }
+
+unsigned long ff_getauxval(unsigned long type)
+{
+#if HAVE_GETAUXVAL
+return getauxval(type);
+#else
+errno = ENOSYS;
+return 0;
+#endif
+}
diff --git a/libavutil/cpu_internal.h b/libavutil/cpu_internal.h
index 634f28bac4..585a115c49 100644
--- a/libavutil/cpu_internal.h
+++ b/libavutil/cpu_internal.h
@@ -59,4 +59,6 @@ size_t ff_get_cpu_max_align_ppc(void);
  size_t ff_get_cpu_max_align_x86(void);
  size_t ff_get_cpu_max_align_loongarch(void);
  
+unsigned long ff_getauxval(unsigned long type);

+
  #endif /* AVUTIL_CPU_INTERNAL_H */
diff --git a/libavutil/loongarch/cpu.c b/libavutil/loongarch/cpu.c
index cad8504fde..d8c67ad7c8 100644
--- a/libavutil/loongarch/cpu.c
+++ b/libavutil/loongarch/cpu.c
@@ -28,7 +28,7 @@
  static int cpu_flags_getauxval(void)
  {
  int flags = 0;
-int flag  = (int)getauxval(AT_HWCAP);
+int flag  = (int)ff_getauxval(AT_HWCAP);
  
  if (flag & LA_HWCAP_LSX)

  flags |= AV_CPU_FLAG_LSX;
diff --git a/libavutil/mips/cpu.c b/libavutil/mips/cpu.c
index 59619d54de..2009c70f71 100644
--- a/libavutil/mips/cpu.c
+++ b/libavutil/mips/cpu.c
@@ -34,7 +34,7 @@
  
  static int cpucfg_available(void)

  {
-return getauxval(AT_HWCAP) & HWCAP_LOONGSON_CPUCFG;
+return ff_getauxval(AT_HWCAP) & HWCAP_LOONGSON_CPUCFG;
  }
  
  /* Most toolchains have no CPUCFG support yet */

diff --git a/libavutil/riscv/cpu.c b/libavutil/riscv/cpu.c
index 52ca2ce814..4ec6d6c826 100644
--- a/libavutil/riscv/cpu.c
+++ b/libavutil/riscv/cpu.c
@@ -86,7 +86,7 @@ int ff_get_cpu_flags_riscv(void)
  }
  #elif HAVE_GETAUXVAL
  {
-const unsigned long hwcap = getauxval(AT_HWCAP);
+const unsigned long hwcap = ff_getauxval(AT_HWCAP);
  
  if (hwcap & HWCAP_RV('I'))

  ret |= AV_CPU_FLAG_RVI;

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

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


Re: [FFmpeg-devel] Can't use __musl__ macro

2024-08-30 Thread Brad Smith

On 2024-08-30 7:07 a.m., Ramiro Polla wrote:


On 2024-08-30 05:50, Brad Smith wrote:

On 2024-08-29 9:47 a.m., Ramiro Polla wrote:

On Mon, Aug 12, 2024 at 7:16 AM Lance Fredrickson
  wrote:
In commit 9e674b31606c805dd31b4bb754364a72a5877238 of ffmpeg this 
change

tries to detect musl libc by way of a "__musl__" macro. This macro
however, doesn't exist in musl. This results in an "incompatible 
pointer

type" error under gcc-14.2 as detection falls through to the #else
definition. This was in version 6.1.2 and looks like it is still 
present

in master.  I can't say what the correct fix would be, I just manually
patched for now.

musl tries to make itself undetectable. Instead of relying on system
#ifdefs which may or may not be correct, we should instead check for
the proper signature at configure time.

I sent a patch for this (look for the thread "[PATCH] configure:
improve check for POSIX ioctl").

I tested it with musl, glibc, and the android ndk. Brad, could you
test that this works as expected on BSD?


Here is the config output.. test_code cc sys/ioctl.h int ioctl(int, 
int, ...); test_cc BEGIN /tmp/ffconf.of6GnZkt/test.c 1 #include 
 2 int main(void) { int ioctl(int, int, ...);; return 0; 
} END /tmp/ffconf.of6GnZkt/test.c cc -D_ISOC11_SOURCE 
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DPIC -std=c17 
-fomit-frame-pointer -fPIC -I/usr/X11R6/include -I/usr/X11R6/include 
-I/usr/X11R6/include -pthread -I/usr/X11R6/include 
-I/usr/X11R6/include/libdrm -c -o /tmp/ffconf.of6GnZkt/test.o 
/tmp/ffc onf.of6GnZkt/test.c /tmp/ffconf.of6GnZkt/test.c:2:22: error: 
conflicting types for 'ioctl' int main(void) { int ioctl(int, int, 
...);; return 0; } ^ /usr/include/sys/ioctl.h:52:5: note: previous 
declaration is here int ioctl(int, unsigned long, ...); ^ 1 error 
generated.




Thanks! I assume the build worked as well since configure detected 
that it's not POSIX ioctl.


Ugh. Just looking at that from the archive I see that came out garbled 
for some reason.


Yes, the build completed and no warnings from v4l2.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] Can't use __musl__ macro

2024-08-29 Thread Brad Smith

On 2024-08-29 9:47 a.m., Ramiro Polla wrote:

Hi,

On Mon, Aug 12, 2024 at 7:16 AM Lance Fredrickson
 wrote:

In commit 9e674b31606c805dd31b4bb754364a72a5877238 of ffmpeg this change
tries to detect musl libc by way of a "__musl__" macro.  This macro
however, doesn't exist in musl. This results in an "incompatible pointer
type" error under gcc-14.2 as detection falls through to the #else
definition. This was in version 6.1.2 and looks like it is still present
in master.  I can't say what the correct fix would be, I just manually
patched for now.

musl tries to make itself undetectable. Instead of relying on system
#ifdefs which may or may not be correct, we should instead check for
the proper signature at configure time.

I sent a patch for this (look for the thread "[PATCH] configure:
improve check for POSIX ioctl").

I tested it with musl, glibc, and the android ndk. Brad, could you
test that this works as expected on BSD?


Here is the config output.. test_code cc sys/ioctl.h int ioctl(int, int, 
...); test_cc BEGIN /tmp/ffconf.of6GnZkt/test.c 1 #include  
2 int main(void) { int ioctl(int, int, ...);; return 0; } END 
/tmp/ffconf.of6GnZkt/test.c cc -D_ISOC11_SOURCE -D_FILE_OFFSET_BITS=64 
-D_LARGEFILE_SOURCE -DPIC -std=c17 -fomit-frame-pointer -fPIC 
-I/usr/X11R6/include -I/usr/X11R6/include -I/usr/X11R6/include -pthread 
-I/usr/X11R6/include -I/usr/X11R6/include/libdrm -c -o 
/tmp/ffconf.of6GnZkt/test.o /tmp/ffc onf.of6GnZkt/test.c 
/tmp/ffconf.of6GnZkt/test.c:2:22: error: conflicting types for 'ioctl' 
int main(void) { int ioctl(int, int, ...);; return 0; } ^ 
/usr/include/sys/ioctl.h:52:5: note: previous declaration is here int 
ioctl(int, unsigned long, ...); ^ 1 error generated.

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

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


[FFmpeg-devel] [PATCH] avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()

2024-08-24 Thread Brad Smith
avutil/cpu_internal: Provide ff_getauxval() wrapper for getauxvaul()

Initially used for getauxval() but will be used to add support for
other API.

Signed-off-by: Brad Smith 
---
 libavutil/aarch64/cpu.c   |  4 ++--
 libavutil/arm/cpu.c   |  2 +-
 libavutil/cpu.c   | 14 ++
 libavutil/cpu_internal.h  |  2 ++
 libavutil/loongarch/cpu.c |  2 +-
 libavutil/mips/cpu.c  |  2 +-
 libavutil/riscv/cpu.c |  2 +-
 7 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
index cfa9306663..084c81e999 100644
--- a/libavutil/aarch64/cpu.c
+++ b/libavutil/aarch64/cpu.c
@@ -31,8 +31,8 @@ static int detect_flags(void)
 {
 int flags = 0;
 
-unsigned long hwcap = getauxval(AT_HWCAP);
-unsigned long hwcap2 = getauxval(AT_HWCAP2);
+unsigned long hwcap = ff_getauxval(AT_HWCAP);
+unsigned long hwcap2 = ff_getauxval(AT_HWCAP2);
 
 if (hwcap & HWCAP_AARCH64_ASIMDDP)
 flags |= AV_CPU_FLAG_DOTPROD;
diff --git a/libavutil/arm/cpu.c b/libavutil/arm/cpu.c
index c84a655c37..b84882005a 100644
--- a/libavutil/arm/cpu.c
+++ b/libavutil/arm/cpu.c
@@ -55,7 +55,7 @@
 static int get_auxval(uint32_t *hwcap)
 {
 #if HAVE_GETAUXVAL
-unsigned long ret = getauxval(AT_HWCAP);
+unsigned long ret = ff_getauxval(AT_HWCAP);
 if (ret == 0)
 return -1;
 *hwcap = ret;
diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 41cee7fa77..61c1cf3faf 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -49,6 +49,10 @@
 #include 
 #endif
 
+#if HAVE_GETAUXVAL
+#include 
+#endif
+
 static atomic_int cpu_flags = -1;
 static atomic_int cpu_count = -1;
 
@@ -283,3 +287,13 @@ size_t av_cpu_max_align(void)
 
 return 8;
 }
+
+unsigned long ff_getauxval(unsigned long type)
+{
+#if HAVE_GETAUXVAL
+return getauxval(type);
+#else
+errno = ENOSYS;
+return 0;
+#endif
+}
diff --git a/libavutil/cpu_internal.h b/libavutil/cpu_internal.h
index 634f28bac4..585a115c49 100644
--- a/libavutil/cpu_internal.h
+++ b/libavutil/cpu_internal.h
@@ -59,4 +59,6 @@ size_t ff_get_cpu_max_align_ppc(void);
 size_t ff_get_cpu_max_align_x86(void);
 size_t ff_get_cpu_max_align_loongarch(void);
 
+unsigned long ff_getauxval(unsigned long type);
+
 #endif /* AVUTIL_CPU_INTERNAL_H */
diff --git a/libavutil/loongarch/cpu.c b/libavutil/loongarch/cpu.c
index cad8504fde..d8c67ad7c8 100644
--- a/libavutil/loongarch/cpu.c
+++ b/libavutil/loongarch/cpu.c
@@ -28,7 +28,7 @@
 static int cpu_flags_getauxval(void)
 {
 int flags = 0;
-int flag  = (int)getauxval(AT_HWCAP);
+int flag  = (int)ff_getauxval(AT_HWCAP);
 
 if (flag & LA_HWCAP_LSX)
 flags |= AV_CPU_FLAG_LSX;
diff --git a/libavutil/mips/cpu.c b/libavutil/mips/cpu.c
index 59619d54de..2009c70f71 100644
--- a/libavutil/mips/cpu.c
+++ b/libavutil/mips/cpu.c
@@ -34,7 +34,7 @@
 
 static int cpucfg_available(void)
 {
-return getauxval(AT_HWCAP) & HWCAP_LOONGSON_CPUCFG;
+return ff_getauxval(AT_HWCAP) & HWCAP_LOONGSON_CPUCFG;
 }
 
 /* Most toolchains have no CPUCFG support yet */
diff --git a/libavutil/riscv/cpu.c b/libavutil/riscv/cpu.c
index 52ca2ce814..4ec6d6c826 100644
--- a/libavutil/riscv/cpu.c
+++ b/libavutil/riscv/cpu.c
@@ -86,7 +86,7 @@ int ff_get_cpu_flags_riscv(void)
 }
 #elif HAVE_GETAUXVAL
 {
-const unsigned long hwcap = getauxval(AT_HWCAP);
+const unsigned long hwcap = ff_getauxval(AT_HWCAP);
 
 if (hwcap & HWCAP_RV('I'))
 ret |= AV_CPU_FLAG_RVI;
-- 
2.45.2

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

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


Re: [FFmpeg-devel] aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD

2024-07-27 Thread Brad Smith

On 2024-07-26 7:56 a.m., Rémi Denis-Courmont wrote:


Le 26 juillet 2024 13:58:34 GMT+03:00, Brad Smith 
 a écrit :

aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD

FreeBSD 12.0+, OpenBSD -current and what will be OpenBSD 7.6 support
elf_aux_info(3).

Signed-off-by: Brad Smith 
---
configure   |  2 ++
libavutil/aarch64/cpu.c | 23 ++-
2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index f6f5c29fea..e80b549582 100755
--- a/configure
+++ b/configure
@@ -2366,6 +2366,7 @@ SYSTEM_FUNCS="
 clock_gettime
 closesocket
 CommandLineToArgvW
+elf_aux_info
 fcntl
 getaddrinfo
 getauxval
@@ -6565,6 +6566,7 @@ check_func_headers mach/mach_time.h mach_absolute_time
check_func_headers stdlib.h getenv
check_func_headers sys/stat.h lstat
check_func_headers sys/auxv.h getauxval
+check_func_headers sys/auxv.h elf_aux_info
check_func_headers sys/sysctl.h sysctlbyname

check_func_headers windows.h GetModuleHandle
diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
index cfa9306663..05272b4db4 100644
--- a/libavutil/aarch64/cpu.c
+++ b/libavutil/aarch64/cpu.c
@@ -42,6 +42,27 @@ static int detect_flags(void)
 return flags;
}

+#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && HAVE_ELF_AUX_INFO
+#include 
+#include 
+
+static int detect_flags(void)
+{
+int flags = 0;
+
+unsigned long hwcap = 0;
+elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap);
+unsigned long hwcap2 = 0;
+elf_aux_info(AT_HWCAP2, &hwcap2, sizeof hwcap2);
+
+if (hwcap & HWCAP_ASIMDDP)
+flags |= AV_CPU_FLAG_DOTPROD;
+if (hwcap2 & HWCAP2_I8MM)
+flags |= AV_CPU_FLAG_I8MM;
+
+return flags;
+}
+

Can't getauxval() be implemented with elf_aux_info(), or vice versa? It seems 
that otherwise the code should be identical to that from Linux.


QEMU has qemu_getauxval() for example as a wrapper. I will be using this 
elsewhere for arm, ppc and riscv.


I could split this up, but I am not sure where to place such a function.


#elif defined(__APPLE__) && HAVE_SYSCTLBYNAME
#include 

@@ -65,7 +86,7 @@ static int detect_flags(void)
 return flags;
}

-#elif defined(__OpenBSD__)
+#elif defined(__OpenBSD__) && !HAVE_ELF_AUX_INFO
#include 
#include 
#include 

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

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

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

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


[FFmpeg-devel] aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD

2024-07-26 Thread Brad Smith
aarch64: Implement support for elf_aux_info(3) on FreeBSD and OpenBSD

FreeBSD 12.0+, OpenBSD -current and what will be OpenBSD 7.6 support
elf_aux_info(3).

Signed-off-by: Brad Smith 
---
 configure   |  2 ++
 libavutil/aarch64/cpu.c | 23 ++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index f6f5c29fea..e80b549582 100755
--- a/configure
+++ b/configure
@@ -2366,6 +2366,7 @@ SYSTEM_FUNCS="
 clock_gettime
 closesocket
 CommandLineToArgvW
+elf_aux_info
 fcntl
 getaddrinfo
 getauxval
@@ -6565,6 +6566,7 @@ check_func_headers mach/mach_time.h mach_absolute_time
 check_func_headers stdlib.h getenv
 check_func_headers sys/stat.h lstat
 check_func_headers sys/auxv.h getauxval
+check_func_headers sys/auxv.h elf_aux_info
 check_func_headers sys/sysctl.h sysctlbyname
 
 check_func_headers windows.h GetModuleHandle
diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
index cfa9306663..05272b4db4 100644
--- a/libavutil/aarch64/cpu.c
+++ b/libavutil/aarch64/cpu.c
@@ -42,6 +42,27 @@ static int detect_flags(void)
 return flags;
 }
 
+#elif (defined(__FreeBSD__) || defined(__OpenBSD__)) && HAVE_ELF_AUX_INFO
+#include 
+#include 
+
+static int detect_flags(void)
+{
+int flags = 0;
+
+unsigned long hwcap = 0;
+elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap);
+unsigned long hwcap2 = 0;
+elf_aux_info(AT_HWCAP2, &hwcap2, sizeof hwcap2);
+
+if (hwcap & HWCAP_ASIMDDP)
+flags |= AV_CPU_FLAG_DOTPROD;
+if (hwcap2 & HWCAP2_I8MM)
+flags |= AV_CPU_FLAG_I8MM;
+
+return flags;
+}
+
 #elif defined(__APPLE__) && HAVE_SYSCTLBYNAME
 #include 
 
@@ -65,7 +86,7 @@ static int detect_flags(void)
 return flags;
 }
 
-#elif defined(__OpenBSD__)
+#elif defined(__OpenBSD__) && !HAVE_ELF_AUX_INFO
 #include 
 #include 
 #include 
-- 
2.45.2

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

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


Re: [FFmpeg-devel] [PATCH] lavu/riscv: do not fallback to AT_HWCAP auxillary vector

2024-07-19 Thread Brad Smith

On 2024-07-19 11:46 a.m., Rémi Denis-Courmont wrote:

If __riscv_hwprobe() fails, then the kernel version is presumably too
old. There is not much point falling back to the auxillary vector.

- The Linux kernel requires I, so the flag is always set on Linux, and
   run-time detection is unnecessary. Our RISC-V assembler does anyway not
   support targets without I.

- Linux can compile with or without F and D, but it cannot perform
   run-time detection for them (a kernel with F support will not boot a
   processor without F). The run-time detection is thus useless in that
   case. Besides F and D extensions are used throughout the C code, so
   their run-time detection would not be practical.

- Support for V was added in a later kernel version than riscv_hwprobe(),
   so the system call will always be available if the kernel supports V.
   The only exception would be vendor kernel forks, but those are known to
   haphasardly pretend to support V on systems without actual V support, or
   with only pre-ratification binary-incompatible version. Furthermore, a
   large chunk of our optimisations require Zba and/or Zbb which cannot be
   detected with HWCAP in those kernels.

For what it is worth, OpenJDK already took a similar action. Note that this
keeps AT_HWCAP usage for platforms with neither C run-time 
nor kernel , notably kernels other than Linux.


Thanks for the last part. The bits for OpenBSD have just landed for 
supporting

elf_aux_info() so I'll look at adding support for FreeBSD and OpenBSD.


---
  libavutil/riscv/cpu.c | 5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavutil/riscv/cpu.c b/libavutil/riscv/cpu.c
index 73abd289a6..04ac404bbf 100644
--- a/libavutil/riscv/cpu.c
+++ b/libavutil/riscv/cpu.c
@@ -83,9 +83,8 @@ int ff_get_cpu_flags_riscv(void)
  break;
  default:
  }
-} else
-#endif
-#if HAVE_GETAUXVAL
+}
+#elif HAVE_GETAUXVAL
  {
  const unsigned long hwcap = getauxval(AT_HWCAP);
  

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

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


Re: [FFmpeg-devel] [PATCH] aarch64: Add OpenBSD runtime detection of dotprod and i8mm using sysctl

2024-06-25 Thread Brad Smith

On 2024-06-24 4:15 a.m., Martin Storsjö wrote:

On Sat, 22 Jun 2024, Brad Smith wrote:

[PATCH] aarch64: Add OpenBSD runtime detection of dotprod and i8mm 
using sysctl


Signed-off-by: Brad Smith 
---
libavutil/aarch64/cpu.c | 35 +++
1 file changed, 35 insertions(+)

diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
index 196bdaf6b0..40fcc8d1ff 100644
--- a/libavutil/aarch64/cpu.c
+++ b/libavutil/aarch64/cpu.c
@@ -65,6 +65,41 @@ static int detect_flags(void)
    return flags;
}

+#elif defined(__OpenBSD__)
+#include 
+#include 
+#include 
+#include 
+
+static int detect_flags(void)
+{
+    int flags = 0;
+    int mib[2];
+    uint64_t isar0;
+    uint64_t isar1;
+    size_t len;
+
+    mib[0] = CTL_MACHDEP;
+    mib[1] = CPU_ID_AA64ISAR0;
+    len = sizeof(isar0);
+    if (sysctl(mib, 2, &isar0, &len, NULL, 0) != -1) {
+    if (ID_AA64ISAR0_DP(isar0) >= ID_AA64ISAR0_DP_IMPL)
+    flags |= AV_CPU_FLAG_DOTPROD;
+    }
+
+    mib[0] = CTL_MACHDEP;
+    mib[1] = CPU_ID_AA64ISAR1;
+    len = sizeof(isar1);
+    if (sysctl(mib, 2, &isar1, &len, NULL, 0) != -1) {
+#ifdef ID_AA64ISAR1_I8MM_IMPL
+    if (ID_AA64ISAR1_I8MM(isar1) >= ID_AA64ISAR1_I8MM_IMPL)
+    flags |= AV_CPU_FLAG_I8MM;
+#endif
+    }
+
+    return flags;
+}
+
#elif defined(_WIN32)
#include 


This LGTM. Although, in 
https://code.videolan.org/videolan/dav1d/-/merge_requests/1673 you 
wrapped most of this in an #ifdef CPU_ID_AA64ISAR0, so would that be 
useful here too?



That would be a good idea. I will do the same. Thanks.


Feel free to push either with or without that.

// Martin

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

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

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

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


[FFmpeg-devel] [PATCH] aarch64: Add OpenBSD runtime detection of dotprod and i8mm using sysctl

2024-06-22 Thread Brad Smith
[PATCH] aarch64: Add OpenBSD runtime detection of dotprod and i8mm using sysctl

Signed-off-by: Brad Smith 
---
 libavutil/aarch64/cpu.c | 35 +++
 1 file changed, 35 insertions(+)

diff --git a/libavutil/aarch64/cpu.c b/libavutil/aarch64/cpu.c
index 196bdaf6b0..40fcc8d1ff 100644
--- a/libavutil/aarch64/cpu.c
+++ b/libavutil/aarch64/cpu.c
@@ -65,6 +65,41 @@ static int detect_flags(void)
 return flags;
 }
 
+#elif defined(__OpenBSD__)
+#include 
+#include 
+#include 
+#include 
+
+static int detect_flags(void)
+{
+int flags = 0;
+int mib[2];
+uint64_t isar0;
+uint64_t isar1;
+size_t len;
+
+mib[0] = CTL_MACHDEP;
+mib[1] = CPU_ID_AA64ISAR0;
+len = sizeof(isar0);
+if (sysctl(mib, 2, &isar0, &len, NULL, 0) != -1) {
+if (ID_AA64ISAR0_DP(isar0) >= ID_AA64ISAR0_DP_IMPL)
+flags |= AV_CPU_FLAG_DOTPROD;
+}
+
+mib[0] = CTL_MACHDEP;
+mib[1] = CPU_ID_AA64ISAR1;
+len = sizeof(isar1);
+if (sysctl(mib, 2, &isar1, &len, NULL, 0) != -1) {
+#ifdef ID_AA64ISAR1_I8MM_IMPL
+if (ID_AA64ISAR1_I8MM(isar1) >= ID_AA64ISAR1_I8MM_IMPL)
+flags |= AV_CPU_FLAG_I8MM;
+#endif
+}
+
+return flags;
+}
+
 #elif defined(_WIN32)
 #include 
 
-- 
2.45.2

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

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


Re: [FFmpeg-devel] [PATCH] configure: enable ffnvcodec, nvenc, nvdec for FreeBSD

2024-05-25 Thread Brad Smith

On 2024-05-19 7:24 a.m., Timo Rothenpieler wrote:

On 19.05.2024 02:00, Brad Smith wrote:

configure: enable ffnvcodec, nvenc, nvdec for FreeBSD

Signed-off-by: Brad Smith 
---
  configure | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index b16722d83d..96b181fd21 100755
--- a/configure
+++ b/configure
@@ -7350,7 +7350,7 @@ fi
    if enabled x86; then
  case $target_os in
-    mingw32*|mingw64*|win32|win64|linux|cygwin*)
+    freebsd|mingw32*|mingw64*|win32|win64|linux|cygwin*)


Does this actually work?
Everything I find online indicates that the FreeBSD driver is lacking 
support for CUDA, nvenc and most of anything compute related.



According to the commits and bug report requesting support it does 
appear to work.


The CUDA bits are not native. They're using Linux emulation for that. 
The display driver is

native.

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

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


[FFmpeg-devel] [PATCH] configure: enable ffnvcodec, nvenc, nvdec for FreeBSD

2024-05-18 Thread Brad Smith
configure: enable ffnvcodec, nvenc, nvdec for FreeBSD

Signed-off-by: Brad Smith 
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index b16722d83d..96b181fd21 100755
--- a/configure
+++ b/configure
@@ -7350,7 +7350,7 @@ fi
 
 if enabled x86; then
 case $target_os in
-mingw32*|mingw64*|win32|win64|linux|cygwin*)
+freebsd|mingw32*|mingw64*|win32|win64|linux|cygwin*)
 ;;
 *)
 disable ffnvcodec cuvid nvdec nvenc
-- 
2.45.1

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

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


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

2024-05-18 Thread Brad Smith

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.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


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

2024-05-18 Thread Brad Smith

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 
---
  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);

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

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


[FFmpeg-devel] [PATCH] MAINTAINERS: add myself as *BSD maintainer

2024-05-11 Thread Brad Smith
MAINTAINERS: add myself as *BSD maintainer

I try to help out with *BSD patches or build related issues where I can.

Signed-off-by: Brad Smith 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index dd633f37e8..41a98744ad 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -488,6 +488,7 @@ Resamplers:
 Operating systems / CPU architectures
 =
 
+*BSDBrad Smith
 Alpha   Falk Hueffner
 MIPSManojkumar Bhosale, Shiyou Yin
 LoongArch   Shiyou Yin
-- 
2.44.0

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

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


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

2024-05-11 Thread Brad Smith

On 2024-05-11 8:13 p.m., Michael Niedermayer wrote:

Hi

On Sat, May 11, 2024 at 06:24:32PM -0400, Brad Smith wrote:

On 2024-05-11 5:49 p.m., Michael Niedermayer wrote:

On Sat, May 11, 2024 at 03:55:44PM -0400, Brad Smith wrote:

On 2024-05-06 10:24 p.m., Michael Niedermayer wrote:

On Sun, May 05, 2024 at 11:21:58PM -0400, Brad Smith wrote:

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
---
libavutil/ppc/cpu.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

you seem to be sending alot of bsd related patches, maybe
you want to send a patch that adds you to the MAINTAINERs file?

thx

I try to help where I can. I am an OpenBSD developer and take a look at
what the other *BSD's have for local patches and push things upstream to
benefit both sides, but I am not sure I have enough time to be in a position
to be considered any kind of official MAINTAINER.

Iam not asking you to do more work
Id like to give you a git write account so you can push your BSD related
fixes yourself.
(everyone who has git write should be in MAINTAINERs)

thx

Oh, my misunderstanding. I would be fine with that.

Than please post a patch that adds you to MAINTAINERs
the idea behind this is so that teh whole community can always
object anyone receiving git wriet access
I can post a patch adding you too, but i dont know what exactly
you want listed in it. For git write it just matters that you are
in the file anywhere

thx


Thanks. Will do.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


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

2024-05-11 Thread Brad Smith

On 2024-05-11 5:49 p.m., Michael Niedermayer wrote:

On Sat, May 11, 2024 at 03:55:44PM -0400, Brad Smith wrote:

On 2024-05-06 10:24 p.m., Michael Niedermayer wrote:

On Sun, May 05, 2024 at 11:21:58PM -0400, Brad Smith wrote:

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
---
   libavutil/ppc/cpu.c | 6 +++---
   1 file changed, 3 insertions(+), 3 deletions(-)

you seem to be sending alot of bsd related patches, maybe
you want to send a patch that adds you to the MAINTAINERs file?

thx

I try to help where I can. I am an OpenBSD developer and take a look at
what the other *BSD's have for local patches and push things upstream to
benefit both sides, but I am not sure I have enough time to be in a position
to be considered any kind of official MAINTAINER.

Iam not asking you to do more work
Id like to give you a git write account so you can push your BSD related
fixes yourself.
(everyone who has git write should be in MAINTAINERs)

thx


Oh, my misunderstanding. I would be fine with that.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


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

2024-05-11 Thread Brad Smith

On 2024-05-06 10:24 p.m., Michael Niedermayer wrote:

On Sun, May 05, 2024 at 11:21:58PM -0400, Brad Smith wrote:

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
---
  libavutil/ppc/cpu.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

you seem to be sending alot of bsd related patches, maybe
you want to send a patch that adds you to the MAINTAINERs file?

thx


I try to help where I can. I am an OpenBSD developer and take a look at
what the other *BSD's have for local patches and push things upstream to
benefit both sides, but I am not sure I have enough time to be in a position
to be considered any kind of official MAINTAINER.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


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

2024-05-05 Thread 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 
---
 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);
-- 
2.44.0

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

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


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

2024-05-05 Thread 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 
---
 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};
-- 
2.44.0
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH v2] avformat: enable UDP IPv6 multicast interface selection using zone index

2024-04-28 Thread Brad Smith

On 2024-04-28 2:15 p.m., Rémi Denis-Courmont wrote:

Le torstaina 11. huhtikuuta 2024, 10.50.01 EEST Lynne a écrit :

Is there a reason why we can't switch to IPv4 addresses mapped
in IPv6 and just use the IPv6 API everywhere?

IPv6-mapped IPv4 addresses are pretty much deprecated, if supported anymore.
Some people consider them insecure. But even if you don't agree with that
assessment, the fact of the matter is that they are not portable.


OpenBSD does not support IPv4-mapped IPv6 addresses and has a split stack.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH v2] lavu/thread: add support for setting thread name on *bsd and solaris

2024-01-30 Thread Brad Smith

On 2024-01-23 2:44 p.m., Brad Smith wrote:

On 2024-01-16 1:25 a.m., Brad Smith wrote:

On 2024-01-07 12:55 a.m., Brad Smith wrote:

lavu/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
---
  configure  | 10 ++
  libavutil/thread.h | 14 --
  2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 0b5e83bd20..67660b6292 100755
--- a/configure
+++ b/configure
@@ -2239,6 +2239,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
@@ -2341,6 +2342,8 @@ SYSTEM_FUNCS="
  posix_memalign
  prctl
  pthread_cancel
+    pthread_set_name_np
+    pthread_setname_np
  sched_getaffinity
  SecItemImport
  SetConsoleTextAttribute
@@ -6523,6 +6526,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
@@ -6691,6 +6695,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 */



ping.


ping.



ping.

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

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


Re: [FFmpeg-devel] [PATCH v2] lavu/thread: add support for setting thread name on *bsd and solaris

2024-01-23 Thread Brad Smith

On 2024-01-16 1:25 a.m., Brad Smith wrote:

On 2024-01-07 12:55 a.m., Brad Smith wrote:

lavu/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
---
  configure  | 10 ++
  libavutil/thread.h | 14 --
  2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 0b5e83bd20..67660b6292 100755
--- a/configure
+++ b/configure
@@ -2239,6 +2239,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
@@ -2341,6 +2342,8 @@ SYSTEM_FUNCS="
  posix_memalign
  prctl
  pthread_cancel
+    pthread_set_name_np
+    pthread_setname_np
  sched_getaffinity
  SecItemImport
  SetConsoleTextAttribute
@@ -6523,6 +6526,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
@@ -6691,6 +6695,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 */



ping.


ping.


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

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


Re: [FFmpeg-devel] [PATCH v2] lavu/thread: add support for setting thread name on *bsd and solaris

2024-01-15 Thread Brad Smith

On 2024-01-07 12:55 a.m., Brad Smith wrote:

lavu/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
---
  configure  | 10 ++
  libavutil/thread.h | 14 --
  2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 0b5e83bd20..67660b6292 100755
--- a/configure
+++ b/configure
@@ -2239,6 +2239,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
@@ -2341,6 +2342,8 @@ SYSTEM_FUNCS="
  posix_memalign
  prctl
  pthread_cancel
+pthread_set_name_np
+pthread_setname_np
  sched_getaffinity
  SecItemImport
  SetConsoleTextAttribute
@@ -6523,6 +6526,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
@@ -6691,6 +6695,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 */



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

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


Re: [FFmpeg-devel] [PATCH] configure: remove Bitrig OS

2024-01-11 Thread Brad Smith

On 2023-12-31 2:23 a.m., Brad Smith wrote:

configure: remove Bitrig OS

Bitrig has been defunct for 7 years.

Signed-off-by: Brad Smith 
---
  configure | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 42786719e9..d96b47ebe5 100755
--- a/configure
+++ b/configure
@@ -5625,7 +5625,7 @@ case $target_os in
  oss_outdev_extralibs="-lossaudio"
  enabled gcc || check_ldflags -Wl,-zmuldefs
  ;;
-openbsd|bitrig)
+openbsd)
  disable symver
  enable section_data_rel_ro
  striptype=""


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

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


Re: [FFmpeg-devel] [PATCH] lavu/thread: add support for setting thread name on *bsd and solaris

2024-01-08 Thread Brad Smith

On 2024-01-06 12:27 p.m., Michael Niedermayer wrote:

On Wed, Jan 03, 2024 at 11:19:56PM -0500, Brad Smith wrote:

lavu/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 
---
  configure  | 10 ++
  libavutil/thread.h | 14 --
  2 files changed, 22 insertions(+), 2 deletions(-)

this breaks build on linux

  ./configure --enable-pthreads
ERROR: pthreads requested but not found

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-u...@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will 
help
solve the problem.


Sent a v2 diff.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH v2] lavu/thread: add support for setting thread name on *bsd and solaris

2024-01-06 Thread Brad Smith
lavu/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 
---
 configure  | 10 ++
 libavutil/thread.h | 14 --
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 0b5e83bd20..67660b6292 100755
--- a/configure
+++ b/configure
@@ -2239,6 +2239,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
@@ -2341,6 +2342,8 @@ SYSTEM_FUNCS="
 posix_memalign
 prctl
 pthread_cancel
+pthread_set_name_np
+pthread_setname_np
 sched_getaffinity
 SecItemImport
 SetConsoleTextAttribute
@@ -6523,6 +6526,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
@@ -6691,6 +6695,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 */
-- 
2.43.0

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

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


Re: [FFmpeg-devel] Back port riscv: test for assembler support to 6.1

2024-01-06 Thread Brad Smith
On Sun, Dec 31, 2023 at 10:21:51PM +0100, Michael Niedermayer wrote:
> On Sun, Dec 31, 2023 at 03:57:02AM -0500, Brad Smith wrote:
> > Could this be back ported to 6.1?
> > 
> > https://git.videolan.org/?p=ffmpeg.git;a=commit;h=b3825bbe452c8e4f129fa90bba1fed0ee7b87d71
> 
> It doesnt apply cleanly
> if someone who can test this wants to backport then it would make sense
> 
> thx
> 
> [...]
> -- 
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Never trust a computer, one day, it may think you are the virus. -- Compn

I don't have a system. But I have attached what should be there or close
to back ports for 6.1 and 6.0. If someone could please build test these
patches.
diff --git a/Makefile b/Makefile
index 1fb742f390..ea3ed49ab3 100644
--- a/Makefile
+++ b/Makefile
@@ -91,10 +91,10 @@ ffbuild/.config: $(CONFIGURABLE_COMPONENTS)
 SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS   \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS\
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
-   ALTIVEC-OBJS VSX-OBJS RVV-OBJS MMX-OBJS X86ASM-OBJS   \
+   ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS\
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \
-   MMI-OBJS LSX-OBJS LASX-OBJS OBJS SLIBOBJS SHLIBOBJS   \
-   STLIBOBJS HOSTOBJS TESTOBJS
+   MMI-OBJS LSX-OBJS LASX-OBJS RV-OBJS RVV-OBJS  \
+   OBJS SLIBOBJS SHLIBOBJS STLIBOBJS HOSTOBJS TESTOBJS
 
 define RESET
 $(1) :=
diff --git a/configure b/configure
index 3cd3bdfb44..74481700a1 100755
--- a/configure
+++ b/configure
@@ -2114,6 +2114,7 @@ ARCH_EXT_LIST_PPC="
 "
 
 ARCH_EXT_LIST_RISCV="
+rv
 rvv
 "
 
@@ -2630,7 +2631,8 @@ ppc4xx_deps="ppc"
 vsx_deps="altivec"
 power8_deps="vsx"
 
-rvv_deps="riscv"
+rv_deps="riscv"
+rvv_deps="rv"
 
 loongson2_deps="mips"
 loongson3_deps="mips"
@@ -6115,6 +6117,7 @@ elif enabled ppc; then
 
 elif enabled riscv; then
 
+enabled rv && check_inline_asm rv '".option arch, +zbb\nrev8 t0, t1"'
 enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, 
e8, m1, ta, ma"'
 
 elif enabled x86; then
diff --git a/ffbuild/arch.mak b/ffbuild/arch.mak
index 39d76ee152..23a3feb090 100644
--- a/ffbuild/arch.mak
+++ b/ffbuild/arch.mak
@@ -15,6 +15,7 @@ OBJS-$(HAVE_LASX)  += $(LASX-OBJS)   $(LASX-OBJS-yes)
 OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
 OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes)
 
+OBJS-$(HAVE_RV)  += $(RV-OBJS)  $(RV-OBJS-yes)
 OBJS-$(HAVE_RVV) += $(RVV-OBJS) $(RVV-OBJS-yes)
 
 OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes)
diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile
index 965942f4df..07d7f044b4 100644
--- a/libavcodec/riscv/Makefile
+++ b/libavcodec/riscv/Makefile
@@ -2,11 +2,11 @@ OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_init.o
 RVV-OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_rvv.o
 OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_init.o
 RVV-OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_rvv.o
-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o \
-   riscv/audiodsp_rvf.o
+OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o
+RV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvf.o
 RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o
-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o \
-   riscv/bswapdsp_rvb.o
+OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o
+RV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvb.o
 RVV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvv.o
 OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_init.o
 RVV-OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_rvv.o
@@ -14,8 +14,8 @@ OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_init.o
 RVV-OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_rvv.o
 OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_init.o
 RVV-OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_rvv.o
-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_init.o \
-  riscv/pixblockdsp_rvi.o
+OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_init.o
+RV-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_rvi.o
 RVV-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_rvv.o
 OBJS-$(CONFIG_VORBIS_DECODER) += riscv/vorbisdsp_init.o
 RVV-OBJS-$(CONFIG_VORBIS_DECODER) += riscv/vorbisdsp_rvv.o
diff --git a/libavcodec/riscv/audiodsp_init.c b/libavcodec/riscv/audiodsp_init.c
index 32c3c6794d..56ebc12e3c 100644
--- a/libavcodec/riscv/audiodsp_init.c
+++ b/libavcodec/riscv/audiodsp_init.c
@@ -33,6 +33,7 @@ void ff_vector_clipf_rvv(float *dst, const float *src, int 
len, float min, float
 
 av_cold void ff_audiodsp_init_riscv(AudioDSPContext *c)
 {
+#if HA

[FFmpeg-devel] [PATCH] lavu/thread: add support for setting thread name on *bsd and solaris

2024-01-03 Thread Brad Smith
lavu/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 
---
 configure  | 10 ++
 libavutil/thread.h | 14 --
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index d15cfa4703..154db61c16 100755
--- a/configure
+++ b/configure
@@ -2239,6 +2239,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
@@ -2341,6 +2342,8 @@ SYSTEM_FUNCS="
 posix_memalign
 prctl
 pthread_cancel
+pthread_set_name_np
+pthread_setname_np
 sched_getaffinity
 SecItemImport
 SetConsoleTextAttribute
@@ -6521,6 +6524,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
@@ -6689,6 +6693,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 pthreads "$hdrs" pthread_set_name_np -lpthread
+check_lib pthreads "$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 */
-- 
2.43.0

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

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


[FFmpeg-devel] Back port riscv: test for assembler support to 6.1

2023-12-31 Thread Brad Smith

Could this be back ported to 6.1?

https://git.videolan.org/?p=ffmpeg.git;a=commit;h=b3825bbe452c8e4f129fa90bba1fed0ee7b87d71

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

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


[FFmpeg-devel] [PATCH] configure: remove Bitrig OS

2023-12-30 Thread Brad Smith
configure: remove Bitrig OS

Bitrig has been defunct for 7 years.

Signed-off-by: Brad Smith 
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 42786719e9..d96b47ebe5 100755
--- a/configure
+++ b/configure
@@ -5625,7 +5625,7 @@ case $target_os in
 oss_outdev_extralibs="-lossaudio"
 enabled gcc || check_ldflags -Wl,-zmuldefs
 ;;
-openbsd|bitrig)
+openbsd)
 disable symver
 enable section_data_rel_ro
 striptype=""
-- 
2.43.0

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

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


Re: [FFmpeg-devel] [PATCH v2] configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

2023-12-26 Thread Brad Smith
On December 26, 2023 7:35:09 a.m. Michael Niedermayer 
 wrote:



On Mon, Dec 25, 2023 at 09:04:54PM -0500, Brad Smith wrote:

On 2023-12-24 9:08 p.m., Michael Niedermayer wrote:

On Sun, Dec 24, 2023 at 02:33:31PM -0500, Brad Smith wrote:

configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

Fixes the build. It's a requirement when utilizing PIE.

Signed-off-by: Brad Smith 
---
configure | 2 ++
1 file changed, 2 insertions(+)

will apply

thx


Thanks. Can you please back port this to 6.1, 6.0, 5.1, 5.0 and 4.4?


it will be in the next releases from these branches

thx


Thanks.


Sent with Aqua Mail for Android
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH v2] configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

2023-12-25 Thread Brad Smith

On 2023-12-24 9:08 p.m., Michael Niedermayer wrote:

On Sun, Dec 24, 2023 at 02:33:31PM -0500, Brad Smith wrote:

configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

Fixes the build. It's a requirement when utilizing PIE.

Signed-off-by: Brad Smith 
---
  configure | 2 ++
  1 file changed, 2 insertions(+)

will apply

thx


Thanks. Can you please back port this to 6.1, 6.0, 5.1, 5.0 and 4.4?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

2023-12-24 Thread Brad Smith

On 2023-12-24 1:58 p.m., Michael Niedermayer wrote:

Hi

On Sun, Dec 17, 2023 at 09:22:39PM -0500, Brad Smith wrote:

configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

The commit message should be a bit more verbose.
Explaining "why" even if thats obvious to you

thx


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

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


[FFmpeg-devel] [PATCH v2] configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

2023-12-24 Thread Brad Smith
configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

Fixes the build. It's a requirement when utilizing PIE.

Signed-off-by: Brad Smith 
---
 configure | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index 078aa9437a..226874600a 100755
--- a/configure
+++ b/configure
@@ -5601,6 +5601,7 @@ case $target_os in
 ;;
 netbsd)
 disable symver
+enable section_data_rel_ro
 oss_indev_extralibs="-lossaudio"
 oss_outdev_extralibs="-lossaudio"
 enabled gcc || check_ldflags -Wl,-zmuldefs
@@ -5619,6 +5620,7 @@ case $target_os in
 disable symver
 ;;
 freebsd)
+enable section_data_rel_ro
 ;;
 bsd/os)
 add_extralibs -lpoll -lgnugetopt
-- 
2.43.0

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

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


Re: [FFmpeg-devel] [PATCH] configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

2023-12-24 Thread Brad Smith

ping.

On 2023-12-17 9:22 p.m., Brad Smith wrote:

configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

Signed-off-by: Brad Smith 
---
  configure | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index 078aa9437a..226874600a 100755
--- a/configure
+++ b/configure
@@ -5601,6 +5601,7 @@ case $target_os in
  ;;
  netbsd)
  disable symver
+enable section_data_rel_ro
  oss_indev_extralibs="-lossaudio"
  oss_outdev_extralibs="-lossaudio"
  enabled gcc || check_ldflags -Wl,-zmuldefs
@@ -5619,6 +5620,7 @@ case $target_os in
  disable symver
  ;;
  freebsd)
+enable section_data_rel_ro
  ;;
  bsd/os)
  add_extralibs -lpoll -lgnugetopt

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

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


Re: [FFmpeg-devel] Backporting Clang 14 fix to the 4.4 branch

2023-12-21 Thread Brad Smith

On 2023-12-21 7:34 p.m., Michael Niedermayer wrote:

On Thu, Dec 21, 2023 at 01:41:20AM -0500, Brad Smith wrote:

https://github.com/FFmpeg/FFmpeg/commit/ab792634197e364ca1bb194f9abe36836e42f12d

But the function is in libavformat/utils.c for 4.4 instead of
libavformat/seek.c.

Could the Clang 14 fix please be backported to the 4.4 branch?

done in 6ddd5111f4bfb5f0178bae4608b066d1e01d724c

thx


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

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


[FFmpeg-devel] Backporting Clang 14 fix to the 4.4 branch

2023-12-20 Thread Brad Smith



https://github.com/FFmpeg/FFmpeg/commit/ab792634197e364ca1bb194f9abe36836e42f12d

But the function is in libavformat/utils.c for 4.4 instead of 
libavformat/seek.c.


Could the Clang 14 fix please be backported to the 4.4 branch?

OpenBSD ran into this issue recently when upgrading from Clang 13 to 16.

https://marc.info/?l=openbsd-ports&m=170284868209618&w=2
https://marc.info/?l=openbsd-ports-cvs&m=170291311612369&w=2

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

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


[FFmpeg-devel] [PATCH] configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

2023-12-17 Thread Brad Smith
configure: Enable section_data_rel_ro for FreeBSD and NetBSD aarch64 / arm

Signed-off-by: Brad Smith 
---
 configure | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index 078aa9437a..226874600a 100755
--- a/configure
+++ b/configure
@@ -5601,6 +5601,7 @@ case $target_os in
 ;;
 netbsd)
 disable symver
+enable section_data_rel_ro
 oss_indev_extralibs="-lossaudio"
 oss_outdev_extralibs="-lossaudio"
 enabled gcc || check_ldflags -Wl,-zmuldefs
@@ -5619,6 +5620,7 @@ case $target_os in
 disable symver
 ;;
 freebsd)
+enable section_data_rel_ro
 ;;
 bsd/os)
 add_extralibs -lpoll -lgnugetopt
-- 
2.43.0

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

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


[FFmpeg-devel] [PATCH v2] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

2023-08-18 Thread Brad Smith
lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

Add a check for the existence of the vec_xl() function. Clang provides
the function even with VSX not enabled.

v2: test for function if AltiVec is enabled instead of with AltiVec and without 
VSX
---
 configure| 8 
 libswscale/ppc/yuv2rgb_altivec.c | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index ff6a5c3600..637034e87d 100755
--- a/configure
+++ b/configure
@@ -2154,6 +2154,7 @@ ARCH_EXT_LIST_PPC="
 ldbrx
 power8
 ppc4xx
+vec_xl
 vsx
 "
 
@@ -2679,6 +2680,7 @@ altivec_deps="ppc"
 dcbzl_deps="ppc"
 ldbrx_deps="ppc"
 ppc4xx_deps="ppc"
+vec_xl_deps="altivec"
 vsx_deps="altivec"
 power8_deps="vsx"
 
@@ -6221,6 +6223,11 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
+if enabled altivec; then
+check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
+vector unsigned char y0 = vec_xl(0, y1i);"
+fi
+
 elif enabled riscv; then
 
 enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, 
e8, m1, ta, ma"'
@@ -7731,6 +7738,7 @@ if enabled ppc; then
 echo "POWER8 enabled${power8-no}"
 echo "PPC 4xx optimizations ${ppc4xx-no}"
 echo "dcbzl available   ${dcbzl-no}"
+echo "vec_xl available  ${vec_xl-no}"
 fi
 if enabled loongarch; then
 echo "LSX enabled   ${lsx-no}"
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..8b0a93796f 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed 
short Y,
  * 
--
  */
 
-#if !HAVE_VSX
+#if !HAVE_VEC_XL
 static inline vector unsigned char vec_xl(signed long long offset, const ubyte 
*addr)
 {
 const vector unsigned char *v_addr = (const vector unsigned char *) (addr 
+ offset);
@@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long 
offset, const ubyte *
 
 return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
 }
-#endif /* !HAVE_VSX */
+#endif /* !HAVE_VEC_XL */
 
 #define DEFCSP420_CVT(name, out_pixels)   \
 static int altivec_ ## name(SwsContext *c, const unsigned char **in,  \
-- 
2.41.0

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

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


[FFmpeg-devel] [PATCH] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

2023-08-18 Thread Brad Smith
lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

Add a check for the existence of the vec_xl() function. Clang provides
the function even with VSX not enabled.
---
 configure| 8 
 libswscale/ppc/yuv2rgb_altivec.c | 4 ++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 932998b8d6..268435fbdb 100755
--- a/configure
+++ b/configure
@@ -2154,6 +2154,7 @@ ARCH_EXT_LIST_PPC="
 ldbrx
 power8
 ppc4xx
+vec_xl
 vsx
 "
 
@@ -2679,6 +2680,7 @@ altivec_deps="ppc"
 dcbzl_deps="ppc"
 ldbrx_deps="ppc"
 ppc4xx_deps="ppc"
+vec_xl_deps="altivec"
 vsx_deps="altivec"
 power8_deps="vsx"
 
@@ -6218,6 +6220,11 @@ elif enabled ppc; then
 check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
 fi
 
+if enabled altivec && disabled vsx; then
+check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
+vector unsigned char y0 = vec_xl(0, y1i);"
+fi
+
 elif enabled riscv; then
 
 enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, 
e8, m1, ta, ma"'
@@ -7728,6 +7735,7 @@ if enabled ppc; then
 echo "POWER8 enabled${power8-no}"
 echo "PPC 4xx optimizations ${ppc4xx-no}"
 echo "dcbzl available   ${dcbzl-no}"
+echo "vec_xl available  ${vec_xl-no}"
 fi
 if enabled loongarch; then
 echo "LSX enabled   ${lsx-no}"
diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..8b0a93796f 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed 
short Y,
  * 
--
  */
 
-#if !HAVE_VSX
+#if !HAVE_VEC_XL
 static inline vector unsigned char vec_xl(signed long long offset, const ubyte 
*addr)
 {
 const vector unsigned char *v_addr = (const vector unsigned char *) (addr 
+ offset);
@@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long 
offset, const ubyte *
 
 return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
 }
-#endif /* !HAVE_VSX */
+#endif /* !HAVE_VEC_XL */
 
 #define DEFCSP420_CVT(name, out_pixels)   \
 static int altivec_ ## name(SwsContext *c, const unsigned char **in,  \
-- 
2.41.0

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

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


Re: [FFmpeg-devel] [PATCH] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

2023-08-11 Thread Brad Smith
Just FYI, we have had this in the OpenBSD and FreeBSD packages for quite 
awhile

to be able to build on powerpc64.

On 2023-08-07 9:02 p.m., Brad Smith wrote:

lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

libswscale/ppc/yuv2rgb_altivec.c:288:36: error: redeclaration of 'vec_xl' must 
have the 'overloadable' attribute
---
  libswscale/ppc/yuv2rgb_altivec.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..6ef2441d8a 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed 
short Y,
   * 
--
   */
  
-#if !HAVE_VSX

+#if !HAVE_VSX && !defined(__clang__)
  static inline vector unsigned char vec_xl(signed long long offset, const 
ubyte *addr)
  {
  const vector unsigned char *v_addr = (const vector unsigned char *) (addr 
+ offset);
@@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long 
offset, const ubyte *
  
  return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);

  }
-#endif /* !HAVE_VSX */
+#endif /* !HAVE_VSX && !__clang__ */
  
  #define DEFCSP420_CVT(name, out_pixels)   \

  static int altivec_ ## name(SwsContext *c, const unsigned char **in,  
\

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

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


[FFmpeg-devel] [PATCH] lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

2023-08-07 Thread Brad Smith
lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang

libswscale/ppc/yuv2rgb_altivec.c:288:36: error: redeclaration of 'vec_xl' must 
have the 'overloadable' attribute
---
 libswscale/ppc/yuv2rgb_altivec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c
index 5e1033a973..6ef2441d8a 100644
--- a/libswscale/ppc/yuv2rgb_altivec.c
+++ b/libswscale/ppc/yuv2rgb_altivec.c
@@ -284,7 +284,7 @@ static inline void cvtyuvtoRGB(SwsContext *c, vector signed 
short Y,
  * 
--
  */
 
-#if !HAVE_VSX
+#if !HAVE_VSX && !defined(__clang__)
 static inline vector unsigned char vec_xl(signed long long offset, const ubyte 
*addr)
 {
 const vector unsigned char *v_addr = (const vector unsigned char *) (addr 
+ offset);
@@ -292,7 +292,7 @@ static inline vector unsigned char vec_xl(signed long long 
offset, const ubyte *
 
 return (vector unsigned char) vec_perm(v_addr[0], v_addr[1], align_perm);
 }
-#endif /* !HAVE_VSX */
+#endif /* !HAVE_VSX && !__clang__ */
 
 #define DEFCSP420_CVT(name, out_pixels)   \
 static int altivec_ ## name(SwsContext *c, const unsigned char **in,  \
-- 
2.41.0

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

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


Re: [FFmpeg-devel] [PATCH] configure: use just the pkg-config for sndio

2023-08-07 Thread Brad Smith

On 2023-08-07 3:30 p.m., Michael Niedermayer wrote:

On Mon, Aug 07, 2023 at 03:04:35PM -0400, Brad Smith wrote:

On 2023-07-20 3:17 p.m., Brad Smith wrote:

On 7/7/2023 3:16 PM, Brad Smith wrote:

On 2023-07-01 2:58 p.m., Brad Smith wrote:

On 2023-06-23 7:36 p.m., Brad Smith wrote:

On 2023-06-23 7:35 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:56:30PM -0400, Brad Smith wrote:

On 2023-06-23 6:55 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:41:08PM -0400, Brad Smith wrote:

ping.

On 2023-06-17 6:48 p.m., Brad Smith wrote:

On Sun, Jun 18, 2023 at 12:01:14AM
+0200, Michael Niedermayer wrote:

this breaks a plain configure
here on ubuntu

./configure
ERROR: sndio not found using pkg-config

If you think configure made a
mistake, make sure you are using the
latest
version from Git.  If the latest
version fails, report the problem to
the
ffmpeg-u...@ffmpeg.org mailing list
or IRC #ffmpeg on irc.libera.chat.
Include the log file
"ffbuild/config.log" produced by
configure as this will help
solve the problem.



[...]
--
Michael GnuPG fingerprint:
9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better
than the prosperity of the fool.
-- Epicurus

This is what I had intended.

You intended to break a plain ./configure on ubuntu ?
If so i think we better dont apply that patch :)

thx

No, there was a second patch there.

oops i missed that, the 2nd patch works fine on ubuntu
no objections from me

thx


ping.


ping.


ping.


Is there something wrong with the patch?

no, i was just a bit hesitant because i didnt know if anyone or anything
would depend on that removed case

ill apply it

thx


Ah, Ok. I was wondering what the issue was since there was no further 
communication.


Thank you.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] configure: use just the pkg-config for sndio

2023-08-07 Thread Brad Smith

On 2023-07-20 3:17 p.m., Brad Smith wrote:

On 7/7/2023 3:16 PM, Brad Smith wrote:

On 2023-07-01 2:58 p.m., Brad Smith wrote:

On 2023-06-23 7:36 p.m., Brad Smith wrote:

On 2023-06-23 7:35 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:56:30PM -0400, Brad Smith wrote:

On 2023-06-23 6:55 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:41:08PM -0400, Brad Smith wrote:

ping.

On 2023-06-17 6:48 p.m., Brad Smith wrote:
On Sun, Jun 18, 2023 at 12:01:14AM +0200, Michael Niedermayer 
wrote:

this breaks a plain configure
here on ubuntu

./configure
ERROR: sndio not found using pkg-config

If you think configure made a mistake, make sure you are 
using the latest
version from Git.  If the latest version fails, report the 
problem to the
ffmpeg-u...@ffmpeg.org mailing list or IRC #ffmpeg on 
irc.libera.chat.
Include the log file "ffbuild/config.log" produced by 
configure as this will help

solve the problem.



[...]
--
Michael GnuPG fingerprint: 
9FF2128B147EF6730BADF133611EC787040B0FAB


The misfortune of the wise is better than the prosperity of 
the fool.

-- Epicurus

This is what I had intended.

You intended to break a plain ./configure on ubuntu ?
If so i think we better dont apply that patch :)

thx

No, there was a second patch there.

oops i missed that, the 2nd patch works fine on ubuntu
no objections from me

thx



ping.



ping.



ping.



Is there something wrong with the patch?

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

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


Re: [FFmpeg-devel] [PATCH] configure: use just the pkg-config for sndio

2023-07-20 Thread Brad Smith

On 7/7/2023 3:16 PM, Brad Smith wrote:

On 2023-07-01 2:58 p.m., Brad Smith wrote:

On 2023-06-23 7:36 p.m., Brad Smith wrote:

On 2023-06-23 7:35 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:56:30PM -0400, Brad Smith wrote:

On 2023-06-23 6:55 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:41:08PM -0400, Brad Smith wrote:

ping.

On 2023-06-17 6:48 p.m., Brad Smith wrote:
On Sun, Jun 18, 2023 at 12:01:14AM +0200, Michael Niedermayer 
wrote:

this breaks a plain configure
here on ubuntu

./configure
ERROR: sndio not found using pkg-config

If you think configure made a mistake, make sure you are using 
the latest
version from Git.  If the latest version fails, report the 
problem to the
ffmpeg-u...@ffmpeg.org mailing list or IRC #ffmpeg on 
irc.libera.chat.
Include the log file "ffbuild/config.log" produced by 
configure as this will help

solve the problem.



[...]
--
Michael GnuPG fingerprint: 
9FF2128B147EF6730BADF133611EC787040B0FAB


The misfortune of the wise is better than the prosperity of 
the fool.

-- Epicurus

This is what I had intended.

You intended to break a plain ./configure on ubuntu ?
If so i think we better dont apply that patch :)

thx

No, there was a second patch there.

oops i missed that, the 2nd patch works fine on ubuntu
no objections from me

thx



ping.



ping.



ping.

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

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


Re: [FFmpeg-devel] [PATCH] configure: use just the pkg-config for sndio

2023-07-07 Thread Brad Smith

On 2023-07-01 2:58 p.m., Brad Smith wrote:

On 2023-06-23 7:36 p.m., Brad Smith wrote:

On 2023-06-23 7:35 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:56:30PM -0400, Brad Smith wrote:

On 2023-06-23 6:55 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:41:08PM -0400, Brad Smith wrote:

ping.

On 2023-06-17 6:48 p.m., Brad Smith wrote:
On Sun, Jun 18, 2023 at 12:01:14AM +0200, Michael Niedermayer 
wrote:

this breaks a plain configure
here on ubuntu

./configure
ERROR: sndio not found using pkg-config

If you think configure made a mistake, make sure you are using 
the latest
version from Git.  If the latest version fails, report the 
problem to the
ffmpeg-u...@ffmpeg.org mailing list or IRC #ffmpeg on 
irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure 
as this will help

solve the problem.



[...]
--
Michael GnuPG fingerprint: 
9FF2128B147EF6730BADF133611EC787040B0FAB


The misfortune of the wise is better than the prosperity of the 
fool.

-- Epicurus

This is what I had intended.

You intended to break a plain ./configure on ubuntu ?
If so i think we better dont apply that patch :)

thx

No, there was a second patch there.

oops i missed that, the 2nd patch works fine on ubuntu
no objections from me

thx



ping.



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

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


Re: [FFmpeg-devel] [PATCH] configure: use just the pkg-config for sndio

2023-07-01 Thread Brad Smith

On 2023-06-23 7:36 p.m., Brad Smith wrote:

On 2023-06-23 7:35 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:56:30PM -0400, Brad Smith wrote:

On 2023-06-23 6:55 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:41:08PM -0400, Brad Smith wrote:

ping.

On 2023-06-17 6:48 p.m., Brad Smith wrote:

On Sun, Jun 18, 2023 at 12:01:14AM +0200, Michael Niedermayer wrote:

this breaks a plain configure
here on ubuntu

./configure
ERROR: sndio not found using pkg-config

If you think configure made a mistake, make sure you are using 
the latest
version from Git.  If the latest version fails, report the 
problem to the
ffmpeg-u...@ffmpeg.org mailing list or IRC #ffmpeg on 
irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure 
as this will help

solve the problem.



[...]
--
Michael GnuPG fingerprint: 
9FF2128B147EF6730BADF133611EC787040B0FAB


The misfortune of the wise is better than the prosperity of the 
fool.

-- Epicurus

This is what I had intended.

You intended to break a plain ./configure on ubuntu ?
If so i think we better dont apply that patch :)

thx

No, there was a second patch there.

oops i missed that, the 2nd patch works fine on ubuntu
no objections from me

thx



ping.

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

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


Re: [FFmpeg-devel] [PATCH] configure: use just the pkg-config for sndio

2023-06-23 Thread Brad Smith

On 2023-06-23 7:35 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:56:30PM -0400, Brad Smith wrote:

On 2023-06-23 6:55 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:41:08PM -0400, Brad Smith wrote:

ping.

On 2023-06-17 6:48 p.m., Brad Smith wrote:

On Sun, Jun 18, 2023 at 12:01:14AM +0200, Michael Niedermayer wrote:

this breaks a plain configure
here on ubuntu

./configure
ERROR: sndio not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-u...@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will 
help
solve the problem.



[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus

This is what I had intended.

You intended to break a plain ./configure on ubuntu ?
If so i think we better dont apply that patch :)

thx

No, there was a second patch there.

oops i missed that, the 2nd patch works fine on ubuntu
no objections from me

thx



Thanks.

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

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


Re: [FFmpeg-devel] [PATCH] configure: use just the pkg-config for sndio

2023-06-23 Thread Brad Smith

On 2023-06-23 6:55 p.m., Michael Niedermayer wrote:

On Fri, Jun 23, 2023 at 06:41:08PM -0400, Brad Smith wrote:

ping.

On 2023-06-17 6:48 p.m., Brad Smith wrote:

On Sun, Jun 18, 2023 at 12:01:14AM +0200, Michael Niedermayer wrote:

this breaks a plain configure
here on ubuntu

./configure
ERROR: sndio not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-u...@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will 
help
solve the problem.



[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus

This is what I had intended.

You intended to break a plain ./configure on ubuntu ?
If so i think we better dont apply that patch :)

thx


No, there was a second patch there.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] configure: use just the pkg-config for sndio

2023-06-23 Thread Brad Smith

ping.

On 2023-06-17 6:48 p.m., Brad Smith wrote:

On Sun, Jun 18, 2023 at 12:01:14AM +0200, Michael Niedermayer wrote:

this breaks a plain configure
here on ubuntu

./configure
ERROR: sndio not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-u...@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
Include the log file "ffbuild/config.log" produced by configure as this will 
help
solve the problem.



[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


This is what I had intended.

---
  configure | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure b/configure
index 0c77d8e1fe..2069bf8a37 100755
--- a/configure
+++ b/configure
@@ -7009,8 +7009,7 @@ 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_pkg_config sndio sndio "sndio.h" sio_open ||

-   check_lib sndio sndio.h sio_open -lsndio; }
+enabled sndio && check_pkg_config sndio sndio sndio.h sio_open
  
  if enabled libcdio; then

  check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" 
cdio_cddap_open ||

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

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


Re: [FFmpeg-devel] [PATCH] configure: use just the pkg-config for sndio

2023-06-17 Thread Brad Smith
On Sun, Jun 18, 2023 at 12:01:14AM +0200, Michael Niedermayer wrote:
> 
> this breaks a plain configure
> here on ubuntu
> 
> ./configure
> ERROR: sndio not found using pkg-config
> 
> If you think configure made a mistake, make sure you are using the latest
> version from Git.  If the latest version fails, report the problem to the
> ffmpeg-u...@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
> Include the log file "ffbuild/config.log" produced by configure as this will 
> help
> solve the problem.
> 
> 
> 
> [...]
> -- 
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> The misfortune of the wise is better than the prosperity of the fool.
> -- Epicurus


This is what I had intended.

---
 configure | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure b/configure
index 0c77d8e1fe..2069bf8a37 100755
--- a/configure
+++ b/configure
@@ -7009,8 +7009,7 @@ 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_pkg_config sndio sndio "sndio.h" sio_open ||
-   check_lib sndio sndio.h sio_open -lsndio; }
+enabled sndio && check_pkg_config sndio sndio sndio.h sio_open
 
 if enabled libcdio; then
 check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" 
cdio_cddap_open ||
-- 
2.41.0

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

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


[FFmpeg-devel] [PATCH] configure: use just the pkg-config for sndio

2023-06-16 Thread Brad Smith


---
 configure | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/configure b/configure
index 0c77d8e1fe..653aafb1ea 100755
--- a/configure
+++ b/configure
@@ -7009,8 +7009,7 @@ 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_pkg_config sndio sndio "sndio.h" sio_open ||
-   check_lib sndio sndio.h sio_open -lsndio; }
+enabled sndio && require_pkg_config sndio sndio sndio.h sio_open
 
 if enabled libcdio; then
 check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" 
cdio_cddap_open ||
-- 
2.41.0

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

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


Re: [FFmpeg-devel] [PATCH] Use proper header for OpenBSD PPC CPU detection

2022-06-23 Thread Brad Smith

ping.

On 3/2/2022 8:34 PM, Brad Smith wrote:

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.


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-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

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

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


[FFmpeg-devel] [PATCH] Use proper header for OpenBSD PPC CPU detection

2022-03-02 Thread Brad Smith
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.


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-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] configure: link to libatomic when it's present

2022-01-29 Thread Brad Smith

On 1/29/2022 4:54 AM, Hendrik Leppkes wrote:


On Sat, Jan 29, 2022 at 5:45 AM Brad Smith
 wrote:

libatomic is dropped by --as-needed since it is not necessary.


Thats what this solution relies on, and thus there is no harm in adding it.


But it doesn't work, and the generated pkg-config files are contaminated 
too. I'll just

have to patch out this broken crap locally.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] configure: link to libatomic when it's present

2022-01-28 Thread Brad Smith

On 1/26/2022 6:49 AM, Anton Khirnov wrote:


Quoting Brad Smith (2022-01-23 20:40:30)

Testing this commit out it does as I had suspected and even with --as-needed
causes a false positive on OpenBSD / FreeBSD.

Why?


Looking at this again and thinking about what it does, the test as is is 
flawed.

With the order being used it doesn't check to see if  the linked binary even
is linked against libatomic. Using --as-needed it drops the libatomic 
dependency
but since the link succeeds then the code as it is and based on the 
ordering, as

I commented about, says go ahead and link in libatomic. Changing the order
so it is "" "-latomic" instead of "-latomic" "" does the right thing.

humpty$ cc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-DPIC -O2 -pipe -I/usr/local/include -I/usr/X11R6/include -std=c11 -fPIC 
-c -o test.o test.c
humpty$ cc -Wl,--as-needed -Wl,-z,noexecstack -o test test.o -latomic 
-L/usr/local/lib -L/usr/X11R6/lib

humpty$ objdump -p test

test: file format elf64-x86-64

Program Header:
    PHDR off    0x0040 vaddr 0x0040 paddr 
0x0040 align 2**3

 filesz 0x02a0 memsz 0x02a0 flags r--
  INTERP off    0x02e0 vaddr 0x02e0 paddr 
0x02e0 align 2**0

 filesz 0x0013 memsz 0x0013 flags r--
    LOAD off    0x vaddr 0x paddr 
0x align 2**12

 filesz 0x05dc memsz 0x05dc flags r--
    LOAD off    0x05e0 vaddr 0x15e0 paddr 
0x15e0 align 2**12

 filesz 0x0450 memsz 0x0450 flags r-x
    LOAD off    0x0a30 vaddr 0x2a30 paddr 
0x2a30 align 2**12

 filesz 0x01c0 memsz 0x01c0 flags rw-
    LOAD off    0x0bf0 vaddr 0x3bf0 paddr 
0x3bf0 align 2**12

 filesz 0x memsz 0x0055 flags rw-
 DYNAMIC off    0x0a88 vaddr 0x2a88 paddr 
0x2a88 align 2**3

 filesz 0x0120 memsz 0x0120 flags rw-
   RELRO off    0x0a30 vaddr 0x2a30 paddr 
0x2a30 align 2**0

 filesz 0x01c0 memsz 0x05d0 flags r--
EH_FRAME off    0x04c8 vaddr 0x04c8 paddr 
0x04c8 align 2**2

 filesz 0x0034 memsz 0x0034 flags r--
OPENBSD_RANDOMIZE off    0x0a30 vaddr 0x2a30 
paddr 0x2a30 align 2**3

 filesz 0x0030 memsz 0x0030 flags rw-
   STACK off    0x vaddr 0x paddr 
0x align 2**0

 filesz 0x memsz 0x flags rw-
    NOTE off    0x02f4 vaddr 0x02f4 paddr 
0x02f4 align 2**2

 filesz 0x0018 memsz 0x0018 flags r--

Dynamic Section:
  NEEDED  libc.so.96.1
  FLAGS_1 0x800
  DEBUG   0x0
  RELA    0x438
  RELASZ  0x30
  RELAENT 0x18
  RELACOUNT   0x1
  JMPREL  0x468
  PLTRELSZ    0x60
  PLTGOT  0x2bb8
  PLTREL  0x7
  SYMTAB  0x310
  SYMENT  0x18
  STRTAB  0x3f8
  STRSZ   0x3f
  GNU_HASH    0x3a0
  HASH    0x3c0

libatomic is dropped by --as-needed since it is not necessary.

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

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


Re: [FFmpeg-devel] [PATCH] Fix setsockopt IP_MULTICAST_TTL on OpenBSD

2022-01-26 Thread Brad Smith
On Wed, Jan 12, 2022 at 12:13:14AM -0500, Brad Smith wrote:
> Fix setsockopt() usage on OpenBSD with IP_MULTICAST_TTL. The field
> type should be an unsigned char on anything but Linux.

Based on feedback so far. Here is a much simpler approach to this issue..


diff --git a/libavformat/udp.c b/libavformat/udp.c
index 83c042d079..da1b98890b 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -164,7 +164,9 @@ static int udp_set_multicast_ttl(int sockfd, int mcastTTL,
 {
 #ifdef IP_MULTICAST_TTL
 if (addr->sa_family == AF_INET) {
-if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL, 
sizeof(mcastTTL)) < 0) {
+unsigned char ttl = mcastTTL;  /* ignore the outdated Linux 
documentation */
+
+if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, 
sizeof(ttl)) < 0) {
 ff_log_net_error(logctx, AV_LOG_ERROR, 
"setsockopt(IP_MULTICAST_TTL)");
 return ff_neterrno();
 }
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] Fix setsockopt IP_MULTICAST_TTL on OpenBSD

2022-01-25 Thread Brad Smith

On 1/25/2022 7:28 PM, Chad Fraleigh wrote:


Since apparently linux will auto-detect (as mentioned by Marton Balint), based on the 
optlen parameter, just using unsigned char in all cases seems to be the cleanest. 
However, I would advise including a comment in the code to that effect which says to 
ignore the [outdated] linux documentation (so someone doesn't needlessly 
"correct" it in the future).

I looked at the kernel source and it does work both ways:

static int do_ip_setsockopt(struct sock *sk, int level, int optname,
 sockptr_t optval, unsigned int optlen)
{
  ...
 switch (optname) {
  ...
 case IP_MULTICAST_TTL:
  ...
 if (optlen >= sizeof(int)) {
 if (copy_from_sockptr(&val, optval, sizeof(val)))
 return -EFAULT;
 } else if (optlen >= sizeof(char)) {
 unsigned char ucval;

 if (copy_from_sockptr(&ucval, optval, sizeof(ucval)))
 return -EFAULT;
 val = (int) ucval;
 }
 }
...
}

This check has been in the kernel since at least 2.6.12-rc2 (from Apr 2005). It 
should work fine, unless newer ffmpeg builds support is needed on older 
systems. So the only question is how old are the kernels in IoT and android 
devices which might use the current ffmpeg?


Thanks. This would he much simpler.

The oldest Android, 1.5, uses the 2.6.27 kernel. The oldest still 
supported Android, 4.4, uses the
3.10 kernel. I cannot imagine anyone shipping anything older than a 3.x 
(something like 3.18) kernel
on anything IoT that is still supported and wanting to ship up to date 
software.


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

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


Re: [FFmpeg-devel] [PATCH] Fix setsockopt IP_MULTICAST_TTL on OpenBSD

2022-01-24 Thread Brad Smith
On Mon, Jan 24, 2022 at 01:40:47PM +0100, Michael Niedermayer wrote:
> On Sun, Jan 23, 2022 at 02:55:38PM -0500, Brad Smith wrote:
> > On 1/23/2022 6:57 AM, Michael Niedermayer wrote:
> > 
> > > On Wed, Jan 12, 2022 at 12:13:13AM -0500, Brad Smith wrote:
> > > > Fix setsockopt() usage on OpenBSD with IP_MULTICAST_TTL. The field
> > > > type should be an unsigned char on anything but Linux.
> > > > 
> > > > 
> > > > diff --git a/libavformat/udp.c b/libavformat/udp.c
> > > > index 180d96a988..29aa865fff 100644
> > > > --- a/libavformat/udp.c
> > > > +++ b/libavformat/udp.c
> > > > @@ -163,7 +163,13 @@ static int udp_set_multicast_ttl(int sockfd, int 
> > > > mcastTTL,
> > > >   {
> > > >   #ifdef IP_MULTICAST_TTL
> > > >   if (addr->sa_family == AF_INET) {
> > > > -if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, 
> > > > &mcastTTL, sizeof(mcastTTL)) < 0) {
> > > > +#ifdef __linux__
> > > > +int ttl = mcastTTL;
> > > > +#else
> > > > +unsigned char ttl = mcastTTL;
> > > > +#endif
> > > this "ifdef __linux__" feels like the wrong thing to check, dont you 
> > > agree ?
> > 
> > Not sure what you mean.
> 
> "__linux__" seems the wrong property to check for
> this is not
> #ifdef __linux__
> osname = "linux"
> #else
> 
> i would have expected more something like
> #if HAVE_INT_TTL
> int ttl = mcastTTL;
> #else
> 
> or maybe even something along the lines of
> 
> WHATEVER_TTL_TYPE ttl = mcastTTL;
> 
> thx

Ok, how about something like this?


diff --git a/configure b/configure
index 493493b4c5..055ff3c206 100755
--- a/configure
+++ b/configure
@@ -3838,6 +3838,8 @@ doc_deps_any="manpages htmlpages podpages txtpages"
 
 logfile="ffbuild/config.log"
 
+multicast_ttl_type='unsigned char'
+
 # installation paths
 prefix_default="/usr/local"
 bindir_default='${prefix}/bin'
@@ -5653,6 +5655,7 @@ case $target_os in
 linux)
 enable section_data_rel_ro
 enabled_any arm aarch64 && enable_weak linux_perf
+multicast_ttl_type='int'
 ;;
 irix*)
 target_os=irix
@@ -7784,6 +7787,7 @@ cat > $TMPH <sa_family == AF_INET) {
-if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL, 
sizeof(mcastTTL)) < 0) {
+MULTICAST_TTL_TYPE ttl = mcastTTL;
+
+if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, 
sizeof(ttl)) < 0) {
 ff_log_net_error(logctx, AV_LOG_ERROR, 
"setsockopt(IP_MULTICAST_TTL)");
 return ff_neterrno();
 }
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] Fix setsockopt IP_MULTICAST_TTL on OpenBSD

2022-01-23 Thread Brad Smith

On 1/23/2022 6:57 AM, Michael Niedermayer wrote:


On Wed, Jan 12, 2022 at 12:13:13AM -0500, Brad Smith wrote:

Fix setsockopt() usage on OpenBSD with IP_MULTICAST_TTL. The field
type should be an unsigned char on anything but Linux.


diff --git a/libavformat/udp.c b/libavformat/udp.c
index 180d96a988..29aa865fff 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -163,7 +163,13 @@ static int udp_set_multicast_ttl(int sockfd, int mcastTTL,
  {
  #ifdef IP_MULTICAST_TTL
  if (addr->sa_family == AF_INET) {
-if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL, 
sizeof(mcastTTL)) < 0) {
+#ifdef __linux__
+int ttl = mcastTTL;
+#else
+unsigned char ttl = mcastTTL;
+#endif

this "ifdef __linux__" feels like the wrong thing to check, dont you agree ?


Not sure what you mean.

But as I said in one of my other posts..

"FreeBSD, NetBSD, OpenBSD, DragonFlyBSD, macOS, Solaris, AIX, IRIX, 
HP-UX, QNX, Minix3 and a few
others define the ttl parameter to IP_MULTICAST_TTL as an unsigned char. 
Linux has it as an integer."


I looked for various examples of IP_MULTICAST_TTL usage in whatever 
projects I could find and most
of the examples I found used only unsigned char, with BIRD (routing 
daemon) being one of few that
use an int for Linux and unsigned char for *BSD's. It does not have 
support for any other OS's.


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

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


Re: [FFmpeg-devel] [PATCH] configure: link to libatomic when it's present

2022-01-23 Thread Brad Smith

On 1/22/2022 4:00 AM, Hendrik Leppkes wrote:


On Sat, Jan 22, 2022 at 7:43 AM Brad Smith
  wrote:

On 1/19/2022 10:23 AM, James Almer wrote:


On 1/19/2022 10:48 AM, Anton Khirnov wrote:

C11 atomics in some configurations (e.g. 64bit operations on ppc64 with
GCC) require linking to libatomic.

Fixes #9275
---
   configure | 25 -
   1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index 1413122d87..3059c154df 100755
--- a/configure
+++ b/configure
@@ -3794,20 +3794,20 @@ cws2fws_extralibs="zlib_extralibs"
 # libraries, in any order
   avcodec_deps="avutil"
-avcodec_suggest="libm"
+avcodec_suggest="libm stdatomic"
   avdevice_deps="avformat avcodec avutil"
-avdevice_suggest="libm"
+avdevice_suggest="libm stdatomic"
   avfilter_deps="avutil"
-avfilter_suggest="libm"
+avfilter_suggest="libm stdatomic"
   avformat_deps="avcodec avutil"
-avformat_suggest="libm network zlib"
-avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl
user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia
bcrypt"
+avformat_suggest="libm network zlib stdatomic"
+avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl
user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia
bcrypt stdatomic"
   postproc_deps="avutil gpl"
-postproc_suggest="libm"
+postproc_suggest="libm stdatomic"
   swresample_deps="avutil"
-swresample_suggest="libm libsoxr"
+swresample_suggest="libm libsoxr stdatomic"
   swscale_deps="avutil"
-swscale_suggest="libm"
+swscale_suggest="libm stdatomic"
 avcodec_extralibs="pthreads_extralibs iconv_extralibs
dxva2_extralibs"
   avfilter_extralibs="pthreads_extralibs"
@@ -6324,7 +6324,14 @@ check_headers asm/types.h
   # it seems there are versions of clang in some distros that try to
use the
   # gcc headers, which explodes for stdatomic
   # so we also check that atomics actually work here
-check_builtin stdatomic stdatomic.h "atomic_int foo, bar =
ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar"
+#
+# some configurations also require linking to libatomic, so try
+# both with -latomic and without
+for LATOMIC in "-latomic" ""; do
+check_builtin stdatomic
stdatomic.h \
+"atomic_int foo, bar = ATOMIC_VAR_INIT(-1);
atomic_store(&foo, 0); foo += bar"  \
+$LATOMIC && eval stdatomic_extralibs="\$LATOMIC" && break
+done

LGTM now, thanks.


 check_lib advapi32 "windows.h"RegCloseKey
-ladvapi32
   check_lib bcrypt   "windows.h bcrypt.h"   BCryptGenRandom -lbcrypt &&

Wait, this should be checking without first then with, if the first test
without fails.


This was covered earlier in the thread for the reason it is not - its
deliberate, because exhaustive functionality checks would be very
complicated.


Testing this commit out it does as I had suspected and even with --as-needed
causes a false positive on OpenBSD / FreeBSD.  Now erroneously tries to link
against libatomic and unlike the other project (haproxy) I ran across an 
overly
simplistic test (doesn't even involve linking, just checking compiler 
predefined

macros) I don't see any options to disable the broken test either.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] Fix setsockopt IP_MULTICAST_TTL on OpenBSD

2022-01-22 Thread Brad Smith

ping.

On 1/12/2022 12:13 AM, Brad Smith wrote:

Fix setsockopt() usage on OpenBSD with IP_MULTICAST_TTL. The field
type should be an unsigned char on anything but Linux.


diff --git a/libavformat/udp.c b/libavformat/udp.c
index 180d96a988..29aa865fff 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -163,7 +163,13 @@ static int udp_set_multicast_ttl(int sockfd, int mcastTTL,
  {
  #ifdef IP_MULTICAST_TTL
  if (addr->sa_family == AF_INET) {
-if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL, 
sizeof(mcastTTL)) < 0) {
+#ifdef __linux__
+int ttl = mcastTTL;
+#else
+unsigned char ttl = mcastTTL;
+#endif
+
+if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, sizeof(ttl)) 
< 0) {
  ff_log_net_error(NULL, AV_LOG_ERROR, 
"setsockopt(IP_MULTICAST_TTL)");
  return ff_neterrno();
  }

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

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


Re: [FFmpeg-devel] [PATCH] configure: link to libatomic when it's present

2022-01-21 Thread Brad Smith

On 1/19/2022 10:23 AM, James Almer wrote:


On 1/19/2022 10:48 AM, Anton Khirnov wrote:

C11 atomics in some configurations (e.g. 64bit operations on ppc64 with
GCC) require linking to libatomic.

Fixes #9275
---
  configure | 25 -
  1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index 1413122d87..3059c154df 100755
--- a/configure
+++ b/configure
@@ -3794,20 +3794,20 @@ cws2fws_extralibs="zlib_extralibs"
    # libraries, in any order
  avcodec_deps="avutil"
-avcodec_suggest="libm"
+avcodec_suggest="libm stdatomic"
  avdevice_deps="avformat avcodec avutil"
-avdevice_suggest="libm"
+avdevice_suggest="libm stdatomic"
  avfilter_deps="avutil"
-avfilter_suggest="libm"
+avfilter_suggest="libm stdatomic"
  avformat_deps="avcodec avutil"
-avformat_suggest="libm network zlib"
-avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl 
user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia 
bcrypt"

+avformat_suggest="libm network zlib stdatomic"
+avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl 
user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia 
bcrypt stdatomic"

  postproc_deps="avutil gpl"
-postproc_suggest="libm"
+postproc_suggest="libm stdatomic"
  swresample_deps="avutil"
-swresample_suggest="libm libsoxr"
+swresample_suggest="libm libsoxr stdatomic"
  swscale_deps="avutil"
-swscale_suggest="libm"
+swscale_suggest="libm stdatomic"
    avcodec_extralibs="pthreads_extralibs iconv_extralibs 
dxva2_extralibs"

  avfilter_extralibs="pthreads_extralibs"
@@ -6324,7 +6324,14 @@ check_headers asm/types.h
  # it seems there are versions of clang in some distros that try to 
use the

  # gcc headers, which explodes for stdatomic
  # so we also check that atomics actually work here
-check_builtin stdatomic stdatomic.h "atomic_int foo, bar = 
ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar"

+#
+# some configurations also require linking to libatomic, so try
+# both with -latomic and without
+for LATOMIC in "-latomic" ""; do
+    check_builtin stdatomic 
stdatomic.h \
+    "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); 
atomic_store(&foo, 0); foo += bar"  \

+    $LATOMIC && eval stdatomic_extralibs="\$LATOMIC" && break
+done


LGTM now, thanks.

    check_lib advapi32 "windows.h"    RegCloseKey  
-ladvapi32

  check_lib bcrypt   "windows.h bcrypt.h"   BCryptGenRandom -lbcrypt &&


Wait, this should be checking without first then with, if the first test 
without fails.


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

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


[FFmpeg-devel] [PATCH] Fix setsockopt IP_MULTICAST_TTL on OpenBSD

2022-01-11 Thread Brad Smith
Fix setsockopt() usage on OpenBSD with IP_MULTICAST_TTL. The field
type should be an unsigned char on anything but Linux.


diff --git a/libavformat/udp.c b/libavformat/udp.c
index 180d96a988..29aa865fff 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -163,7 +163,13 @@ static int udp_set_multicast_ttl(int sockfd, int mcastTTL,
 {
 #ifdef IP_MULTICAST_TTL
 if (addr->sa_family == AF_INET) {
-if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &mcastTTL, 
sizeof(mcastTTL)) < 0) {
+#ifdef __linux__
+int ttl = mcastTTL;
+#else
+unsigned char ttl = mcastTTL;
+#endif
+
+if (setsockopt(sockfd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl, 
sizeof(ttl)) < 0) {
 ff_log_net_error(NULL, AV_LOG_ERROR, 
"setsockopt(IP_MULTICAST_TTL)");
 return ff_neterrno();
 }
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] configure: add initial RISC-V support

2021-08-08 Thread Brad Smith

ping.

On 7/25/2021 6:31 PM, Brad Smith wrote:

OpenBSD only supports riscv64 but this is an attempt at adding
some of the initial bits for RISC-V support.


diff --git a/configure b/configure
index b3b8065188..8b5edaa01e 100755
--- a/configure
+++ b/configure
@@ -2021,6 +2021,7 @@ ARCH_LIST="
  parisc
  ppc
  ppc64
+riscv
  s390
  sh4
  sparc
@@ -2630,7 +2631,7 @@ for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
  done
  
  aligned_stack_if_any="aarch64 ppc x86"

-fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
+fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 riscv64 sparc64 
x86_64"
  fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
  fast_unaligned_if_any="aarch64 ppc x86"
  simd_align_16_if_any="altivec neon sse"
@@ -4957,6 +4958,9 @@ case "$arch" in
  "Power Macintosh"|ppc*|powerpc*)
  arch="ppc"
  ;;
+riscv*)
+arch="riscv"
+;;
  s390|s390x)
  arch="s390"
  ;;
@@ -5348,6 +5352,10 @@ case "$arch" in
  check_64bit ppc ppc64
  enabled shared && enable_weak pic
  ;;
+riscv)
+check_64bit riscv32 riscv64
+enabled shared && enable_weak pic
+;;
  s390)
  check_64bit s390 s390x
  enabled shared && enable_weak pic

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

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


[FFmpeg-devel] [PATCH] configure: add initial RISC-V support

2021-07-25 Thread Brad Smith
OpenBSD only supports riscv64 but this is an attempt at adding
some of the initial bits for RISC-V support.


diff --git a/configure b/configure
index b3b8065188..8b5edaa01e 100755
--- a/configure
+++ b/configure
@@ -2021,6 +2021,7 @@ ARCH_LIST="
 parisc
 ppc
 ppc64
+riscv
 s390
 sh4
 sparc
@@ -2630,7 +2631,7 @@ for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
 done
 
 aligned_stack_if_any="aarch64 ppc x86"
-fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
+fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 riscv64 sparc64 
x86_64"
 fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
 fast_unaligned_if_any="aarch64 ppc x86"
 simd_align_16_if_any="altivec neon sse"
@@ -4957,6 +4958,9 @@ case "$arch" in
 "Power Macintosh"|ppc*|powerpc*)
 arch="ppc"
 ;;
+riscv*)
+arch="riscv"
+;;
 s390|s390x)
 arch="s390"
 ;;
@@ -5348,6 +5352,10 @@ case "$arch" in
 check_64bit ppc ppc64
 enabled shared && enable_weak pic
 ;;
+riscv)
+check_64bit riscv32 riscv64
+enabled shared && enable_weak pic
+;;
 s390)
 check_64bit s390 s390x
 enabled shared && enable_weak pic
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-19 Thread Brad Smith

Can this please be back ported to the 4.4 branch?

On 4/18/2021 4:50 PM, Marton Balint wrote:



On Fri, 16 Apr 2021, Brad Smith wrote:


ping.


Will apply, thanks.

Marton



On 4/3/2021 2:49 PM, Brad Smith wrote:

avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
  libavutil/cpu.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
  DWORD_PTR proc_aff, sys_aff;
  if (GetProcessAffinityMask(GetCurrentProcess(), 
&proc_aff, &sys_aff))

  nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+    int mib[2] = { CTL_HW, HW_NCPUONLINE };
+    size_t len = sizeof(nb_cpus);
+
+    if (sysctl(mib, 2, &nb_cpus, &len, NULL, 0) == -1)
+    nb_cpus = 0;
  #elif HAVE_SYSCTL && defined(HW_NCPU)
  int mib[2] = { CTL_HW, HW_NCPU };
  size_t len = sizeof(nb_cpus);

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

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

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

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

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

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


Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-16 Thread Brad Smith

ping.

On 4/3/2021 2:49 PM, Brad Smith wrote:

avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
  libavutil/cpu.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
  DWORD_PTR proc_aff, sys_aff;
  if (GetProcessAffinityMask(GetCurrentProcess(), &proc_aff, &sys_aff))
  nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+int mib[2] = { CTL_HW, HW_NCPUONLINE };
+size_t len = sizeof(nb_cpus);
+
+if (sysctl(mib, 2, &nb_cpus, &len, NULL, 0) == -1)
+nb_cpus = 0;
  #elif HAVE_SYSCTL && defined(HW_NCPU)
  int mib[2] = { CTL_HW, HW_NCPU };
  size_t len = sizeof(nb_cpus);

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

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

Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-10 Thread Brad Smith

ping.

On 4/3/2021 2:49 PM, Brad Smith wrote:

avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
  libavutil/cpu.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
  DWORD_PTR proc_aff, sys_aff;
  if (GetProcessAffinityMask(GetCurrentProcess(), &proc_aff, &sys_aff))
  nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+int mib[2] = { CTL_HW, HW_NCPUONLINE };
+size_t len = sizeof(nb_cpus);
+
+if (sysctl(mib, 2, &nb_cpus, &len, NULL, 0) == -1)
+nb_cpus = 0;
  #elif HAVE_SYSCTL && defined(HW_NCPU)
  int mib[2] = { CTL_HW, HW_NCPU };
  size_t len = sizeof(nb_cpus);

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

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

[FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-03 Thread Brad Smith
avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
 libavutil/cpu.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
 DWORD_PTR proc_aff, sys_aff;
 if (GetProcessAffinityMask(GetCurrentProcess(), &proc_aff, &sys_aff))
 nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+int mib[2] = { CTL_HW, HW_NCPUONLINE };
+size_t len = sizeof(nb_cpus);
+
+if (sysctl(mib, 2, &nb_cpus, &len, NULL, 0) == -1)
+nb_cpus = 0;
 #elif HAVE_SYSCTL && defined(HW_NCPU)
 int mib[2] = { CTL_HW, HW_NCPU };
 size_t len = sizeof(nb_cpus);
-- 
2.30.2

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

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

Re: [FFmpeg-devel] [PATCH] configure: Remove bitrig support

2020-03-04 Thread Brad Smith
On Wed, Feb 26, 2020 at 02:18:30PM -0500, Brad Smith wrote:
> configure: Remove bitrig support
> 
> Bitrig was an OpenBSD derivative that has been dead for awhile now.
> 
> Signed-off-by: Brad Smith 
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index 06e3a7b2a8..9221621bd1 100755
> --- a/configure
> +++ b/configure
> @@ -5303,7 +5303,7 @@ case $target_os in
>  oss_outdev_extralibs="-lossaudio"
>  enabled gcc || check_ldflags -Wl,-zmuldefs
>  ;;
> -openbsd|bitrig)
> +openbsd)
>  disable symver
>  enable section_data_rel_ro
>  striptype=""
> -- 
> 2.25.0

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

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

[FFmpeg-devel] [PATCH] configure: Remove bitrig support

2020-02-26 Thread Brad Smith
configure: Remove bitrig support

Bitrig was an OpenBSD derivative that has been dead for awhile now.

Signed-off-by: Brad Smith 
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 06e3a7b2a8..9221621bd1 100755
--- a/configure
+++ b/configure
@@ -5303,7 +5303,7 @@ case $target_os in
 oss_outdev_extralibs="-lossaudio"
 enabled gcc || check_ldflags -Wl,-zmuldefs
 ;;
-openbsd|bitrig)
+openbsd)
 disable symver
 enable section_data_rel_ro
 striptype=""
-- 
2.25.0

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

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

[FFmpeg-devel] [PATCH] configure: Enable section_data_rel_ro for OpenBSD aarch64 / arm

2020-02-23 Thread Brad Smith
configure: Enable section_data_rel_ro for OpenBSD aarch64 / arm

Signed-off-by: Brad Smith 
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index ab761c7183..06e3a7b2a8 100755
--- a/configure
+++ b/configure
@@ -5305,6 +5305,7 @@ case $target_os in
 ;;
 openbsd|bitrig)
 disable symver
+enable section_data_rel_ro
 striptype=""
 SHFLAGS='-shared'
 SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
-- 
2.25.0

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

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

Re: [FFmpeg-devel] [PATCH] OpenBSD suport

2020-02-16 Thread Brad Smith

On 2/16/2020 6:23 PM, Michael Niedermayer wrote:


On Sun, Feb 16, 2020 at 02:25:28PM -0500, Brad Smith wrote:

On Sun, Feb 16, 2020 at 03:51:26PM +0100, Michael Niedermayer wrote:

On Sat, Feb 15, 2020 at 03:29:41PM -0500, Brad Smith wrote:

- Garbage collect bitrig. Was a OpenBSD derivative that has been dead for quite 
awhile.
- Enable section_data_rel_ro for ARM support.

are these 2 changes related ?
if not, then they should not be in the same patch

thx

[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact

Ok, separated out the first part.


Enable section_data_rel_ro for ARM support.

diff --git a/configure b/configure
index ab761c7183..06e3a7b2a8 100755
--- a/configure
+++ b/configure
@@ -5305,6 +5305,7 @@ case $target_os in
  ;;
  openbsd|bitrig)
  disable symver
+enable section_data_rel_ro
  striptype=""
  SHFLAGS='-shared'
  SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'

If no arm or openbsd experts reply/review then this is probably ok

thx



This is from our current OpenBSD port / package that I maintain.

http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/graphics/ffmpeg/patches/patch-configure?rev=1.61&content-type=text/plain&hideattic=1 
<http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/graphics/ffmpeg/patches/patch-configure?rev=1.61&content-type=text/plain&hideattic=1> 


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

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

Re: [FFmpeg-devel] [PATCH] OpenBSD suport

2020-02-16 Thread Brad Smith
On Sun, Feb 16, 2020 at 03:51:26PM +0100, Michael Niedermayer wrote:
> On Sat, Feb 15, 2020 at 03:29:41PM -0500, Brad Smith wrote:
> > - Garbage collect bitrig. Was a OpenBSD derivative that has been dead for 
> > quite awhile.
> > - Enable section_data_rel_ro for ARM support.
> 
> are these 2 changes related ?
> if not, then they should not be in the same patch
> 
> thx
> 
> [...]
> -- 
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Complexity theory is the science of finding the exact solution to an
> approximation. Benchmarking OTOH is finding an approximation of the exact

Ok, separated out the first part.


Enable section_data_rel_ro for ARM support.

diff --git a/configure b/configure
index ab761c7183..06e3a7b2a8 100755
--- a/configure
+++ b/configure
@@ -5305,6 +5305,7 @@ case $target_os in
 ;;
 openbsd|bitrig)
 disable symver
+enable section_data_rel_ro
 striptype=""
 SHFLAGS='-shared'
 SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH] OpenBSD suport

2020-02-15 Thread Brad Smith
- Garbage collect bitrig. Was a OpenBSD derivative that has been dead for quite 
awhile.
- Enable section_data_rel_ro for ARM support.


diff --git a/configure b/configure
index ab761c7183..9221621bd1 100755
--- a/configure
+++ b/configure
@@ -5303,8 +5303,9 @@ case $target_os in
 oss_outdev_extralibs="-lossaudio"
 enabled gcc || check_ldflags -Wl,-zmuldefs
 ;;
-openbsd|bitrig)
+openbsd)
 disable symver
+enable section_data_rel_ro
 striptype=""
 SHFLAGS='-shared'
 SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH] v4l2: Make use of the VIDIOC_ENUM_FRAMESIZES ioctl on OpenBSD

2014-10-19 Thread Brad Smith
Make use of the V4L2 VIDIOC_ENUM_FRAMESIZES ioctl on OpenBSD.


diff --git a/configure b/configure
index 5b16af9..790a5eb 100755
--- a/configure
+++ b/configure
@@ -4967,6 +4967,7 @@ check_header linux/videodev2.h
 check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; 
vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
 
 check_header sys/videoio.h
+check_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width 
= 0;" && enable_safe struct_v4l2_frmivalenum_discrete
 
 check_func_headers "windows.h vfw.h" capCreateCaptureWindow 
"$vfwcap_indev_extralibs"
 # check that WM_CAP_DRIVER_CONNECT is defined to the proper value

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel