[FFmpeg-devel] [PATCH 01/21] avutil/avassert: Add av_unreachable and av_assume() macros

2025-05-07 Thread Andreas Rheinhardt
Patches attached.

- Andreas
From dd62fb6eeb9a5bc9a870430a93c6de1aca4be1d6 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt 
Date: Sun, 3 Oct 2021 14:03:25 +0200
Subject: [PATCH 01/21] avutil/avassert: Add av_unreachable and av_assume()
 macros

Useful to let the compiler and static analyzers know that
something is unreachable without adding an av_assert
(which would be either dead for the compiler or add runtime
overhead) for this.
The implementation used here enforces the use of a message
to provide a reason why a particular code is supposed to be
unreachable.

Signed-off-by: Andreas Rheinhardt 
---
 doc/APIchanges   |  3 +++
 libavutil/avassert.h | 42 ++
 2 files changed, 45 insertions(+)

diff --git a/doc/APIchanges b/doc/APIchanges
index 75d66f87f3..78dcaa8009 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28
 
 API changes, most recent first:
 
+2025-05-06 - xx - lavu 60.xx.100 - avassert.h
+  Add av_unreachable() and av_assume() macros.
+
 2025-04-21 - xx - lavu 60.2.100 - log.h
   Add AV_CLASS_CATEGORY_HWDEVICE.
 
diff --git a/libavutil/avassert.h b/libavutil/avassert.h
index 1895fb7551..d0d5aa0c7e 100644
--- a/libavutil/avassert.h
+++ b/libavutil/avassert.h
@@ -31,6 +31,7 @@
 #ifdef HAVE_AV_CONFIG_H
 #   include "config.h"
 #endif
+#include "attributes.h"
 #include "log.h"
 #include "macros.h"
 
@@ -75,4 +76,45 @@
  */
 void av_assert0_fpu(void);
 
+/**
+ * Asserts that are used as compiler optimization hints depending
+ * upon ASSERT_LEVEL and NBDEBUG.
+ *
+ * Undefined behaviour occurs if execution reaches a point marked
+ * with av_unreachable() or if a condition used with av_assume()
+ * is false.
+ *
+ * The condition used with av_assume() should not have side-effects
+ * and should be visible to the compiler.
+ */
+#if defined(ASSERT_LEVEL) ? ASSERT_LEVEL > 0 : !defined(HAVE_AV_CONFIG_H) && !defined(NDEBUG)
+#define av_unreachable(msg)\
+do {   \
+av_log(NULL, AV_LOG_PANIC, \
+   "Code at %s:%d that was supposedly unreachable due to '%s' reached\n", \
+   __FILE__, __LINE__, msg); \
+abort();   \
+} while (0)
+#define av_assume(cond) av_assert0(cond)
+#else
+#if AV_GCC_VERSION_AT_LEAST(4, 5) || AV_HAS_BUILTIN(__builtin_unreachable)
+#define av_unreachable(msg) __builtin_unreachable()
+#elif  defined(_MSC_VER)
+#define av_unreachable(msg) __assume(0)
+#define av_assume(cond) __assume(cond)
+#elif __STDC_VERSION__ >= 202311L
+#include 
+#define av_unreachable(msg) unreachable()
+#else
+#define av_unreachable(msg) ((void)0)
+#endif
+
+#ifndef av_assume
+#define av_assume(cond) do { \
+if (!(cond)) \
+av_unreachable();\
+} while (0)
+#endif
+#endif
+
 #endif /* AVUTIL_AVASSERT_H */
-- 
2.45.2

From 042dc507caa21b688e2fde067607ababd8df7c69 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt 
Date: Sun, 3 Oct 2021 14:19:33 +0200
Subject: [PATCH 02/21] avcodec/amrwbdec: Mark default switch as unreachable

Alternative fix for Coverity issue #1473499
instead of a3bb269db92601e2dc0e99352468d02f7b26c7c2.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/amrwbdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 929fc30a3c..91fb870a64 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -556,7 +556,8 @@ static void decode_fixed_vector(float *fixed_vector, const uint16_t *pulse_hi,
((int) pulse_hi[i] << 11), 4, 1);
 break;
 default:
-av_assert2(0);
+av_unreachable("Everything >= MODE_SID is impossible: MODE_SID is patchwelcome,"
+   "> MODE_SID is invalid");
 }
 
 memset(fixed_vector, 0, sizeof(float) * AMRWB_SFR_SIZE);
-- 
2.45.2

From ff5bf386642b1d4917455b035880a84b23b9b2a2 Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt 
Date: Sun, 3 Oct 2021 14:24:33 +0200
Subject: [PATCH 03/21] avcodec/proresenc_anatoliy: Mark impossible case as
 unreachable

Alternative fix for fix Coverity issue 1440385 (instead of
6106177ad66ab28f44520534f386239d2405eeab).

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/proresenc_anatoliy.c | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index fc69b94780..2abb554bd4 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -27,6 +27,7 @@
  * Known FOURCCs: 'ap4h' (444), 'apch' (HQ), 'apcn' (422), 'apcs' (LT), 'acpo' (Proxy)
  */
 
+#include "libavutil/avassert.h"
 #include "libavutil/mem.h"
 #include "libavutil/mem_internal.h"
 #include "libavutil/opt.h"
@@ -845,20 +846,25 @@ static av_cold int prores_encode_init(AVCodecContext *avctx)
 }
 
 if (avctx->profile == AV_PROFILE_UNKNOWN) {
-if (avctx->pix_fmt == AV_PIX_FMT_YUV422P

Re: [FFmpeg-devel] [PATCH 01/11] avcodec/vulkan_encode_h264: Fix memleak on error

2025-05-07 Thread Lynne

On 06/05/2025 01:37, Andreas Rheinhardt wrote:

Patches attached.

- Andreas


Vulkan patches LGTM.


OpenPGP_0xA2FEA5F03F034464.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature
___
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 01/21] avutil/avassert: Add av_unreachable and av_assume() macros

2025-05-07 Thread softworkz .



> -Original Message-
> From: ffmpeg-devel  On Behalf Of Andreas
> Rheinhardt
> Sent: Mittwoch, 7. Mai 2025 13:59
> To: FFmpeg development discussions and patches 
> Subject: [FFmpeg-devel] [PATCH 01/21] avutil/avassert: Add av_unreachable and
> av_assume() macros
> 
> Patches attached.
> 
> - Andreas

Hi Andreas,

from https://ffmpeg.org/developer.html#Submitting-patches-1 

"..ensure the correct mime type is used (text/x-diff or text/x-patch or at 
least text/plain) and that only one patch is inline or attached per mail."

I'm saying that because the way you are submitting, Patchwork only ever 
recognizes the first attached patch, so - in this case - the remaining 20 
patches are not checked by the CI runs.
It's also difficult to review patches that are submitted in this way, even more 
difficult to respond, as that requires to copy the patch into a text editor 
first, in order to add some synthetic quote marks ("> ") and when replying, it 
isn't clear to which of the patches the reply is corresponding to.

As long as there's no migration to a better way, why not try out making PRs to 
https://github.com/ffstaging/FFmpeg? 
AFAIC, I'm quite happy with that route, it's totally painless (no SMTP trouble, 
no manual sending).

Best regards,
sw 



___
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 v10 06/15] fftools/textformat: Introduce AVTextFormatOptions for avtext_context_open()

2025-05-07 Thread Stefano Sabatini
On date Sunday 2025-05-04 02:57:17 +, softworkz wrote:
> From: softworkz 
> 
> This allows future addition of options without
> changes to the signature of avtext_context_open().
> 
> Reviewed-by: Stefano Sabatini 
> Signed-off-by: softworkz 
> ---
>  fftools/ffprobe.c | 13 +
>  fftools/textformat/avtextformat.c | 21 -
>  fftools/textformat/avtextformat.h | 16 +---
>  3 files changed, 26 insertions(+), 24 deletions(-)
> 
> diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> index f5c83925b9..1277b1e4f9 100644
> --- a/fftools/ffprobe.c
> +++ b/fftools/ffprobe.c
> @@ -3168,10 +3168,15 @@ int main(int argc, char **argv)
>  if (ret < 0)
>  goto end;
>  
> -if ((ret = avtext_context_open(&tctx, f, wctx, f_args,
> -   sections, FF_ARRAY_ELEMS(sections), 
> show_value_unit,
> -use_value_prefix, use_byte_value_binary_prefix, 
> use_value_sexagesimal_format,
> -show_optional_fields, show_data_hash)) >= 0) {

> +AVTextFormatOptions tf_options = {
> +.show_optional_fields = show_optional_fields,
> +.show_value_unit = show_value_unit,
> +.use_value_prefix = use_value_prefix,
> +.use_byte_value_binary_prefix = use_byte_value_binary_prefix,
> +.use_value_sexagesimal_format = use_value_sexagesimal_format,
> +};
> +
> +if ((ret = avtext_context_open(&tctx, f, wctx, f_args, sections, 
> FF_ARRAY_ELEMS(sections), tf_options, show_data_hash)) >= 0) {
>  if (f == &avtextformatter_xml)
>  tctx->string_validation_utf8_flags |= 
> AV_UTF8_FLAG_EXCLUDE_XML_INVALID_CONTROL_CODES;
>  
> diff --git a/fftools/textformat/avtextformat.c 
> b/fftools/textformat/avtextformat.c
> index b2c3aa3fc7..91469ef576 100644
> --- a/fftools/textformat/avtextformat.c
> +++ b/fftools/textformat/avtextformat.c
> @@ -125,13 +125,7 @@ void avtext_context_close(AVTextFormatContext **ptctx)
>  
>  
>  int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter 
> *formatter, AVTextWriterContext *writer_context, const char *args,
> -const AVTextFormatSection *sections, int nb_sections,
> -int show_value_unit,
> -int use_value_prefix,
> -int use_byte_value_binary_prefix,
> -int use_value_sexagesimal_format,
> -int show_optional_fields,
> -char *show_data_hash)
> +const AVTextFormatSection *sections, int 
> nb_sections, AVTextFormatOptions options, char *show_data_hash)
>  {
>  AVTextFormatContext *tctx;
>  int i, ret = 0;
> @@ -154,11 +148,11 @@ int avtext_context_open(AVTextFormatContext **ptctx, 
> const AVTextFormatter *form
>  goto fail;
>  }
>  
> -tctx->show_value_unit = show_value_unit;
> -tctx->use_value_prefix = use_value_prefix;
> -tctx->use_byte_value_binary_prefix = use_byte_value_binary_prefix;
> -tctx->use_value_sexagesimal_format = use_value_sexagesimal_format;
> -tctx->show_optional_fields = show_optional_fields;
> +tctx->show_value_unit = options.show_value_unit;
> +tctx->use_value_prefix = options.use_value_prefix;
> +tctx->use_byte_value_binary_prefix = 
> options.use_byte_value_binary_prefix;
> +tctx->use_value_sexagesimal_format = 
> options.use_value_sexagesimal_format;
> +tctx->show_optional_fields = options.show_optional_fields;
>  
>  if (nb_sections > SECTION_MAX_NB_SECTIONS) {
>  av_log(tctx, AV_LOG_ERROR, "The number of section definitions (%d) 
> is larger than the maximum allowed (%d)\n", nb_sections, 
> SECTION_MAX_NB_SECTIONS);
> @@ -201,7 +195,7 @@ int avtext_context_open(AVTextFormatContext **ptctx, 
> const AVTextFormatter *form
>  av_dict_free(&opts);
>  }
>  
> -if (show_data_hash)
> +if (show_data_hash) {
>  if ((ret = av_hash_alloc(&tctx->hash, show_data_hash)) < 0) {
>  if (ret == AVERROR(EINVAL)) {
>  const char *n;
> @@ -212,6 +206,7 @@ int avtext_context_open(AVTextFormatContext **ptctx, 
> const AVTextFormatter *form
>  }
>  goto fail;
>  }
> +}
>  
>  /* validate replace string */
>  {
> diff --git a/fftools/textformat/avtextformat.h 
> b/fftools/textformat/avtextformat.h
> index 8ff503401a..87f57d8c24 100644
> --- a/fftools/textformat/avtextformat.h
> +++ b/fftools/textformat/avtextformat.h
> @@ -117,17 +117,19 @@ struct AVTextFormatContext {
>  unsigned int string_validation_utf8_flags;
>  };
>  
> +typedef struct AVTextFormatOptions {
> +int show_optional_fields;
> +int show_value_unit;
> +int use_value_prefix;
> +int use_byte_value_binary_prefix;
> +int use_value_sexagesimal_format;
> +} AVTextFormatOptions;

I'm not yet convinced this is needed - why not to use a flags field as
in mos

[FFmpeg-devel] [PATCH] lavu/hwcontext_vaapi: Add direct map quirk for Intel i965 driver

2025-05-07 Thread David Rosca
vaGetImage is currently used for all maps when read access is required
because vaDeriveImage is supposed to be very slow on old Intel HW with
i965 driver.
However, this is not the case with modern drivers and vaDeriveImage
is faster also for reading.

Add a new quirk for i965 driver that will keep the old behavior of using
vaGetImage for read access, and prefer vaDeriveImage with other drivers.
---
 libavutil/hwcontext_vaapi.c | 8 ++--
 libavutil/hwcontext_vaapi.h | 7 +++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 95aa38d9d2..99148ba5da 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -377,7 +377,7 @@ static const struct {
 {
 "Intel i965 (Quick Sync)",
 "i965",
-AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS,
+AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS | 
AV_VAAPI_DRIVER_QUIRK_AVOID_DIRECT_MAP_READ,
 },
 #endif
 {
@@ -812,6 +812,7 @@ static int vaapi_map_frame(AVHWFramesContext *hwfc,
 #if VA_CHECK_VERSION(1, 21, 0)
 uint32_t vaflags = 0;
 #endif
+int use_direct_map;
 
 surface_id = (VASurfaceID)(uintptr_t)src->data[3];
 av_log(hwfc, AV_LOG_DEBUG, "Map surface %#x.\n", surface_id);
@@ -854,8 +855,11 @@ static int vaapi_map_frame(AVHWFramesContext *hwfc,
 // faster with a copy routine which is aware of the limitation, but we
 // assume for now that the user is not aware of that and would therefore
 // prefer not to be given direct-mapped memory if they request read access.
+use_direct_map = !(flags & AV_HWFRAME_MAP_READ) ||
+!(hwctx->driver_quirks & AV_VAAPI_DRIVER_QUIRK_AVOID_DIRECT_MAP_READ);
+
 if (ctx->derive_works && dst->format == hwfc->sw_format &&
-((flags & AV_HWFRAME_MAP_DIRECT) || !(flags & AV_HWFRAME_MAP_READ))) {
+((flags & AV_HWFRAME_MAP_DIRECT) || use_direct_map)) {
 vas = vaDeriveImage(hwctx->display, surface_id, &map->image);
 if (vas != VA_STATUS_SUCCESS) {
 av_log(hwfc, AV_LOG_ERROR, "Failed to derive image from "
diff --git a/libavutil/hwcontext_vaapi.h b/libavutil/hwcontext_vaapi.h
index 0b2e071cb3..c08843bed1 100644
--- a/libavutil/hwcontext_vaapi.h
+++ b/libavutil/hwcontext_vaapi.h
@@ -58,6 +58,13 @@ enum {
  * and the results of the vaQuerySurfaceAttributes() call will be faked.
  */
 AV_VAAPI_DRIVER_QUIRK_SURFACE_ATTRIBUTES = (1 << 3),
+
+/**
+ * The driver does not map memory with fast read access.
+ * The surface map code will prefer vaGetImage instead of vaDeriveImage
+ * for read access, unless direct map was requested.
+ */
+AV_VAAPI_DRIVER_QUIRK_AVOID_DIRECT_MAP_READ = (1 << 4),
 };
 
 /**
-- 
2.49.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 v5] Mark C globals with small code model

2025-05-07 Thread Rémi Denis-Courmont
Hi,

This looks like a kludge to me. If static variables are too far away, then the 
assembler code that refers to them needs to be fixed, and that's all that there 
is to it.

You can't just magically make the data and the code closer, especially if 
FFmpeg is compiled as a static library (a very common use case).

Also putting x86-specific hacks all over the code base, meh. Other 
architectures have all dealt with that issue cleanly already.
___
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 for Phantom .cine files

2025-05-07 Thread Michael Niedermayer
On Tue, May 06, 2025 at 03:08:37PM +0200, Max Rudolph via ffmpeg-devel wrote:
> Hello,
> I'm offering a patch to add support for additional CFA types when reading
> phantom cine files. This was necessary to get ffmpeg to debayer the cine
> files produced by my newer Phantom C321.
> 
> 
> 
> Max Rudolph
> Associate Professor | Earth and Planetary Sciences | UC Davis
> website 

>  cinedec.c |   22 ++
>  1 file changed, 22 insertions(+)
> 1a678951b70753c2df03dc2bb527fd5c97fe117a  0001-fix-cine.patch
> From 08af335dda19e4a16f83d72b0c7c1df80714323c Mon Sep 17 00:00:00 2001
> From: Max Rudolph 
> Date: Tue, 6 May 2025 14:52:30 +0200
> Subject: [PATCH] add support for additional Bayer CFA patterns for Phantom 
> CINE file format

will apply with tabs replaced by spaces

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


signature.asc
Description: PGP signature
___
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 2/2] fftools/textformat: correctly propagate uninit error codes

2025-05-07 Thread Marton Balint
This allows catching IO errors occuring at file close.

Signed-off-by: Marton Balint 
---
 fftools/textformat/avtextformat.c  | 4 ++--
 fftools/textformat/avtextformat.h  | 2 +-
 fftools/textformat/avtextwriters.h | 2 +-
 fftools/textformat/tw_avio.c   | 6 --
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/fftools/textformat/avtextformat.c 
b/fftools/textformat/avtextformat.c
index 5abf81194e..3c9193bb64 100644
--- a/fftools/textformat/avtextformat.c
+++ b/fftools/textformat/avtextformat.c
@@ -114,7 +114,7 @@ int avtext_context_close(AVTextFormatContext **ptctx)
 
 if (tctx->formatter) {
 if (tctx->formatter->uninit)
-tctx->formatter->uninit(tctx);
+ret = tctx->formatter->uninit(tctx);
 if (tctx->formatter->priv_class)
 av_opt_free(tctx->priv);
 }
@@ -594,7 +594,7 @@ int avtextwriter_context_close(AVTextWriterContext **pwctx)
 
 if (wctx->writer) {
 if (wctx->writer->uninit)
-wctx->writer->uninit(wctx);
+ret = wctx->writer->uninit(wctx);
 if (wctx->writer->priv_class)
 av_opt_free(wctx->priv);
 }
diff --git a/fftools/textformat/avtextformat.h 
b/fftools/textformat/avtextformat.h
index 9fad3caae5..169305927b 100644
--- a/fftools/textformat/avtextformat.h
+++ b/fftools/textformat/avtextformat.h
@@ -72,7 +72,7 @@ typedef struct AVTextFormatter {
 const char *name;
 
 int  (*init)  (AVTextFormatContext *tctx);
-void (*uninit)(AVTextFormatContext *tctx);
+int  (*uninit)(AVTextFormatContext *tctx);
 
 void (*print_section_header)(AVTextFormatContext *tctx, const void *data);
 void (*print_section_footer)(AVTextFormatContext *tctx);
diff --git a/fftools/textformat/avtextwriters.h 
b/fftools/textformat/avtextwriters.h
index 87b0024ba1..04e5edcb67 100644
--- a/fftools/textformat/avtextwriters.h
+++ b/fftools/textformat/avtextwriters.h
@@ -38,7 +38,7 @@ typedef struct AVTextWriter {
 const char *name;
 
 int (* init)(AVTextWriterContext *wctx);
-void (* uninit)(AVTextWriterContext *wctx);
+int (* uninit)(AVTextWriterContext *wctx);
 void (* writer_w8)(AVTextWriterContext *wctx, int b);
 void (* writer_put_str)(AVTextWriterContext *wctx, const char *str);
 void (* writer_printf)(AVTextWriterContext *wctx, const char *fmt, ...);
diff --git a/fftools/textformat/tw_avio.c b/fftools/textformat/tw_avio.c
index 6034f74ec9..35c595f457 100644
--- a/fftools/textformat/tw_avio.c
+++ b/fftools/textformat/tw_avio.c
@@ -36,12 +36,14 @@ typedef struct IOWriterContext {
 int close_on_uninit;
 } IOWriterContext;
 
-static av_cold void iowriter_uninit(AVTextWriterContext *wctx)
+static av_cold int iowriter_uninit(AVTextWriterContext *wctx)
 {
 IOWriterContext *ctx = wctx->priv;
+int ret = 0;
 
 if (ctx->close_on_uninit)
-avio_closep(&ctx->avio_context);
+ret = avio_closep(&ctx->avio_context);
+return ret;
 }
 
 static void io_w8(AVTextWriterContext *wctx, int b)
-- 
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 v4 5/6] ogg/vorbis: implement header packet skip in chained ogg bitstreams.

2025-05-07 Thread Michael Niedermayer
On Tue, May 06, 2025 at 09:19:31AM -0500, Romain Beauxis wrote:
> ---
>  libavformat/oggparsevorbis.c   | 11 +--
>  tests/ref/fate/ogg-vorbis-chained-meta.txt |  3 ---
>  2 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c
> index 9f50ab9ffc..8b4ae872d2 100644
> --- a/libavformat/oggparsevorbis.c
> +++ b/libavformat/oggparsevorbis.c
> @@ -418,6 +418,7 @@ static int vorbis_packet(AVFormatContext *s, int idx)
>  struct ogg_stream *os = ogg->streams + idx;
>  struct oggvorbis_private *priv = os->private;
>  int duration, flags = 0;
> +int skip_packet = 0;
>  
>  if (!priv->vp)
>  return AVERROR_INVALIDDATA;
> @@ -480,7 +481,13 @@ static int vorbis_packet(AVFormatContext *s, int idx)
>  if (duration < 0) {
>  os->pflags |= AV_PKT_FLAG_CORRUPT;
>  return 0;
> -} else if (flags & VORBIS_FLAG_COMMENT) {
> +}
> +
> +if (flags &
> +(VORBIS_FLAG_HEADER | VORBIS_FLAG_COMMENT | VORBIS_FLAG_SETUP))
> +skip_packet = 1;

can the content of the header containing "global" tables for vorbis change?
if so what does this patch do to such a stream ?

(I mean is this breaking such streams? or do they not exist or did that never 
work?)

thx

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

If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.


signature.asc
Description: PGP signature
___
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 0/2] FFmpeg Source plugin experiment

2025-05-07 Thread Michael Niedermayer
On Tue, May 06, 2025 at 01:06:40AM +0200, Michael Niedermayer wrote:
> This patch set will remove libpostproc from FFmpeg
> resulting in a master branch like: 
> https://github.com/michaelni/FFmpeg/tree/experiment-sourceplugin-master
> 
> matching this, libpostproc can trivially become a source plugin like here:
> https://github.com/michaelni/FFmpeg/tree/experiment-sourceplugin-libpostproc
> 
> git merge between the 2 will simply put libpostproc back. Both sides
> can evolve and merge will still work fine. Conflicts would only be
> expected if changes cross each other.
> 
> This is in fact so simple its almost hard to believe
> 
> Also, I have split out libpostproc in a more conventional style
> here: https://github.com/michaelni/libpostproc
> This also has been updated already once to include changes from
> 5months of changes to the build system, libavutil and fate.
> 
> Both aprouches can be compared but so far the source plugin style
> is less work and i expect it to continue to be easier.
> 
> The idea of course here is to expand this to filters and other
> things. Which again is trivial, nothing really is needed except
> people simply following this style of a source plugin
> 
> What will make source plugins even easier is if the files
> that they touch, like allfilters/allcodecs/Makefile/... would be split
> so conflicts change from rare to impossible.
> 
> Note, in case this is applied before 8.0, I do intend to include
> the libpostproc source plugin in the 8.0 release, so as not to
> cause more delays or inconveniences

patchset applied

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

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri


signature.asc
Description: PGP signature
___
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 1/2] Revert "fftools/textformat/avtextformat: Make close functions return void"

2025-05-07 Thread Marton Balint
This reverts commit 7684243fbe6e84fecb4a039195d5fda8a006a2a4 and
a888975a3c25760027cd59932f5c1ad04368db8b.
---
 fftools/ffprobe.c  | 14 +++---
 fftools/textformat/avtextformat.c  | 12 
 fftools/textformat/avtextformat.h  |  2 +-
 fftools/textformat/avtextwriters.h |  2 +-
 4 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index d980d4e64f..a2342ec894 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3077,7 +3077,7 @@ int main(int argc, char **argv)
 AVTextWriterContext *wctx;
 char *buf;
 char *f_name = NULL, *f_args = NULL;
-int ret, i;
+int ret, input_ret, i;
 
 init_dynload();
 
@@ -3199,11 +3199,19 @@ int main(int argc, char **argv)
 show_error(tctx, ret);
 }
 
+input_ret = ret;
+
 avtext_print_section_footer(tctx);
 
-avtextwriter_context_close(&wctx);
+ret = avtextwriter_context_close(&wctx);
+if (ret < 0)
+av_log(NULL, AV_LOG_ERROR, "Writing output failed (closing 
writer): %s\n", av_err2str(ret));
+
+ret = avtext_context_close(&tctx);
+if (ret < 0)
+av_log(NULL, AV_LOG_ERROR, "Writing output failed (closing 
formatter): %s\n", av_err2str(ret));
 
-avtext_context_close(&tctx);
+ret = FFMIN(ret, input_ret);
 }
 
 end:
diff --git a/fftools/textformat/avtextformat.c 
b/fftools/textformat/avtextformat.c
index 9200b9b1ad..5abf81194e 100644
--- a/fftools/textformat/avtextformat.c
+++ b/fftools/textformat/avtextformat.c
@@ -99,13 +99,14 @@ static void bprint_bytes(AVBPrint *bp, const uint8_t *ubuf, 
size_t ubuf_size)
 av_bprintf(bp, "%02X", ubuf[i]);
 }
 
-void avtext_context_close(AVTextFormatContext **ptctx)
+int avtext_context_close(AVTextFormatContext **ptctx)
 {
 AVTextFormatContext *tctx = *ptctx;
 int i;
+int ret = 0;
 
 if (!tctx)
-return;
+return AVERROR(EINVAL);
 
 av_hash_freep(&tctx->hash);
 
@@ -122,6 +123,7 @@ void avtext_context_close(AVTextFormatContext **ptctx)
 av_freep(&tctx->priv);
 av_opt_free(tctx);
 av_freep(ptctx);
+return ret;
 }
 
 
@@ -582,12 +584,13 @@ static const AVClass textwriter_class = {
 };
 
 
-void avtextwriter_context_close(AVTextWriterContext **pwctx)
+int avtextwriter_context_close(AVTextWriterContext **pwctx)
 {
 AVTextWriterContext *wctx = *pwctx;
+int ret = 0;
 
 if (!wctx)
-return;
+return AVERROR(EINVAL);
 
 if (wctx->writer) {
 if (wctx->writer->uninit)
@@ -597,6 +600,7 @@ void avtextwriter_context_close(AVTextWriterContext **pwctx)
 }
 av_freep(&wctx->priv);
 av_freep(pwctx);
+return ret;
 }
 
 
diff --git a/fftools/textformat/avtextformat.h 
b/fftools/textformat/avtextformat.h
index c2c56dc1a7..9fad3caae5 100644
--- a/fftools/textformat/avtextformat.h
+++ b/fftools/textformat/avtextformat.h
@@ -132,7 +132,7 @@ int avtext_context_open(AVTextFormatContext **ptctx, const 
AVTextFormatter *form
 int show_optional_fields,
 char *show_data_hash);
 
-void avtext_context_close(AVTextFormatContext **tctx);
+int avtext_context_close(AVTextFormatContext **tctx);
 
 
 void avtext_print_section_header(AVTextFormatContext *tctx, const void *data, 
int section_id);
diff --git a/fftools/textformat/avtextwriters.h 
b/fftools/textformat/avtextwriters.h
index c99d6b3548..87b0024ba1 100644
--- a/fftools/textformat/avtextwriters.h
+++ b/fftools/textformat/avtextwriters.h
@@ -55,7 +55,7 @@ typedef struct AVTextWriterContext {
 
 int avtextwriter_context_open(AVTextWriterContext **pwctx, const AVTextWriter 
*writer);
 
-void avtextwriter_context_close(AVTextWriterContext **pwctx);
+int avtextwriter_context_close(AVTextWriterContext **pwctx);
 
 int avtextwriter_create_stdout(AVTextWriterContext **pwctx);
 
-- 
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] avfilter/vf_setparams: Fix chroma_location being cleared

2025-05-07 Thread Tobias Rapp

On 02/05/2025 22:08, Michael Niedermayer wrote:


On Wed, Apr 30, 2025 at 02:56:58PM +0200, Tobias Rapp wrote:

On 30/04/2025 14:09, Tobias Rapp wrote:


Fix chroma_location being cleared by setrange and setfield filters.
This was forgotten in 201f1cba150d44de6fedfeee4e8647170ed5fbca.

Signed-off-by: Tobias Rapp 
---
   libavfilter/vf_setparams.c | 2 ++
   1 file changed, 2 insertions(+)

diff --git a/libavfilter/vf_setparams.c b/libavfilter/vf_setparams.c
index 751750e..1e37876 100644
--- a/libavfilter/vf_setparams.c
+++ b/libavfilter/vf_setparams.c
@@ -236,6 +236,7 @@ static av_cold int init_setrange(AVFilterContext *ctx)
   s->color_primaries = -1;
   s->color_trc   = -1;
   s->colorspace  = -1;
+s->chroma_location = -1;
   return 0;
   }
@@ -272,6 +273,7 @@ static av_cold int init_setfield(AVFilterContext *ctx)
   s->color_primaries = -1;
   s->color_trc   = -1;
   s->colorspace  = -1;
+s->chroma_location = -1;
   return 0;
   }

If approved, I would also like to backport the fix to the release/7.1
branch.

backport ok
201f1cba150d44de6fedfeee4e8647170ed5fbca is niklas change so, give him a
bit time to reply but it looks like this was forgotten i agree


Pushed to master and backported to release/7.1.

Regards, Tobias

___
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 01/21] avutil/avassert: Add av_unreachable and av_assume() macros

2025-05-07 Thread James Almer

On 5/7/2025 2:57 PM, softworkz . wrote:




-Original Message-
From: ffmpeg-devel  On Behalf Of Andreas
Rheinhardt
Sent: Mittwoch, 7. Mai 2025 13:59
To: FFmpeg development discussions and patches 
Subject: [FFmpeg-devel] [PATCH 01/21] avutil/avassert: Add av_unreachable and
av_assume() macros

Patches attached.

- Andreas


Hi Andreas,

from https://ffmpeg.org/developer.html#Submitting-patches-1

"..ensure the correct mime type is used (text/x-diff or text/x-patch or at least 
text/plain) and that only one patch is inline or attached per mail."

I'm saying that because the way you are submitting, Patchwork only ever 
recognizes the first attached patch, so - in this case - the remaining 20 
patches are not checked by the CI runs.
It's also difficult to review patches that are submitted in this way, even more difficult to 
respond, as that requires to copy the patch into a text editor first, in order to add some 
synthetic quote marks ("> ") and when replying, it isn't clear to which of the 
patches the reply is corresponding to.

As long as there's no migration to a better way, why not try out making PRs to 
https://github.com/ffstaging/FFmpeg?


I doubt "ffstaging" is affiliated with the project in any capacity.
He can make a MR to the Forgejo instance once we enable it for that purpose.



OpenPGP_signature.asc
Description: OpenPGP digital signature
___
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 01/21] avutil/avassert: Add av_unreachable and av_assume() macros

2025-05-07 Thread softworkz .



> -Original Message-
> From: ffmpeg-devel  On Behalf Of James Almer
> Sent: Mittwoch, 7. Mai 2025 20:30
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH 01/21] avutil/avassert: Add av_unreachable
> and av_assume() macros
> 
> On 5/7/2025 2:57 PM, softworkz . wrote:
> >
> >
> >> -Original Message-
> >> From: ffmpeg-devel  On Behalf Of Andreas
> >> Rheinhardt
> >> Sent: Mittwoch, 7. Mai 2025 13:59
> >> To: FFmpeg development discussions and patches 
> >> Subject: [FFmpeg-devel] [PATCH 01/21] avutil/avassert: Add av_unreachable
> and
> >> av_assume() macros
> >>
> >> Patches attached.
> >>
> >> - Andreas
> >
> > Hi Andreas,
> >
> > from https://ffmpeg.org/developer.html#Submitting-patches-1
> >
> > "..ensure the correct mime type is used (text/x-diff or text/x-patch or at
> least text/plain) and that only one patch is inline or attached per mail."
> >
> > I'm saying that because the way you are submitting, Patchwork only ever
> recognizes the first attached patch, so - in this case - the remaining 20
> patches are not checked by the CI runs.
> > It's also difficult to review patches that are submitted in this way, even
> more difficult to respond, as that requires to copy the patch into a text
> editor first, in order to add some synthetic quote marks ("> ") and when
> replying, it isn't clear to which of the patches the reply is corresponding
> to.
> >
> > As long as there's no migration to a better way, why not try out making PRs
> to https://github.com/ffstaging/FFmpeg?
> 
> I doubt "ffstaging" is affiliated with the project in any capacity.

Hi James,

it works like this:

- You make a PR to https://github.com/ffstaging/FFmpeg
- You make a comment with "/submit"
- The PR will be submitted to the ML as regular patches

Best regards
sw




___
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] libavcodec/riscv:add RVV optimized idct_32x32_8 for HEVC:

2025-05-07 Thread daichengrong
From: daichengrong 

On Banana PI F3:
hevc_idct_32x32_8_c:118833.7 ( 1.00x)
hevc_idct_32x32_8_rvv_i64:   28718.3 ( 4.14x)

Changes in v3:
remove the slides in transposition and spill values from vector 
registers to stack

Changes in v2:
deleted tabs
remove the unnecessary t0 in vsetivli
extract scalars directly into general registers
---
 libavcodec/riscv/Makefile   |   1 +
 libavcodec/riscv/hevcdsp_idct_rvv.S | 925 
 libavcodec/riscv/hevcdsp_init.c |  52 +-
 3 files changed, 958 insertions(+), 20 deletions(-)
 create mode 100644 libavcodec/riscv/hevcdsp_idct_rvv.S

diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile
index a80d2fa2e7..dfc33afbee 100644
--- a/libavcodec/riscv/Makefile
+++ b/libavcodec/riscv/Makefile
@@ -36,6 +36,7 @@ RVV-OBJS-$(CONFIG_H264DSP) += riscv/h264addpx_rvv.o 
riscv/h264dsp_rvv.o \
 OBJS-$(CONFIG_H264QPEL) += riscv/h264qpel_init.o
 RVV-OBJS-$(CONFIG_H264QPEL) += riscv/h264qpel_rvv.o
 OBJS-$(CONFIG_HEVC_DECODER) += riscv/hevcdsp_init.o
+OBJS-$(CONFIG_HEVC_DECODER) += riscv/hevcdsp_idct_rvv.o
 RVV-OBJS-$(CONFIG_HEVC_DECODER)  += riscv/h26x/h2656_inter_rvv.o
 OBJS-$(CONFIG_HUFFYUV_DECODER) += riscv/huffyuvdsp_init.o
 RVV-OBJS-$(CONFIG_HUFFYUV_DECODER) += riscv/huffyuvdsp_rvv.o
diff --git a/libavcodec/riscv/hevcdsp_idct_rvv.S 
b/libavcodec/riscv/hevcdsp_idct_rvv.S
new file mode 100644
index 00..f508b87d84
--- /dev/null
+++ b/libavcodec/riscv/hevcdsp_idct_rvv.S
@@ -0,0 +1,925 @@
+/*
+ * Copyright (c) 2025 Institue of Software Chinese Academy of Sciences (ISCAS).
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/riscv/asm.S"
+
+const trans, align=4
+.2byte  64, 83, 64, 36
+.2byte  89, 75, 50, 18
+.2byte  90, 87, 80, 70
+.2byte  57, 43, 25, 9
+.2byte  90, 90, 88, 85
+.2byte  82, 78, 73, 67
+.2byte  61, 54, 46, 38
+.2byte  31, 22, 13, 4
+endconst
+
+const trans_index, align=4
+.2byte  0, 16, 32, 48, 62, 46, 30, 14
+.2byte  2, 18, 34, 50, 60, 44, 28, 12
+.2byte  4, 20, 36, 52, 58, 42, 26, 10
+.2byte  6, 22, 38, 54, 56, 40, 24, 8
+endconst
+
+.macro sum_sub out, in, c, op, p
+mv t0, \c
+.ifc \op, -
+negt0, t0
+.endif
+vsetivlizero, 4, e16, mf2, ta, ma
+.ifc \p, 2
+vslidedown.viv8, \in, 4
+vwmacc.vx\out, t0, v8
+.else
+vwmacc.vx\out, t0, \in
+.endif
+.endm
+
+.macro add_member32 in, t0, t1, t2, t3, op0, op1, op2, op3, p
+sum_sub v24, \in, \t0, \op0, \p
+sum_sub v25, \in, \t1, \op1, \p
+sum_sub v26, \in, \t2, \op2, \p
+sum_sub v27, \in, \t3, \op3, \p
+.endm
+
+.macro butterfly e, o, tmp_p, tmp_m
+vsetivlizero, 4, e32, m1, ta, ma
+vadd.vv \tmp_p, \e, \o
+vsub.vv \tmp_m, \e, \o
+.endm
+
+.macro butterfly16 in0, in1, in2, in3, in4, in5, in6, in7
+vsetivlizero, 4, e32, m1, ta, ma
+vadd.vv  v20, \in0, \in1
+vsub.vv  \in0, \in0, \in1
+vadd.vv  \in1, \in2, \in3
+vsub.vv  \in2, \in2, \in3
+vadd.vv  \in3, \in4, \in5
+vsub.vv  \in4, \in4, \in5
+vadd.vv  \in5, \in6, \in7
+vsub.vv  \in6, \in6, \in7
+.endm
+
+.macro multiply in
+vsetivlizero, 4, e16, m1, ta, ma
+vse16.v \in, (s0)
+ld  s2, 0*2(s0)
+ld  s3, 1*2(s0)
+ld  s4, 2*2(s0)
+ld  s5, 3*2(s0)
+
+vsetivlizero, 4, e16, mf2, ta, ma
+vwmul.vxv24, v4, s2
+vwmul.vxv25, v4, s3
+vwmul.vxv26, v4, s4
+vwmul.vxv27, v4, s5
+.endm
+
+func tr_block1, zve64x
+multiplyv0
+
+addisp,sp,-8*16
+
+.irp i, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+sdx\i,8*(\i - 10)(sp)
+.endr

Re: [FFmpeg-devel] [PATCH] avutil/hwcontext_vulkan: Query the correct format

2025-05-07 Thread Lynne

On 05/05/2025 21:37, Link Mauve wrote:

In the call to vkGetPhysicalDeviceImageFormatProperties2(), we were
previously requesting the properties of the first fallback format (e.g.
VK_FORMAT_R8_UNORM for VK_FORMAT_G8_B8R8_2PLANE_420_UNORM) instead of
the actual format in use.

We don’t do anything with it afterwards, but there is no reason to keep
querying the wrong format.
---
  libavutil/hwcontext_vulkan.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 35321bb063..0394ce1eba 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -2591,7 +2591,7 @@ static void try_export_flags(AVHWFramesContext *hwfc,
  VkPhysicalDeviceImageFormatInfo2 pinfo = {
  .sType  = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2,
  .pNext  = !exp ? NULL : &enext,
-.format = av_vkfmt_from_pixfmt(hwfc->sw_format)[0],
+.format = vk_find_format_entry(hwfc->sw_format)->vkf,
  .type   = VK_IMAGE_TYPE_2D,
  .tiling = hwctx->tiling,
  .usage  = hwctx->usage,


Thanks, pushed.


OpenPGP_0xA2FEA5F03F034464.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital signature
___
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 0/4] [Please Ignore] ci_test

2025-05-07 Thread Kieran Kunhya via ffmpeg-devel
On Wed, May 7, 2025 at 4:24 AM ffmpegagent  wrote:
>
> This is for testing Patchwork CI builds, not for merging.
>
> softworkz (4):
>   ci_test: Fail configure
>   ci_test: Fail build
>   ci_test: Fail fate
>   ci_test: All good
>
>
>
> base-commit: 2b6303762fc0850b3bd841ebd234c336271f657c
> Published-As: 
> https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-75%2Fsoftworkz%2Fsubmit_ci_test-v1
> Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg 
> pr-ffstaging-75/softworkz/submit_ci_test-v1
> Pull-Request: https://github.com/ffstaging/FFmpeg/pull/75

Do you intend to regularly spam the mailing list (which is already
heavily cluttered and disorganised) with your CI?

Kieran
___
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 01/21] avutil/avassert: Add av_unreachable and av_assume() macros

2025-05-07 Thread softworkz .



> -Original Message-
> From: ffmpeg-devel  On Behalf Of softworkz .
> Sent: Mittwoch, 7. Mai 2025 20:54
> To: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [PATCH 01/21] avutil/avassert: Add av_unreachable
> and av_assume() macros
> 
> 
> 
> > -Original Message-
> > From: ffmpeg-devel  On Behalf Of James
> Almer
> > Sent: Mittwoch, 7. Mai 2025 20:30
> > To: ffmpeg-devel@ffmpeg.org
> > Subject: Re: [FFmpeg-devel] [PATCH 01/21] avutil/avassert: Add
> av_unreachable
> > and av_assume() macros
> >
> > On 5/7/2025 2:57 PM, softworkz . wrote:
> > >
> > >
> > >> -Original Message-
> > >> From: ffmpeg-devel  On Behalf Of Andreas
> > >> Rheinhardt
> > >> Sent: Mittwoch, 7. Mai 2025 13:59
> > >> To: FFmpeg development discussions and patches 
> > >> Subject: [FFmpeg-devel] [PATCH 01/21] avutil/avassert: Add av_unreachable
> > and
> > >> av_assume() macros
> > >>
> > >> Patches attached.
> > >>
> > >> - Andreas
> > >
> > > Hi Andreas,
> > >
> > > from https://ffmpeg.org/developer.html#Submitting-patches-1
> > >
> > > "..ensure the correct mime type is used (text/x-diff or text/x-patch or at
> > least text/plain) and that only one patch is inline or attached per mail."
> > >
> > > I'm saying that because the way you are submitting, Patchwork only ever
> > recognizes the first attached patch, so - in this case - the remaining 20
> > patches are not checked by the CI runs.
> > > It's also difficult to review patches that are submitted in this way, even
> > more difficult to respond, as that requires to copy the patch into a text
> > editor first, in order to add some synthetic quote marks ("> ") and when
> > replying, it isn't clear to which of the patches the reply is corresponding
> > to.
> > >
> > > As long as there's no migration to a better way, why not try out making
> PRs
> > to https://github.com/ffstaging/FFmpeg?
> >
> > I doubt "ffstaging" is affiliated with the project in any capacity.
> 
> Hi James,
> 
> it works like this:
> 
> - You make a PR to https://github.com/ffstaging/FFmpeg
> - You make a comment with "/submit"
> - The PR will be submitted to the ML as regular patches

More specifics:

- The PR message is sent as the cover-letter text [Patch 0/n]
  Markdown is converted to ASCII

- Commit messages are checked for compliance

- CI builds are run on the last commit (yet you can submit 
  without waiting)

- To submit new versions of a patchset, simply force-push to
  your PR branch and comment "/submit" again.
  The patchset will automatically be submitted as a new version
  (v2, v3, etc.)

- Comments made on the ML are automatically mirrored back as PR
  comments on GH

- Cover-letters sent to the ML include a range-diff, showing
  the changes from the previous version
  They also include Git links to directly check out the patchset

Best,
sw
___
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 0/4] [Please Ignore] ci_test

2025-05-07 Thread softworkz .


> -Original Message-
> From: Kieran Kunhya 
> Sent: Mittwoch, 7. Mai 2025 16:16
> To: FFmpeg development discussions and patches 
> Cc: softworkz 
> Subject: Re: [FFmpeg-devel] [PATCH 0/4] [Please Ignore] ci_test
> 
> On Wed, May 7, 2025 at 4:24 AM ffmpegagent  wrote:
> >
> > This is for testing Patchwork CI builds, not for merging.
> >
> > softworkz (4):
> >   ci_test: Fail configure
> >   ci_test: Fail build
> >   ci_test: Fail fate
> >   ci_test: All good
> >
> >
> >
> > base-commit: 2b6303762fc0850b3bd841ebd234c336271f657c
> > Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-
> 75%2Fsoftworkz%2Fsubmit_ci_test-v1
> > Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-
> 75/softworkz/submit_ci_test-v1
> > Pull-Request: https://github.com/ffstaging/FFmpeg/pull/75
> 
> Do you intend to regularly spam the mailing list (which is already
> heavily cluttered and disorganised) with your CI?

It's about Patchwork CI - not "my CI". 
Please see message "New Patchwork CI Builds" for context.

Thank you
sw

___
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 v12 02/15] fftools/textformat: Apply quality improvements

2025-05-07 Thread softworkz
From: softworkz 

Perform multiple improvements to increase code robustness.
In particular:
- favor unsigned counters for loops
- add missing checks
- avoid possible leaks
- move variable declarations to inner scopes when feasible
- provide explicit type-casting when needed

Signed-off-by: softworkz 
---
 fftools/textformat/avtextformat.c | 82 +--
 fftools/textformat/avtextformat.h |  6 +--
 fftools/textformat/tf_default.c   |  8 ++-
 fftools/textformat/tf_ini.c   |  2 +-
 fftools/textformat/tf_json.c  | 17 ---
 fftools/textformat/tf_xml.c   |  3 --
 fftools/textformat/tw_avio.c  |  9 +++-
 7 files changed, 82 insertions(+), 45 deletions(-)

diff --git a/fftools/textformat/avtextformat.c 
b/fftools/textformat/avtextformat.c
index 6571ac6da0..1edf24d956 100644
--- a/fftools/textformat/avtextformat.c
+++ b/fftools/textformat/avtextformat.c
@@ -93,9 +93,8 @@ static const AVClass textcontext_class = {
 
 static void bprint_bytes(AVBPrint *bp, const uint8_t *ubuf, size_t ubuf_size)
 {
-int i;
 av_bprintf(bp, "0X");
-for (i = 0; i < ubuf_size; i++)
+for (unsigned i = 0; i < ubuf_size; i++)
 av_bprintf(bp, "%02X", ubuf[i]);
 }
 
@@ -137,6 +136,8 @@ int avtext_context_open(AVTextFormatContext **ptctx, const 
AVTextFormatter *form
 AVTextFormatContext *tctx;
 int i, ret = 0;
 
+av_assert0(ptctx && formatter);
+
 if (!(tctx = av_mallocz(sizeof(AVTextFormatContext {
 ret = AVERROR(ENOMEM);
 goto fail;
@@ -215,8 +216,8 @@ int avtext_context_open(AVTextFormatContext **ptctx, const 
AVTextFormatter *form
 
 /* validate replace string */
 {
-const uint8_t *p = tctx->string_validation_replacement;
-const uint8_t *endp = p + strlen(p);
+const uint8_t *p = (uint8_t *)tctx->string_validation_replacement;
+const uint8_t *endp = p + strlen((const char *)p);
 while (*p) {
 const uint8_t *p0 = p;
 int32_t code;
@@ -229,6 +230,7 @@ int avtext_context_open(AVTextFormatContext **ptctx, const 
AVTextFormatter *form
"Invalid UTF8 sequence %s found in string validation 
replace '%s'\n",
bp.str, tctx->string_validation_replacement);
 return ret;
+goto fail;
 }
 }
 }
@@ -256,6 +258,11 @@ static const char unit_bit_per_second_str[] = "bit/s";
 
 void avtext_print_section_header(AVTextFormatContext *tctx, const void *data, 
int section_id)
 {
+if (section_id < 0 || section_id >= tctx->nb_sections) {
+av_log(tctx, AV_LOG_ERROR, "Invalid section_id for section_header: 
%d\n", section_id);
+return;
+}
+
 tctx->level++;
 av_assert0(tctx->level < SECTION_MAX_NB_LEVELS);
 
@@ -269,6 +276,11 @@ void avtext_print_section_header(AVTextFormatContext 
*tctx, const void *data, in
 
 void avtext_print_section_footer(AVTextFormatContext *tctx)
 {
+if (tctx->level < 0 || tctx->level >= SECTION_MAX_NB_LEVELS) {
+av_log(tctx, AV_LOG_ERROR, "Invalid level for section_footer: %d\n", 
tctx->level);
+return;
+}
+
 int section_id = tctx->section[tctx->level]->id;
 int parent_section_id = tctx->level ?
 tctx->section[tctx->level - 1]->id : SECTION_ID_NONE;
@@ -285,7 +297,11 @@ void avtext_print_section_footer(AVTextFormatContext *tctx)
 
 void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t 
val)
 {
-const struct AVTextFormatSection *section = tctx->section[tctx->level];
+const AVTextFormatSection *section;
+
+av_assert0(key && tctx->level >= 0 && tctx->level < SECTION_MAX_NB_LEVELS);
+
+section = tctx->section[tctx->level];
 
 if (section->show_all_entries || av_dict_get(section->entries_to_show, 
key, NULL, 0)) {
 tctx->formatter->print_integer(tctx, key, val);
@@ -354,17 +370,18 @@ struct unit_value {
 const char *unit;
 };
 
-static char *value_string(AVTextFormatContext *tctx, char *buf, int buf_size, 
struct unit_value uv)
+static char *value_string(const AVTextFormatContext *tctx, char *buf, int 
buf_size, struct unit_value uv)
 {
 double vald;
-int64_t vali;
+int64_t vali = 0;
 int show_float = 0;
 
 if (uv.unit == unit_second_str) {
 vald = uv.val.d;
 show_float = 1;
 } else {
-vald = vali = uv.val.i;
+vald = (double)uv.val.i;
+vali = uv.val.i;
 }
 
 if (uv.unit == unit_second_str && tctx->use_value_sexagesimal_format) {
@@ -383,17 +400,17 @@ static char *value_string(AVTextFormatContext *tctx, char 
*buf, int buf_size, st
 int64_t index;
 
 if (uv.unit == unit_byte_str && 
tctx->use_byte_value_binary_prefix) {
-index = (int64_t) (log2(vald)) / 10;
-index = av_clip(index, 0, FF_ARRAY_ELEMS(si_prefixes) - 1);
+index = (int64_t)(log2(vald) / 10);
+index = av_clip64(index, 0, FF_ARRAY_ELEMS(si

[FFmpeg-devel] [PATCH v12 01/15] fftools/textformat: Apply formatting and whitespace changes

2025-05-07 Thread softworkz
From: softworkz 

Reviewed-by: Stefano Sabatini 
Signed-off-by: softworkz 
---
 fftools/textformat/avtextformat.c  | 88 +++---
 fftools/textformat/avtextformat.h  | 20 +++
 fftools/textformat/avtextwriters.h | 11 ++--
 fftools/textformat/tf_compact.c| 87 -
 fftools/textformat/tf_default.c| 20 +++
 fftools/textformat/tf_flat.c   | 26 +
 fftools/textformat/tf_ini.c| 36 ++--
 fftools/textformat/tf_json.c   | 10 ++--
 fftools/textformat/tf_xml.c| 30 +-
 9 files changed, 172 insertions(+), 156 deletions(-)

diff --git a/fftools/textformat/avtextformat.c 
b/fftools/textformat/avtextformat.c
index 9200b9b1ad..6571ac6da0 100644
--- a/fftools/textformat/avtextformat.c
+++ b/fftools/textformat/avtextformat.c
@@ -34,9 +34,9 @@
 #include "libavutil/opt.h"
 #include "avtextformat.h"
 
-#define SECTION_ID_NONE -1
+#define SECTION_ID_NONE (-1)
 
-#define SHOW_OPTIONAL_FIELDS_AUTO   -1
+#define SHOW_OPTIONAL_FIELDS_AUTO  (-1)
 #define SHOW_OPTIONAL_FIELDS_NEVER   0
 #define SHOW_OPTIONAL_FIELDS_ALWAYS  1
 
@@ -64,14 +64,14 @@ static const char *textcontext_get_formatter_name(void *p)
 
 static const AVOption textcontext_options[] = {
 { "string_validation", "set string validation mode",
-  OFFSET(string_validation), AV_OPT_TYPE_INT, 
{.i64=AV_TEXTFORMAT_STRING_VALIDATION_REPLACE}, 0, 
AV_TEXTFORMAT_STRING_VALIDATION_NB-1, .unit = "sv" },
+  OFFSET(string_validation), AV_OPT_TYPE_INT, { .i64 = 
AV_TEXTFORMAT_STRING_VALIDATION_REPLACE }, 0, 
AV_TEXTFORMAT_STRING_VALIDATION_NB - 1, .unit = "sv" },
 { "sv", "set string validation mode",
-  OFFSET(string_validation), AV_OPT_TYPE_INT, 
{.i64=AV_TEXTFORMAT_STRING_VALIDATION_REPLACE}, 0, 
AV_TEXTFORMAT_STRING_VALIDATION_NB-1, .unit = "sv" },
-{ "ignore",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
AV_TEXTFORMAT_STRING_VALIDATION_IGNORE},  .unit = "sv" },
-{ "replace", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
AV_TEXTFORMAT_STRING_VALIDATION_REPLACE}, .unit = "sv" },
-{ "fail",NULL, 0, AV_OPT_TYPE_CONST, {.i64 = 
AV_TEXTFORMAT_STRING_VALIDATION_FAIL},.unit = "sv" },
-{ "string_validation_replacement", "set string validation replacement 
string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
-{ "svr", "set string validation replacement string", 
OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, 
{.str="\xEF\xBF\xBD"}},
+  OFFSET(string_validation), AV_OPT_TYPE_INT, { .i64 = 
AV_TEXTFORMAT_STRING_VALIDATION_REPLACE }, 0, 
AV_TEXTFORMAT_STRING_VALIDATION_NB - 1, .unit = "sv" },
+{ "ignore",  NULL, 0, AV_OPT_TYPE_CONST,  { .i64 = 
AV_TEXTFORMAT_STRING_VALIDATION_IGNORE },  .unit = "sv" },
+{ "replace", NULL, 0, AV_OPT_TYPE_CONST,  { .i64 = 
AV_TEXTFORMAT_STRING_VALIDATION_REPLACE }, .unit = "sv" },
+{ "fail",NULL, 0, AV_OPT_TYPE_CONST,  { .i64 = 
AV_TEXTFORMAT_STRING_VALIDATION_FAIL },.unit = "sv" },
+{ "string_validation_replacement", "set string validation replacement 
string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, { .str = "" 
} },
+{ "svr", "set string validation replacement string", 
OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, { .str = 
"\xEF\xBF\xBD" } },
 { NULL }
 };
 
@@ -126,7 +126,7 @@ void avtext_context_close(AVTextFormatContext **ptctx)
 
 
 int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter 
*formatter, AVTextWriterContext *writer_context, const char *args,
-const struct AVTextFormatSection *sections, int 
nb_sections,
+const AVTextFormatSection *sections, int nb_sections,
 int show_value_unit,
 int use_value_prefix,
 int use_byte_value_binary_prefix,
@@ -209,7 +209,7 @@ int avtext_context_open(AVTextFormatContext **ptctx, const 
AVTextFormatter *form
 av_log(NULL, AV_LOG_ERROR, " %s", n);
 av_log(NULL, AV_LOG_ERROR, "\n");
 }
-return ret;
+goto fail;
 }
 }
 
@@ -224,10 +224,10 @@ int avtext_context_open(AVTextFormatContext **ptctx, 
const AVTextFormatter *form
 if (ret < 0) {
 AVBPrint bp;
 av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
-bprint_bytes(&bp, p0, p-p0),
-av_log(tctx, AV_LOG_ERROR,
-   "Invalid UTF8 sequence %s found in string 
validation replace '%s'\n",
-   bp.str, tctx->string_validation_replacement);
+bprint_bytes(&bp, p0, p - p0);
+av_log(tctx, AV_LOG_ERROR,
+   "Invalid UTF8 sequence %s found in string validation 
replace '%s'\n",
+   bp.str, tctx->string_validation_replacement);
 return ret;
 }
 }
@

[FFmpeg-devel] [PATCH v12 00/15] Execution Graph Printing

2025-05-07 Thread ffmpegagent
Shortest cover letter for my longest-running FFmpeg patchset:

 * Apply
 * Build
 * Add the "-sg" switch to any FFmpeg command line
 * Press 'q' when you don't want to wait

SG = Show Graph

Documentation and examples can be found here:

https://github.com/softworkz/ffmpeg_output_apis/wiki


Version Updates
===


V2
==

 * Rebased on top of Andreas' improvements
 * Applied changes from review (thanks, Andreas)


V3
==

 * Fixed all "new warnings"
 * Fixed out-of-tree building (thanks, Michael)


V4
==

 * Resolved merge conflict
 * Fixed build on MinGW (missing include due to WIN32_LEAN_AND_MEAN being
   defined) (thanks, Michael)


V5
==

 * Applied changes as per review from Stefano (thanks!)
 * Introduced AVTextFormatOptions struct for options in
   avtext_context_open()


V6
==

 * Fix "new warning" in 2nd last commit
 * Squash patches 04 and 05 (they weren't truely independent)
 * Applied changes as per review from Stefano (thanks!)


V7
==

 * Bitten by OOT builds once again (thanks, Michael)


V8
==

 * New commit Remove void (*print_rational) from AVTextFormatter (unused)
 * New commit fftools/textformat: Rename name param to key for API
   consistency
 * print_int Extend existing function instead of adding print_int_flags
 * Fix registered_formatters[] array size
 * avtextwriters.h: Remove unused includes
 * graphprint.c: Make BPrint inits consistent
 * tf_json: Check nesting level for value printing
 * And other review suggestions by Stefano (thanks!)


V9
==

 * Handle cases where no zlib is available (thanks, Michael)
   and provide configure switch (--disable-resource-compression)


V10
===

 * Fix shared build by not using private URL API from avformat (thanks,
   Michael)


V11
===

 * Resubmit because Patchwork was broken


V12
===

 * Apply requested changes from review (thanks, Stefano)

.

softworkz (15):
  fftools/textformat: Apply formatting and whitespace changes
  fftools/textformat: Apply quality improvements
  fftools/textformat: Remove unused print_rational() pointer from
AVTextFormatter
  fftools/textformat: Rename name param to key for API consistency
  fftools/avtextformat: Re-use BPrint in loop
  fftools/textformat: Introduce AVTextFormatOptions for
avtext_context_open()
  fftools/textformat: Introduce common header and deduplicate code
  fftools/tf_internal: Use av_default_item_name
  fftools/textformat: Add flags param to function avtext_print_integer()
  fftools/ffmpeg_filter: Move some declaration to new header file
  avfilter/avfilter: Add avfilter_link_get_hw_frames_ctx()
  fftools/resources: Add resource manager files with build-time
compression
  fftools/ffmpeg_mux: Make ms_from_ost() inline
  fftools/graphprint: Add execution graph printing
  fftools/graphprint: Now, make it a Killer-Feature!

 configure  |5 +
 doc/APIchanges |3 +
 doc/ffmpeg.texi|   14 +
 ffbuild/common.mak |   43 +-
 fftools/Makefile   |   22 +-
 fftools/ffmpeg.c   |4 +
 fftools/ffmpeg.h   |4 +
 fftools/ffmpeg_filter.c|  195 +
 fftools/ffmpeg_filter.h|  234 ++
 fftools/ffmpeg_mux.h   |2 +-
 fftools/ffmpeg_opt.c   |   17 +
 fftools/ffprobe.c  |   15 +-
 fftools/graph/filelauncher.c   |  205 +
 fftools/graph/graphprint.c | 1153 
 fftools/graph/graphprint.h |   62 ++
 fftools/resources/.gitignore   |4 +
 fftools/resources/Makefile |   13 +
 fftools/resources/graph.css|  353 +
 fftools/resources/graph.html   |   86 +++
 fftools/resources/resman.c |  231 ++
 fftools/resources/resman.h |   50 ++
 fftools/textformat/avtextformat.c  |  239 +++---
 fftools/textformat/avtextformat.h  |   78 +-
 fftools/textformat/avtextwriters.h |   16 +-
 fftools/textformat/tf_compact.c|  117 +--
 fftools/textformat/tf_default.c|   55 +-
 fftools/textformat/tf_flat.c   |   51 +-
 fftools/textformat/tf_ini.c|   62 +-
 fftools/textformat/tf_internal.h   |   81 ++
 fftools/textformat/tf_json.c   |   64 +-
 fftools/textformat/tf_mermaid.c|  658 
 fftools/textformat/tf_mermaid.h|   41 +
 fftools/textformat/tf_xml.c|   68 +-
 fftools/textformat/tw_avio.c   |   18 +-
 fftools/textformat/tw_buffer.c |9 +-
 fftools/textformat/tw_stdout.c |   10 +-
 libavfilter/avfilter.c |9 +
 libavfilter/avfilter.h |   12 +
 38 files changed, 3724 insertions(+), 579 deletions(-)
 create mode 100644 fftools/ffmpeg_filter.h
 create mode 100644 fftools/graph/filelauncher.c
 create mode 100644 fftools/graph/graphprint.c
 create mode 100644 fftools/graph/graphprint.h
 create mode 100644 fftools/resources/.gitignore
 create mode 100644 fftools/resources/Makefile
 create mode 100644 fftools/resources/graph.css
 c

[FFmpeg-devel] [PATCH v12 03/15] fftools/textformat: Remove unused print_rational() pointer from AVTextFormatter

2025-05-07 Thread softworkz
From: softworkz 

Reviewed-by: Stefano Sabatini 
Signed-off-by: softworkz 
---
 fftools/textformat/avtextformat.h  | 1 -
 fftools/textformat/avtextwriters.h | 5 -
 2 files changed, 6 deletions(-)

diff --git a/fftools/textformat/avtextformat.h 
b/fftools/textformat/avtextformat.h
index 86feb9d09d..c61dca159f 100644
--- a/fftools/textformat/avtextformat.h
+++ b/fftools/textformat/avtextformat.h
@@ -75,7 +75,6 @@ typedef struct AVTextFormatter {
 void (*print_section_header)(AVTextFormatContext *tctx, const void *data);
 void (*print_section_footer)(AVTextFormatContext *tctx);
 void (*print_integer)   (AVTextFormatContext *tctx, const char *, 
int64_t);
-void (*print_rational)  (AVTextFormatContext *tctx, AVRational *q, 
char *sep);
 void (*print_string)(AVTextFormatContext *tctx, const char *, 
const char *);
 int flags;  ///< a combination or AV_TEXTFORMAT__FLAG_*
 } AVTextFormatter;
diff --git a/fftools/textformat/avtextwriters.h 
b/fftools/textformat/avtextwriters.h
index 34db3f1832..fd5cda04ef 100644
--- a/fftools/textformat/avtextwriters.h
+++ b/fftools/textformat/avtextwriters.h
@@ -21,14 +21,9 @@
 #ifndef FFTOOLS_TEXTFORMAT_AVTEXTWRITERS_H
 #define FFTOOLS_TEXTFORMAT_AVTEXTWRITERS_H
 
-#include 
 #include 
-#include "libavutil/attributes.h"
-#include "libavutil/dict.h"
 #include "libavformat/avio.h"
 #include "libavutil/bprint.h"
-#include "libavutil/rational.h"
-#include "libavutil/hash.h"
 
 typedef struct AVTextWriterContext AVTextWriterContext;
 
-- 
ffmpeg-codebot

___
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 v12 14/15] fftools/graphprint: Add execution graph printing

2025-05-07 Thread softworkz
From: softworkz 

The key benefits are:

- Different to other graph printing methods, this is outputting:
  - all graphs with runtime state
(including auto-inserted filters)
  - each graph with its inputs and outputs
  - all filters with their in- and output pads
  - all connections between all input- and output pads
  - for each connection:
- the runtime-negotiated format and media type
- the hw context
- if video hw context, both: hw pixfmt + sw pixfmt
- Output can either be printed to stdout or written to specified file
- Output is machine-readable
- Use the same output implementation as ffprobe, supporting multiple
  formats

Signed-off-by: softworkz 
---
 doc/ffmpeg.texi   |   10 +
 fftools/Makefile  |   20 +-
 fftools/ffmpeg.c  |4 +
 fftools/ffmpeg.h  |3 +
 fftools/ffmpeg_filter.c   |5 +
 fftools/ffmpeg_opt.c  |   13 +
 fftools/graph/graphprint.c| 1107 +
 fftools/graph/graphprint.h|   30 +
 fftools/textformat/avtextformat.c |4 +-
 fftools/textformat/avtextformat.h |   29 +
 fftools/textformat/tf_mermaid.c   |  658 +
 fftools/textformat/tf_mermaid.h   |   41 ++
 12 files changed, 1922 insertions(+), 2 deletions(-)
 create mode 100644 fftools/graph/graphprint.c
 create mode 100644 fftools/graph/graphprint.h
 create mode 100644 fftools/textformat/tf_mermaid.c
 create mode 100644 fftools/textformat/tf_mermaid.h

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 17ba876ea3..35675b5309 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -1394,6 +1394,16 @@ It is on by default, to explicitly disable it you need 
to specify @code{-nostats
 @item -stats_period @var{time} (@emph{global})
 Set period at which encoding progress/statistics are updated. Default is 0.5 
seconds.
 
+@item -print_graphs (@emph{global})
+Prints execution graph details to stderr in the format set via 
-print_graphs_format.
+
+@item -print_graphs_file @var{filename} (@emph{global})
+Writes execution graph details to the specified file in the format set via 
-print_graphs_format.
+
+@item -print_graphs_format @var{format} (@emph{global})
+Sets the output format (available formats are: default, compact, csv, flat, 
ini, json, xml, mermaid, mermaidhtml)
+The default format is json.
+
 @item -progress @var{url} (@emph{global})
 Send program-friendly progress information to @var{url}.
 
diff --git a/fftools/Makefile b/fftools/Makefile
index a30bec889e..361a4fd574 100644
--- a/fftools/Makefile
+++ b/fftools/Makefile
@@ -9,6 +9,8 @@ AVBASENAMES  = ffmpeg ffplay ffprobe
 ALLAVPROGS   = $(AVBASENAMES:%=%$(PROGSSUF)$(EXESUF))
 ALLAVPROGS_G = $(AVBASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
 
+include $(SRC_PATH)/fftools/resources/Makefile
+
 OBJS-ffmpeg +=  \
 fftools/ffmpeg_dec.o\
 fftools/ffmpeg_demux.o  \
@@ -19,8 +21,21 @@ OBJS-ffmpeg +=  \
 fftools/ffmpeg_mux_init.o   \
 fftools/ffmpeg_opt.o\
 fftools/ffmpeg_sched.o  \
+fftools/graph/graphprint.o\
 fftools/sync_queue.o\
 fftools/thread_queue.o  \
+fftools/textformat/avtextformat.o \
+fftools/textformat/tf_compact.o   \
+fftools/textformat/tf_default.o   \
+fftools/textformat/tf_flat.o  \
+fftools/textformat/tf_ini.o   \
+fftools/textformat/tf_json.o  \
+fftools/textformat/tf_mermaid.o   \
+fftools/textformat/tf_xml.o   \
+fftools/textformat/tw_avio.o  \
+fftools/textformat/tw_buffer.o\
+fftools/textformat/tw_stdout.o\
+$(OBJS-resman)\
 
 OBJS-ffprobe +=   \
 fftools/textformat/avtextformat.o \
@@ -29,10 +44,12 @@ OBJS-ffprobe +=   \
 fftools/textformat/tf_flat.o  \
 fftools/textformat/tf_ini.o   \
 fftools/textformat/tf_json.o  \
+fftools/textformat/tf_mermaid.o   \
 fftools/textformat/tf_xml.o   \
 fftools/textformat/tw_avio.o  \
 fftools/textformat/tw_buffer.o\
 fftools/textformat/tw_stdout.o\
+$(OBJS-resman)\
 
 OBJS-ffplay += fftools/ffplay_renderer.o
 
@@ -42,7 +59,7 @@ ifdef HAVE_GNU_WINDRES
 OBJS-$(1) += fftools/fftoolsres.o
 endif
 $(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1))
-$$(OBJS-$(1)): | fftools fftools/textformat fftools/resources
+$$(OBJS-$(1)): | fftools fftools/textformat fftools/resources fftools/graph
 $$(OBJS-$(1)): CFLAGS  += $(CFLAGS-$(1))
 $(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
 $(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(EXTRALIBS-$(1))
@@ -57,6 +74,7 @@ fftools/ffprobe.o fftools/cmdutils.o: libavutil/ffversion.h | 
fftools
 OUTDIRS += fftools
 OUTDIRS += fftools/textformat
 OUTDIRS += fftools/resources
+OUTDIRS += fftools/graph
 
 ifdef AVPROGS
 install: install-progs install-data
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 24d43e6197..27f84a1ac

[FFmpeg-devel] [PATCH v12 08/15] fftools/tf_internal: Use av_default_item_name

2025-05-07 Thread softworkz
From: softworkz 

Reviewed-by: Stefano Sabatini 
Signed-off-by: softworkz 
---
 fftools/textformat/tf_internal.h | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/fftools/textformat/tf_internal.h b/fftools/textformat/tf_internal.h
index 362a4cbc38..484886b7a7 100644
--- a/fftools/textformat/tf_internal.h
+++ b/fftools/textformat/tf_internal.h
@@ -29,13 +29,9 @@
 #include "avtextformat.h"
 
 #define DEFINE_FORMATTER_CLASS(name)\
-static const char *name##_get_name(void *ctx)   \
-{   \
-return #name ;  \
-}   \
 static const AVClass name##_class = {   \
 .class_name = #name,\
-.item_name  = name##_get_name,  \
+.item_name  = av_default_item_name, \
 .option = name##_options\
 }
 
-- 
ffmpeg-codebot

___
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 v12 07/15] fftools/textformat: Introduce common header and deduplicate code

2025-05-07 Thread softworkz
From: softworkz 

Also change writer_printf signature in AVTextWriter to use va_list,
so that it can be called by the new function writer_printf()
in tf_internal.h.

Reviewed-by: Stefano Sabatini 
Signed-off-by: softworkz 
---
 fftools/textformat/avtextwriters.h |  2 +-
 fftools/textformat/tf_compact.c| 32 ---
 fftools/textformat/tf_default.c| 27 +++---
 fftools/textformat/tf_flat.c   | 25 +++--
 fftools/textformat/tf_ini.c| 24 +++--
 fftools/textformat/tf_internal.h   | 85 ++
 fftools/textformat/tf_json.c   | 43 +++
 fftools/textformat/tf_xml.c| 35 +---
 fftools/textformat/tw_avio.c   |  9 ++--
 fftools/textformat/tw_buffer.c |  9 ++--
 fftools/textformat/tw_stdout.c | 10 ++--
 11 files changed, 160 insertions(+), 141 deletions(-)
 create mode 100644 fftools/textformat/tf_internal.h

diff --git a/fftools/textformat/avtextwriters.h 
b/fftools/textformat/avtextwriters.h
index fd5cda04ef..9297babeb1 100644
--- a/fftools/textformat/avtextwriters.h
+++ b/fftools/textformat/avtextwriters.h
@@ -36,7 +36,7 @@ typedef struct AVTextWriter {
 void (*uninit)(AVTextWriterContext *wctx);
 void (*writer_w8)(AVTextWriterContext *wctx, int b);
 void (*writer_put_str)(AVTextWriterContext *wctx, const char *str);
-void (*writer_printf)(AVTextWriterContext *wctx, const char *fmt, ...);
+void (*writer_vprintf)(AVTextWriterContext *wctx, const char *fmt, va_list 
vl);
 } AVTextWriter;
 
 typedef struct AVTextWriterContext {
diff --git a/fftools/textformat/tf_compact.c b/fftools/textformat/tf_compact.c
index dae8b3de6a..c6311b5dea 100644
--- a/fftools/textformat/tf_compact.c
+++ b/fftools/textformat/tf_compact.c
@@ -28,23 +28,7 @@
 #include "libavutil/bprint.h"
 #include "libavutil/error.h"
 #include "libavutil/opt.h"
-
-
-#define writer_w8(wctx_, b_) 
(wctx_)->writer->writer->writer_w8((wctx_)->writer, b_)
-#define writer_put_str(wctx_, str_) 
(wctx_)->writer->writer->writer_put_str((wctx_)->writer, str_)
-#define writer_printf(wctx_, fmt_, ...) 
(wctx_)->writer->writer->writer_printf((wctx_)->writer, fmt_, __VA_ARGS__)
-
-
-#define DEFINE_FORMATTER_CLASS(name)   \
-static const char *name##_get_name(void *ctx)   \
-{   \
-return #name ;  \
-}   \
-static const AVClass name##_class = {   \
-.class_name = #name,\
-.item_name  = name##_get_name,  \
-.option = name##_options\
-}
+#include "tf_internal.h"
 
 
 /* Compact output */
@@ -157,9 +141,12 @@ static av_cold int compact_init(AVTextFormatContext *wctx)
 static void compact_print_section_header(AVTextFormatContext *wctx, const void 
*data)
 {
 CompactContext *compact = wctx->priv;
-const struct AVTextFormatSection *section = wctx->section[wctx->level];
-const struct AVTextFormatSection *parent_section = wctx->level ?
-wctx->section[wctx->level-1] : NULL;
+const AVTextFormatSection *section = tf_get_section(wctx, wctx->level);
+const AVTextFormatSection *parent_section = tf_get_parent_section(wctx, 
wctx->level);
+
+if (!section)
+return;
+
 compact->terminate_line[wctx->level] = 1;
 compact->has_nested_elems[wctx->level] = 0;
 
@@ -208,8 +195,11 @@ static void 
compact_print_section_header(AVTextFormatContext *wctx, const void *
 
 static void compact_print_section_footer(AVTextFormatContext *wctx)
 {
-const struct AVTextFormatSection *section = wctx->section[wctx->level];
 CompactContext *compact = wctx->priv;
+const AVTextFormatSection *section = tf_get_section(wctx, wctx->level);
+
+if (!section)
+return;
 
 if (!compact->nested_section[wctx->level] &&
 compact->terminate_line[wctx->level] &&
diff --git a/fftools/textformat/tf_default.c b/fftools/textformat/tf_default.c
index ad97173b0b..019bda9d44 100644
--- a/fftools/textformat/tf_default.c
+++ b/fftools/textformat/tf_default.c
@@ -27,21 +27,7 @@
 #include "avtextformat.h"
 #include "libavutil/bprint.h"
 #include "libavutil/opt.h"
-
-#define writer_w8(wctx_, b_) 
(wctx_)->writer->writer->writer_w8((wctx_)->writer, b_)
-#define writer_put_str(wctx_, str_) 
(wctx_)->writer->writer->writer_put_str((wctx_)->writer, str_)
-#define writer_printf(wctx_, fmt_, ...) 
(wctx_)->writer->writer->writer_printf((wctx_)->writer, fmt_, __VA_ARGS__)
-
-#define DEFINE_FORMATTER_CLASS(name)   \
-static const char *name##_get_name(void *ctx)   \
-{   \
-return #name ;  \
-}   \
-static const AVClass name##_class = {   \
-.class_name = #name,\
-.item_name  = name##_get_name,  \

[FFmpeg-devel] [PATCH v12 10/15] fftools/ffmpeg_filter: Move some declaration to new header file

2025-05-07 Thread softworkz
From: softworkz 

to allow filtergraph printing to access the information.

Signed-off-by: softworkz 
---
 fftools/ffmpeg_filter.c | 190 +---
 fftools/ffmpeg_filter.h | 234 
 2 files changed, 235 insertions(+), 189 deletions(-)
 create mode 100644 fftools/ffmpeg_filter.h

diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index d314aec206..eab9487f97 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -21,6 +21,7 @@
 #include 
 
 #include "ffmpeg.h"
+#include "ffmpeg_filter.h"
 
 #include "libavfilter/avfilter.h"
 #include "libavfilter/buffersink.h"
@@ -42,44 +43,6 @@
 // FIXME private header, used for mid_pred()
 #include "libavcodec/mathops.h"
 
-typedef struct FilterGraphPriv {
-FilterGraph  fg;
-
-// name used for logging
-char log_name[32];
-
-int  is_simple;
-// true when the filtergraph contains only meta filters
-// that do not modify the frame data
-int  is_meta;
-// source filters are present in the graph
-int  have_sources;
-int  disable_conversions;
-
-unsigned nb_outputs_done;
-
-const char  *graph_desc;
-
-int  nb_threads;
-
-// frame for temporarily holding output from the filtergraph
-AVFrame *frame;
-// frame for sending output to the encoder
-AVFrame *frame_enc;
-
-Scheduler   *sch;
-unsigned sch_idx;
-} FilterGraphPriv;
-
-static FilterGraphPriv *fgp_from_fg(FilterGraph *fg)
-{
-return (FilterGraphPriv*)fg;
-}
-
-static const FilterGraphPriv *cfgp_from_cfg(const FilterGraph *fg)
-{
-return (const FilterGraphPriv*)fg;
-}
 
 // data that is local to the filter thread and not visible outside of it
 typedef struct FilterGraphThread {
@@ -102,157 +65,6 @@ typedef struct FilterGraphThread {
 uint8_t *eof_out;
 } FilterGraphThread;
 
-typedef struct InputFilterPriv {
-InputFilter ifilter;
-
-InputFilterOptions  opts;
-
-int index;
-
-AVFilterContext*filter;
-
-// used to hold submitted input
-AVFrame*frame;
-
-/* for filters that are not yet bound to an input stream,
- * this stores the input linklabel, if any */
-uint8_t*linklabel;
-
-// filter data type
-enum AVMediaTypetype;
-// source data type: AVMEDIA_TYPE_SUBTITLE for sub2video,
-// same as type otherwise
-enum AVMediaTypetype_src;
-
-int eof;
-int bound;
-int drop_warned;
-uint64_tnb_dropped;
-
-// parameters configured for this input
-int format;
-
-int width, height;
-AVRational  sample_aspect_ratio;
-enum AVColorSpace   color_space;
-enum AVColorRange   color_range;
-
-int sample_rate;
-AVChannelLayout ch_layout;
-
-AVRational  time_base;
-
-AVFrameSideData   **side_data;
-int nb_side_data;
-
-AVFifo *frame_queue;
-
-AVBufferRef*hw_frames_ctx;
-
-int displaymatrix_present;
-int displaymatrix_applied;
-int32_t displaymatrix[9];
-
-int downmixinfo_present;
-AVDownmixInfo   downmixinfo;
-
-struct {
-AVFrame *frame;
-
-int64_t last_pts;
-int64_t end_pts;
-
-/// marks if sub2video_update should force an initialization
-unsigned int initialize;
-} sub2video;
-} InputFilterPriv;
-
-static InputFilterPriv *ifp_from_ifilter(InputFilter *ifilter)
-{
-return (InputFilterPriv*)ifilter;
-}
-
-typedef struct FPSConvContext {
-AVFrame  *last_frame;
-/* number of frames emitted by the video-encoding sync code */
-int64_t   frame_number;
-/* history of nb_frames_prev, i.e. the number of times the
- * previous frame was duplicated by vsync code in recent
- * do_video_out() calls */
-int64_t   frames_prev_hist[3];
-
-uint64_t  dup_warning;
-
-int   last_dropped;
-int   dropped_keyframe;
-
-enum VideoSyncMethod vsync_method;
-
-AVRationalframerate;
-AVRationalframerate_max;
-const AVRational *framerate_supported;
-int   framerate_clip;
-} FPSConvContext;
-
-typedef struct OutputFilterPriv {
-OutputFilterofilter;
-
-int index;
-
-void   *log_parent;
-charlog_name[32];
-
-char   *name;
-
-AVFilterContext*filter;
-
-/* desired output stream properties */
-int format;
-int width, height;
-int sample_rate;
-AVChannelLayout ch_layout;
-   

[FFmpeg-devel] [PATCH v12 11/15] avfilter/avfilter: Add avfilter_link_get_hw_frames_ctx()

2025-05-07 Thread softworkz
From: softworkz 

Signed-off-by: softworkz 
---
 doc/APIchanges |  3 +++
 libavfilter/avfilter.c |  9 +
 libavfilter/avfilter.h | 12 
 3 files changed, 24 insertions(+)

diff --git a/doc/APIchanges b/doc/APIchanges
index 75d66f87f3..d0869561f3 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2025-03-28
 
 API changes, most recent first:
 
+2025-02-xx - xx - lavfi 10.10.100 - avfilter.h
+  Add avfilter_link_get_hw_frames_ctx().
+
 2025-04-21 - xx - lavu 60.2.100 - log.h
   Add AV_CLASS_CATEGORY_HWDEVICE.
 
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 64c1075c40..c76d43a215 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -989,6 +989,15 @@ enum AVMediaType avfilter_pad_get_type(const AVFilterPad 
*pads, int pad_idx)
 return pads[pad_idx].type;
 }
 
+AVBufferRef *avfilter_link_get_hw_frames_ctx(AVFilterLink *link)
+{
+FilterLink *plink = ff_filter_link(link);
+if (plink->hw_frames_ctx)
+return av_buffer_ref(plink->hw_frames_ctx);
+
+return NULL;
+}
+
 static int default_filter_frame(AVFilterLink *link, AVFrame *frame)
 {
 return ff_filter_frame(link->dst->outputs[0], frame);
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index a89d3cf658..f85929dc5c 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -96,6 +96,18 @@ const char *avfilter_pad_get_name(const AVFilterPad *pads, 
int pad_idx);
  */
 enum AVMediaType avfilter_pad_get_type(const AVFilterPad *pads, int pad_idx);
 
+/**
+ * Get the hardware frames context of a filter link.
+ *
+ * @param link an AVFilterLink
+ *
+ * @return a ref-counted copy of the link's hw_frames_ctx field if there is
+ * a hardware frames context associated with the link or NULL 
otherwise.
+ * The returned AVBufferRef needs to be released with av_buffer_unref()
+ * when it is no longer used.
+ */
+AVBufferRef* avfilter_link_get_hw_frames_ctx(AVFilterLink *link);
+
 /**
  * Lists of formats / etc. supported by an end of a link.
  *
-- 
ffmpeg-codebot

___
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 v12 04/15] fftools/textformat: Rename name param to key for API consistency

2025-05-07 Thread softworkz
From: softworkz 

Reviewed-by: Stefano Sabatini 
Signed-off-by: softworkz 
---
 fftools/textformat/avtextformat.c | 14 +++---
 fftools/textformat/avtextformat.h |  6 +++---
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/fftools/textformat/avtextformat.c 
b/fftools/textformat/avtextformat.c
index 1edf24d956..8ee7472f1b 100644
--- a/fftools/textformat/avtextformat.c
+++ b/fftools/textformat/avtextformat.c
@@ -507,7 +507,7 @@ void avtext_print_ts(AVTextFormatContext *tctx, const char 
*key, int64_t ts, int
 avtext_print_integer(tctx, key, ts);
 }
 
-void avtext_print_data(AVTextFormatContext *tctx, const char *name,
+void avtext_print_data(AVTextFormatContext *tctx, const char *key,
const uint8_t *data, int size)
 {
 AVBPrint bp;
@@ -532,11 +532,11 @@ void avtext_print_data(AVTextFormatContext *tctx, const 
char *name,
 data   += l;
 size   -= l;
 }
-avtext_print_string(tctx, name, bp.str, 0);
+avtext_print_string(tctx, key, bp.str, 0);
 av_bprint_finalize(&bp, NULL);
 }
 
-void avtext_print_data_hash(AVTextFormatContext *tctx, const char *name,
+void avtext_print_data_hash(AVTextFormatContext *tctx, const char *key,
 const uint8_t *data, int size)
 {
 char buf[AV_HASH_MAX_SIZE * 2 + 64] = { 0 };
@@ -549,10 +549,10 @@ void avtext_print_data_hash(AVTextFormatContext *tctx, 
const char *name,
 av_hash_update(tctx->hash, data, size);
 len = snprintf(buf, sizeof(buf), "%s:", av_hash_get_name(tctx->hash));
 av_hash_final_hex(tctx->hash, (uint8_t *)&buf[len], (int)sizeof(buf) - 
len);
-avtext_print_string(tctx, name, buf, 0);
+avtext_print_string(tctx, key, buf, 0);
 }
 
-void avtext_print_integers(AVTextFormatContext *tctx, const char *name,
+void avtext_print_integers(AVTextFormatContext *tctx, const char *key,
uint8_t *data, int size, const char *format,
int columns, int bytes, int offset_add)
 {
@@ -560,7 +560,7 @@ void avtext_print_integers(AVTextFormatContext *tctx, const 
char *name,
 unsigned offset = 0;
 int l, i;
 
-if (!name || !data || !format || columns <= 0 || bytes <= 0)
+if (!key || !data || !format || columns <= 0 || bytes <= 0)
 return;
 
 av_bprint_init(&bp, 0, AV_BPRINT_SIZE_UNLIMITED);
@@ -578,7 +578,7 @@ void avtext_print_integers(AVTextFormatContext *tctx, const 
char *name,
 av_bprintf(&bp, "\n");
 offset += offset_add;
 }
-avtext_print_string(tctx, name, bp.str, 0);
+avtext_print_string(tctx, key, bp.str, 0);
 av_bprint_finalize(&bp, NULL);
 }
 
diff --git a/fftools/textformat/avtextformat.h 
b/fftools/textformat/avtextformat.h
index c61dca159f..8ff503401a 100644
--- a/fftools/textformat/avtextformat.h
+++ b/fftools/textformat/avtextformat.h
@@ -148,11 +148,11 @@ void avtext_print_time(AVTextFormatContext *tctx, const 
char *key, int64_t ts, c
 
 void avtext_print_ts(AVTextFormatContext *tctx, const char *key, int64_t ts, 
int is_duration);
 
-void avtext_print_data(AVTextFormatContext *tctx, const char *name, const 
uint8_t *data, int size);
+void avtext_print_data(AVTextFormatContext *tctx, const char *key, const 
uint8_t *data, int size);
 
-void avtext_print_data_hash(AVTextFormatContext *tctx, const char *name, const 
uint8_t *data, int size);
+void avtext_print_data_hash(AVTextFormatContext *tctx, const char *key, const 
uint8_t *data, int size);
 
-void avtext_print_integers(AVTextFormatContext *tctx, const char *name, 
uint8_t *data, int size,
+void avtext_print_integers(AVTextFormatContext *tctx, const char *key, uint8_t 
*data, int size,
const char *format, int columns, int bytes, int 
offset_add);
 
 const AVTextFormatter *avtext_get_formatter_by_name(const char *name);
-- 
ffmpeg-codebot

___
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 v12 06/15] fftools/textformat: Introduce AVTextFormatOptions for avtext_context_open()

2025-05-07 Thread softworkz
From: softworkz 

This allows future addition of options without
changes to the signature of avtext_context_open().

Reviewed-by: Stefano Sabatini 
Signed-off-by: softworkz 
---
 fftools/ffprobe.c | 13 +
 fftools/textformat/avtextformat.c | 18 ++
 fftools/textformat/avtextformat.h | 16 +---
 3 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index f33531fd84..cb8b5e17f9 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3167,10 +3167,15 @@ int main(int argc, char **argv)
 if (ret < 0)
 goto end;
 
-if ((ret = avtext_context_open(&tctx, f, wctx, f_args,
-   sections, FF_ARRAY_ELEMS(sections), show_value_unit,
-use_value_prefix, use_byte_value_binary_prefix, 
use_value_sexagesimal_format,
-show_optional_fields, show_data_hash)) >= 0) {
+AVTextFormatOptions tf_options = {
+.show_optional_fields = show_optional_fields,
+.show_value_unit = show_value_unit,
+.use_value_prefix = use_value_prefix,
+.use_byte_value_binary_prefix = use_byte_value_binary_prefix,
+.use_value_sexagesimal_format = use_value_sexagesimal_format,
+};
+
+if ((ret = avtext_context_open(&tctx, f, wctx, f_args, sections, 
FF_ARRAY_ELEMS(sections), tf_options, show_data_hash)) >= 0) {
 if (f == &avtextformatter_xml)
 tctx->string_validation_utf8_flags |= 
AV_UTF8_FLAG_EXCLUDE_XML_INVALID_CONTROL_CODES;
 
diff --git a/fftools/textformat/avtextformat.c 
b/fftools/textformat/avtextformat.c
index ec167e3bf1..dd595f15ba 100644
--- a/fftools/textformat/avtextformat.c
+++ b/fftools/textformat/avtextformat.c
@@ -125,13 +125,7 @@ void avtext_context_close(AVTextFormatContext **ptctx)
 
 
 int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter 
*formatter, AVTextWriterContext *writer_context, const char *args,
-const AVTextFormatSection *sections, int nb_sections,
-int show_value_unit,
-int use_value_prefix,
-int use_byte_value_binary_prefix,
-int use_value_sexagesimal_format,
-int show_optional_fields,
-char *show_data_hash)
+const AVTextFormatSection *sections, int nb_sections, 
AVTextFormatOptions options, char *show_data_hash)
 {
 AVTextFormatContext *tctx;
 int i, ret = 0;
@@ -154,11 +148,11 @@ int avtext_context_open(AVTextFormatContext **ptctx, 
const AVTextFormatter *form
 goto fail;
 }
 
-tctx->show_value_unit = show_value_unit;
-tctx->use_value_prefix = use_value_prefix;
-tctx->use_byte_value_binary_prefix = use_byte_value_binary_prefix;
-tctx->use_value_sexagesimal_format = use_value_sexagesimal_format;
-tctx->show_optional_fields = show_optional_fields;
+tctx->show_value_unit = options.show_value_unit;
+tctx->use_value_prefix = options.use_value_prefix;
+tctx->use_byte_value_binary_prefix = options.use_byte_value_binary_prefix;
+tctx->use_value_sexagesimal_format = options.use_value_sexagesimal_format;
+tctx->show_optional_fields = options.show_optional_fields;
 
 if (nb_sections > SECTION_MAX_NB_SECTIONS) {
 av_log(tctx, AV_LOG_ERROR, "The number of section definitions (%d) is 
larger than the maximum allowed (%d)\n", nb_sections, SECTION_MAX_NB_SECTIONS);
diff --git a/fftools/textformat/avtextformat.h 
b/fftools/textformat/avtextformat.h
index 8ff503401a..87f57d8c24 100644
--- a/fftools/textformat/avtextformat.h
+++ b/fftools/textformat/avtextformat.h
@@ -117,17 +117,19 @@ struct AVTextFormatContext {
 unsigned int string_validation_utf8_flags;
 };
 
+typedef struct AVTextFormatOptions {
+int show_optional_fields;
+int show_value_unit;
+int use_value_prefix;
+int use_byte_value_binary_prefix;
+int use_value_sexagesimal_format;
+} AVTextFormatOptions;
+
 #define AV_TEXTFORMAT_PRINT_STRING_OPTIONAL 1
 #define AV_TEXTFORMAT_PRINT_STRING_VALIDATE 2
 
 int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter 
*formatter, AVTextWriterContext *writer_context, const char *args,
-const AVTextFormatSection *sections, int nb_sections,
-int show_value_unit,
-int use_value_prefix,
-int use_byte_value_binary_prefix,
-int use_value_sexagesimal_format,
-int show_optional_fields,
-char *show_data_hash);
+const AVTextFormatSection *sections, int nb_sections, 
AVTextFormatOptions options, char *show_data_hash);
 
 void avtext_context_close(AVTextFormatContext **tctx);
 
-- 
ffmpeg-codebot

___
ffmpeg-devel mailing list
ffmpeg-dev

[FFmpeg-devel] [PATCH v12 09/15] fftools/textformat: Add flags param to function avtext_print_integer()

2025-05-07 Thread softworkz
From: softworkz 

Make this function work analog to avtext_print_string() which already
has a flags parameter.

Signed-off-by: softworkz 
---
 fftools/ffprobe.c |  2 +-
 fftools/textformat/avtextformat.c | 24 ++--
 fftools/textformat/avtextformat.h |  2 +-
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index cb8b5e17f9..eb55083a1e 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -420,7 +420,7 @@ static void log_callback(void *ptr, int level, const char 
*fmt, va_list vl)
 avtext_print_string(tfc, k, pbuf.str, 0); \
 } while (0)
 
-#define print_int(k, v) avtext_print_integer(tfc, k, v)
+#define print_int(k, v) avtext_print_integer(tfc, k, v, 0)
 #define print_q(k, v, s)avtext_print_rational(tfc, k, v, s)
 #define print_str(k, v) avtext_print_string(tfc, k, v, 0)
 #define print_str_opt(k, v) avtext_print_string(tfc, k, v, 
AV_TEXTFORMAT_PRINT_STRING_OPTIONAL)
diff --git a/fftools/textformat/avtextformat.c 
b/fftools/textformat/avtextformat.c
index dd595f15ba..7c73089bfd 100644
--- a/fftools/textformat/avtextformat.c
+++ b/fftools/textformat/avtextformat.c
@@ -289,10 +289,20 @@ void avtext_print_section_footer(AVTextFormatContext 
*tctx)
 tctx->level--;
 }
 
-void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t 
val)
+void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t 
val, int flags)
 {
 const AVTextFormatSection *section;
 
+av_assert0(tctx);
+
+if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_NEVER)
+return;
+
+if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO
+&& (flags & AV_TEXTFORMAT_PRINT_STRING_OPTIONAL)
+&& !(tctx->formatter->flags & 
AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS))
+return;
+
 av_assert0(key && tctx->level >= 0 && tctx->level < SECTION_MAX_NB_LEVELS);
 
 section = tctx->section[tctx->level];
@@ -444,10 +454,12 @@ int avtext_print_string(AVTextFormatContext *tctx, const 
char *key, const char *
 
 section = tctx->section[tctx->level];
 
-if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_NEVER ||
-(tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO
-&& (flags & AV_TEXTFORMAT_PRINT_STRING_OPTIONAL)
-&& !(tctx->formatter->flags & 
AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS)))
+if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_NEVER)
+return 0;
+
+if (tctx->show_optional_fields == SHOW_OPTIONAL_FIELDS_AUTO
+&& (flags & AV_TEXTFORMAT_PRINT_STRING_OPTIONAL)
+&& !(tctx->formatter->flags & 
AV_TEXTFORMAT_FLAG_SUPPORTS_OPTIONAL_FIELDS))
 return 0;
 
 if (section->show_all_entries || av_dict_get(section->entries_to_show, 
key, NULL, 0)) {
@@ -503,7 +515,7 @@ void avtext_print_ts(AVTextFormatContext *tctx, const char 
*key, int64_t ts, int
 if ((!is_duration && ts == AV_NOPTS_VALUE) || (is_duration && ts == 0))
 avtext_print_string(tctx, key, "N/A", 
AV_TEXTFORMAT_PRINT_STRING_OPTIONAL);
 else
-avtext_print_integer(tctx, key, ts);
+avtext_print_integer(tctx, key, ts, 0);
 }
 
 void avtext_print_data(AVTextFormatContext *tctx, const char *key,
diff --git a/fftools/textformat/avtextformat.h 
b/fftools/textformat/avtextformat.h
index 87f57d8c24..8f406de322 100644
--- a/fftools/textformat/avtextformat.h
+++ b/fftools/textformat/avtextformat.h
@@ -138,7 +138,7 @@ void avtext_print_section_header(AVTextFormatContext *tctx, 
const void *data, in
 
 void avtext_print_section_footer(AVTextFormatContext *tctx);
 
-void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t 
val);
+void avtext_print_integer(AVTextFormatContext *tctx, const char *key, int64_t 
val, int flags);
 
 int avtext_print_string(AVTextFormatContext *tctx, const char *key, const char 
*val, int flags);
 
-- 
ffmpeg-codebot

___
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 v12 05/15] fftools/avtextformat: Re-use BPrint in loop

2025-05-07 Thread softworkz
From: softworkz 

Instead of initializing a new BPrint in case of UTF decode error,
re-use the same BPrint struct and just clear it
for each iteration.

Reviewed-by: Stefano Sabatini 
Signed-off-by: softworkz 
---
 fftools/textformat/avtextformat.c | 23 ++-
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/fftools/textformat/avtextformat.c 
b/fftools/textformat/avtextformat.c
index 8ee7472f1b..ec167e3bf1 100644
--- a/fftools/textformat/avtextformat.c
+++ b/fftools/textformat/avtextformat.c
@@ -311,24 +311,28 @@ void avtext_print_integer(AVTextFormatContext *tctx, 
const char *key, int64_t va
 
 static inline int validate_string(AVTextFormatContext *tctx, char **dstp, 
const char *src)
 {
-const uint8_t *p, *endp;
+const uint8_t *p, *endp, *srcp = (const uint8_t *)src;
 AVBPrint dstbuf;
+AVBPrint invalid_seq;
 int invalid_chars_nb = 0, ret = 0;
 
+*dstp = NULL;
 av_bprint_init(&dstbuf, 0, AV_BPRINT_SIZE_UNLIMITED);
+av_bprint_init(&invalid_seq, 0, AV_BPRINT_SIZE_UNLIMITED);
 
-endp = src + strlen(src);
-for (p = src; *p;) {
-uint32_t code;
+endp = srcp + strlen(src);
+for (p = srcp; *p;) {
+int32_t code;
 int invalid = 0;
 const uint8_t *p0 = p;
 
 if (av_utf8_decode(&code, &p, endp, 
tctx->string_validation_utf8_flags) < 0) {
-AVBPrint bp;
-av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
-bprint_bytes(&bp, p0, p-p0);
-av_log(tctx, AV_LOG_DEBUG,
-   "Invalid UTF-8 sequence %s found in string '%s'\n", bp.str, 
src);
+
+av_bprint_clear(&invalid_seq);
+
+bprint_bytes(&invalid_seq, p0, p - p0);
+
+av_log(tctx, AV_LOG_DEBUG, "Invalid UTF-8 sequence '%s' found in 
string '%s'\n", invalid_seq.str, src);
 invalid = 1;
 }
 
@@ -358,6 +362,7 @@ static inline int validate_string(AVTextFormatContext 
*tctx, char **dstp, const
 
 end:
 av_bprint_finalize(&dstbuf, dstp);
+av_bprint_finalize(&invalid_seq, NULL);
 return ret;
 }
 
-- 
ffmpeg-codebot

___
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 v12 12/15] fftools/resources: Add resource manager files with build-time compression

2025-05-07 Thread softworkz
From: softworkz 

Compression requires zlib to be available, otherwise resources will
be included uncompressed - in either case via BIN2C.

It can also be disabled via

./configure --disable-resource-compression

Size figures:

graph.css 7752
graph.css.min 6655 (css is always minified)
graph.html2153

No Compression

graph.css.c  40026
graph.css.o   9344 (6688)
graph.html.c 13016
graph.html.o  4848 (2186)

With Compression

graph.css.c  10206
graph.css.o   4368 (1718)
graph.html.c  5725
graph.html.o  3632 (971)

Numbers in brackets: .rodata size from 'size -Ax -d *.o'

Signed-off-by: softworkz 
---
 configure|   5 +
 ffbuild/common.mak   |  43 -
 fftools/Makefile |   3 +-
 fftools/resources/.gitignore |   4 +
 fftools/resources/Makefile   |  13 ++
 fftools/resources/graph.css  | 353 +++
 fftools/resources/graph.html |  86 +
 fftools/resources/resman.c   | 231 +++
 fftools/resources/resman.h   |  50 +
 9 files changed, 785 insertions(+), 3 deletions(-)
 create mode 100644 fftools/resources/.gitignore
 create mode 100644 fftools/resources/Makefile
 create mode 100644 fftools/resources/graph.css
 create mode 100644 fftools/resources/graph.html
 create mode 100644 fftools/resources/resman.c
 create mode 100644 fftools/resources/resman.h

diff --git a/configure b/configure
index 2e69b3c56c..0609dac4ab 100755
--- a/configure
+++ b/configure
@@ -523,6 +523,7 @@ Developer options (useful when working on FFmpeg itself):
   --enable-macos-kperf enable macOS kperf (private) API
   --disable-large-testsdisable tests that use a large amount of memory
   --disable-ptx-compression don't compress CUDA PTX code even when possible
+  --disable-resource-compression don't compress resources even when possible
   --disable-version-tracking don't include the git/release version in the build
 
 NOTE: Object files are built at the place where configure is launched.
@@ -2123,6 +2124,7 @@ CONFIG_LIST="
 ossfuzz
 pic
 ptx_compression
+resource_compression
 thumb
 valgrind_backtrace
 xmm_clobber_test
@@ -4179,6 +4181,7 @@ enable iamf
 enable large_tests
 enable optimizations
 enable ptx_compression
+enable resource_compression
 enable runtime_cpudetect
 enable safe_bitstream_reader
 enable static
@@ -6904,6 +6907,8 @@ EOF
 
 enabled zlib_gzip && enabled gzip || disable ptx_compression
 
+enabled zlib_gzip && enabled gzip || disable resource_compression
+
 # On some systems dynamic loading requires no extra linker flags
 check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen 
dlsym" -ldl
 
diff --git a/ffbuild/common.mak b/ffbuild/common.mak
index ca45a0f368..0e1eb1f62b 100644
--- a/ffbuild/common.mak
+++ b/ffbuild/common.mak
@@ -139,6 +139,44 @@ else
$(BIN2C) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $@ $(subst 
.,_,$(basename $(notdir $@)))
 endif
 
+# 1) Preprocess CSS to a minified version
+%.css.min: %.css
+   # Must start with a tab in the real Makefile
+   sed 's!/\\*.*\\*/!!g' $< \
+   | tr '\n' ' ' \
+   | tr -s ' ' \
+   | sed 's/^ //; s/ $$//' \
+   > $@
+
+ifdef CONFIG_RESOURCE_COMPRESSION
+
+# 2) Gzip the minified CSS
+%.css.min.gz: %.css.min
+   $(M)gzip -nc9 $< > $@
+
+# 3) Convert the gzipped CSS to a .c array
+%.css.c: %.css.min.gz $(BIN2CEXE)
+   $(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
+
+# 4) Gzip the HTML file (no minification needed)
+%.html.gz: %.html
+   $(M)gzip -nc9 $< > $@
+
+# 5) Convert the gzipped HTML to a .c array
+%.html.c: %.html.gz $(BIN2CEXE)
+   $(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
+
+else   # NO COMPRESSION
+
+# 2) Convert the minified CSS to a .c array
+%.css.c: %.css.min $(BIN2CEXE)
+   $(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
+
+# 3) Convert the plain HTML to a .c array
+%.html.c: %.html $(BIN2CEXE)
+   $(BIN2C) $< $@ $(subst .,_,$(basename $(notdir $@)))
+endif
+
 clean::
$(RM) $(BIN2CEXE) $(CLEANSUFFIXES:%=ffbuild/%)
 
@@ -191,9 +229,10 @@ SKIPHEADERS += $(ARCH_HEADERS:%=$(ARCH)/%) $(SKIPHEADERS-)
 SKIPHEADERS := $(SKIPHEADERS:%=$(SUBDIR)%)
 HOBJS= $(filter-out $(SKIPHEADERS:.h=.h.o),$(ALLHEADERS:.h=.h.o))
 PTXOBJS  = $(filter %.ptx.o,$(OBJS))
+RESOURCEOBJS = $(filter %.css.o %.html.o,$(OBJS))
 $(HOBJS): CCFLAGS += $(CFLAGS_HEADERS)
 checkheaders: $(HOBJS)
-.SECONDARY:   $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=)
+.SECONDARY:   $(HOBJS:.o=.c) $(PTXOBJS:.o=.c) $(PTXOBJS:.o=.gz) $(PTXOBJS:.o=) 
$(RESOURCEOBJS:.o=.c) $(RESOURCEOBJS:%.css.o=%.css.min) 
$(RESOURCEOBJS:%.css.o=%.css.min.gz) $(RESOURCEOBJS:%.html.o=%.html.gz) 
$(RESOURCEOBJS:.o=)
 
 alltools: $(TOOLS)
 
@@ -214,7 +253,7 @@ $(TOOLOBJS): | tools
 
 OUTDIRS := $(OUTDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) 
$(SHLIBOBJS) $(STLIBOBJS) $(TESTOBJS))
 
-CLEANSUFFIXES = *.d *

[FFmpeg-devel] [PATCH v12 15/15] fftools/graphprint: Now, make it a Killer-Feature!

2025-05-07 Thread softworkz
From: softworkz 

remember this: -sg   <= means Show Graph

Signed-off-by: softworkz 
---
 doc/ffmpeg.texi  |   4 +
 fftools/Makefile |   1 +
 fftools/ffmpeg.c |   2 +-
 fftools/ffmpeg.h |   1 +
 fftools/ffmpeg_filter.c  |   2 +-
 fftools/ffmpeg_opt.c |   4 +
 fftools/graph/filelauncher.c | 205 +++
 fftools/graph/graphprint.c   |  48 +++-
 fftools/graph/graphprint.h   |  32 ++
 9 files changed, 296 insertions(+), 3 deletions(-)
 create mode 100644 fftools/graph/filelauncher.c

diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
index 35675b5309..6e9e7aed0e 100644
--- a/doc/ffmpeg.texi
+++ b/doc/ffmpeg.texi
@@ -1404,6 +1404,10 @@ Writes execution graph details to the specified file in 
the format set via -prin
 Sets the output format (available formats are: default, compact, csv, flat, 
ini, json, xml, mermaid, mermaidhtml)
 The default format is json.
 
+@item -sg (@emph{global})
+Writes the execution graph to a temporary html file (mermaidhtml format) and 
+tries to launch it in the default browser.
+
 @item -progress @var{url} (@emph{global})
 Send program-friendly progress information to @var{url}.
 
diff --git a/fftools/Makefile b/fftools/Makefile
index 361a4fd574..56a2910212 100644
--- a/fftools/Makefile
+++ b/fftools/Makefile
@@ -22,6 +22,7 @@ OBJS-ffmpeg +=  \
 fftools/ffmpeg_opt.o\
 fftools/ffmpeg_sched.o  \
 fftools/graph/graphprint.o\
+fftools/graph/filelauncher.o  \
 fftools/sync_queue.o\
 fftools/thread_queue.o  \
 fftools/textformat/avtextformat.o \
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 27f84a1ace..037fd253c6 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -309,7 +309,7 @@ const AVIOInterruptCB int_cb = { decode_interrupt_cb, NULL 
};
 
 static void ffmpeg_cleanup(int ret)
 {
-if (print_graphs || print_graphs_file)
+if (print_graphs || print_graphs_file || show_graph)
 print_filtergraphs(filtergraphs, nb_filtergraphs, input_files, 
nb_input_files, output_files, nb_output_files);
 
 if (do_benchmark) {
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 7fbf0ad532..49fea0307d 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -721,6 +721,7 @@ extern int print_graphs;
 extern char *print_graphs_file;
 extern char *print_graphs_format;
 extern int auto_conversion_filters;
+extern int show_graph;
 
 extern const AVIOInterruptCB int_cb;
 
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index b774606562..e82e333b7f 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -2985,7 +2985,7 @@ read_frames:
 
 finish:
 
-if (print_graphs || print_graphs_file)
+if (print_graphs || print_graphs_file || show_graph)
 print_filtergraph(fg, fgt.graph);
 
 // EOF is normal termination
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 3d1efe32f9..24713d640f 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -79,6 +79,7 @@ int vstats_version = 2;
 int print_graphs = 0;
 char *print_graphs_file = NULL;
 char *print_graphs_format = NULL;
+int show_graph = 0;
 int auto_conversion_filters = 1;
 int64_t stats_period = 50;
 
@@ -1748,6 +1749,9 @@ const OptionDef options[] = {
 { "print_graphs_format", OPT_TYPE_STRING, 0,
 { &print_graphs_format },
   "set the output printing format (available formats are: default, 
compact, csv, flat, ini, json, xml, mermaid, mermaidhtml)", "format" },
+{ "sg",   OPT_TYPE_BOOL, 0,
+{ &show_graph },
+"create execution graph as temporary html file and try to launch it in 
the default browser" },
 { "auto_conversion_filters", OPT_TYPE_BOOL, OPT_EXPERT,
 { &auto_conversion_filters },
 "enable automatic conversion filters globally" },
diff --git a/fftools/graph/filelauncher.c b/fftools/graph/filelauncher.c
new file mode 100644
index 00..0cf5f15cf1
--- /dev/null
+++ b/fftools/graph/filelauncher.c
@@ -0,0 +1,205 @@
+/*
+ * Copyright (c) 2025 - softworkz
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include 
+#include 
+#include 
+
+#if defined(_WIN32)
+#  include 
+#  include 
+#else
+#  include 
+#  inclu

[FFmpeg-devel] [PATCH v12 13/15] fftools/ffmpeg_mux: Make ms_from_ost() inline

2025-05-07 Thread softworkz
From: softworkz 

Signed-off-by: softworkz 
---
 fftools/ffmpeg_mux.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg_mux.h b/fftools/ffmpeg_mux.h
index f41f2c18fa..4ca8ab73a4 100644
--- a/fftools/ffmpeg_mux.h
+++ b/fftools/ffmpeg_mux.h
@@ -123,7 +123,7 @@ typedef struct Muxer {
 
 int mux_check_init(void *arg);
 
-static MuxStream *ms_from_ost(OutputStream *ost)
+static inline MuxStream *ms_from_ost(OutputStream *ost)
 {
 return (MuxStream*)ost;
 }
-- 
ffmpeg-codebot

___
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 01/21] avutil/avassert: Add av_unreachable and av_assume() macros

2025-05-07 Thread softworkz .



> -Original Message-
> From: ffmpeg-devel  On Behalf Of Michael
> Niedermayer
> Sent: Donnerstag, 8. Mai 2025 01:22
> To: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [PATCH 01/21] avutil/avassert: Add av_unreachable
> and av_assume() macros
> 
> On Wed, May 07, 2025 at 07:14:04PM +, softworkz . wrote:
> [...]
> > > > > As long as there's no migration to a better way, why not try out
> making
> > > PRs
> > > > to https://github.com/ffstaging/FFmpeg?
> > > >
> > > > I doubt "ffstaging" is affiliated with the project in any capacity.
> > >
> > > Hi James,
> > >
> > > it works like this:
> > >
> > > - You make a PR to https://github.com/ffstaging/FFmpeg
> > > - You make a comment with "/submit"
> > > - The PR will be submitted to the ML as regular patches
> >
> > More specifics:
> >
> > - The PR message is sent as the cover-letter text [Patch 0/n]
> >   Markdown is converted to ASCII
> >
> > - Commit messages are checked for compliance
> >
> > - CI builds are run on the last commit (yet you can submit
> >   without waiting)
> >
> > - To submit new versions of a patchset, simply force-push to
> >   your PR branch and comment "/submit" again.
> >   The patchset will automatically be submitted as a new version
> >   (v2, v3, etc.)
> >
> > - Comments made on the ML are automatically mirrored back as PR
> >   comments on GH
> >
> > - Cover-letters sent to the ML include a range-diff, showing
> >   the changes from the previous version
> >   They also include Git links to directly check out the patchset
> 
> Should this be added to doc/developer.texi ?
> (which shows up as https://ffmpeg.org/developer.html)

It depends on how far or close we are to move away from the
ML, as there can be only one "source of truth", where all patches 
are moving through.
The setup on ffstaging is simply a tool that is useful for submitting
patches to the ML without the trouble (for some like me) of using
git send-email. It will become obsolete as soon as the ML won't be
the central hub for patches anymore.

But for the time being, I can surely propose a paragraph with a 
description similar to the above.
I somehow assumed that most (regulars at least) would already know
what it is and what it does, but from Jame's response I've seen 
that I was a wrong, so yea, let's do this.

Best,
sw


___
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] [RFC] Shaping the AVTextFormat API Surface

2025-05-07 Thread softworkz .



> -Original Message-
> From: Stefano Sabatini 
> Sent: Donnerstag, 8. Mai 2025 01:31
> To: softworkz . 
> Cc: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [RFC] Shaping the AVTextFormat API Surface
> 
> On date Saturday 2025-05-03 08:55:42 +, softworkz . wrote:
> > > -Original Message-
> > > From: ffmpeg-devel  On Behalf Of
> softworkz .
> > > Sent: Dienstag, 29. April 2025 01:24
> > > To: FFmpeg development discussions and patches 
> > > Subject: Re: [FFmpeg-devel] [RFC] Shaping the AVTextFormat API Surface
> [...]
> > Hello Stefano,
> >
> > I have five new commits for this:
> >
> > fftools/textformat: Rename variables wctx to tctx
> > fftools/textformat: Cleanup unneeded includes
> > fftools/textformat: Add validation for TextFormat API
> > fftools/textformat: Add validation for AVTextWriter implementations
> > fftools/textformat: Add validation for AVTextFormatter implementations
> >
> > Yet I don't believe it makes sense to squash them once again back into
> > commits that you have reviewed already, they are much easier to review
> > separately.
> >
> > So, if you would agree, I'd merge the current patchset first (once
> > Michael confirms the zlib issue being resolved) and send the new commits
> > as a new patchset then?
> 
> Feel free to merge patches which have been already approved or
> approved with minor nits - in fact this will simplify the task of
> reviewing. Please give some more time to review the other ones not yet
> approved.

I sent out an e-mail yesterday, asking whether anybody would need more time,
and that I'm planning to apply by the end of the week otherwise.
The set is around for three weeks by now and afaik, at least Andreas 
has reviewed the whole set already.
But if anybody needs more time, I'll surely postpone it.

Thanks
sw







___
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 v10 01/15] fftools/textformat: Formatting and whitespace changes

2025-05-07 Thread Stefano Sabatini
On date Sunday 2025-05-04 02:57:12 +, softworkz wrote:
> From: softworkz 
> 
> Reviewed-by: Stefano Sabatini 
> Signed-off-by: softworkz 
> ---
>  fftools/textformat/avtextformat.c  | 92 +++---
>  fftools/textformat/avtextformat.h  | 20 +++
>  fftools/textformat/avtextwriters.h | 11 ++--
>  fftools/textformat/tf_compact.c| 91 -
>  fftools/textformat/tf_default.c| 20 +++
>  fftools/textformat/tf_flat.c   | 26 +
>  fftools/textformat/tf_ini.c| 36 ++--
>  fftools/textformat/tf_json.c   | 10 ++--
>  fftools/textformat/tf_xml.c| 30 +-
>  9 files changed, 177 insertions(+), 159 deletions(-)
> 
[...]  
> -if (show_data_hash) {
> +if (show_data_hash)
>  if ((ret = av_hash_alloc(&tctx->hash, show_data_hash)) < 0) {
>  if (ret == AVERROR(EINVAL)) {
>  const char *n;
> @@ -211,7 +211,6 @@ int avtext_context_open(AVTextFormatContext **ptctx, 
> const AVTextFormatter *form
>  }
>  return ret;
>  }
> -}

For the record, I'm a bit against these kind of changes since they do
not really add to readability and might led to logical issues in case
an instruction is added to the else block and the parentheses are
discarded - but not so strongly opposed to block the patch though.

[...]
> -void avtext_print_section_header(AVTextFormatContext *tctx,
> -   const void *data,
> -   int section_id)
> +void avtext_print_section_header(AVTextFormatContext *tctx, const void 
> *data, int section_id)
>  {
>  tctx->level++;
>  av_assert0(tctx->level < SECTION_MAX_NB_LEVELS);
> @@ -272,8 +269,9 @@ void avtext_print_section_header(AVTextFormatContext 
> *tctx,

>  void avtext_print_section_footer(AVTextFormatContext *tctx)
>  {
>  int section_id = tctx->section[tctx->level]->id;
> -int parent_section_id = tctx->level ?
> -tctx->section[tctx->level-1]->id : SECTION_ID_NONE;
> +int parent_section_id = tctx->level
> +? tctx->section[tctx->level - 1]->id
> +: SECTION_ID_NONE;

nit: I prefer the original form (it now looks less readable).

[...]
>  if (section->flags & AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE) {
>  // add /TYPE to prefix
> @@ -185,30 +189,33 @@ static void 
> compact_print_section_header(AVTextFormatContext *wctx, const void *
>  char c =
>  (*p >= '0' && *p <= '9') ||
>  (*p >= 'a' && *p <= 'z') ||
> -(*p >= 'A' && *p <= 'Z') ? av_tolower(*p) : '_';
> +(*p >= 'A' && *p <= 'Z')
> +? (char)(char)av_tolower(*p)
> +: '_';

Ditto.

[...]

Should be good otherwise.
___
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] [RFC] Shaping the AVTextFormat API Surface

2025-05-07 Thread Stefano Sabatini
On date Saturday 2025-05-03 08:55:42 +, softworkz . wrote:
> > -Original Message-
> > From: ffmpeg-devel  On Behalf Of softworkz 
> > .
> > Sent: Dienstag, 29. April 2025 01:24
> > To: FFmpeg development discussions and patches 
> > Subject: Re: [FFmpeg-devel] [RFC] Shaping the AVTextFormat API Surface
[...]
> Hello Stefano,
> 
> I have five new commits for this:
> 
> fftools/textformat: Rename variables wctx to tctx
> fftools/textformat: Cleanup unneeded includes
> fftools/textformat: Add validation for TextFormat API
> fftools/textformat: Add validation for AVTextWriter implementations
> fftools/textformat: Add validation for AVTextFormatter implementations
> 
> Yet I don't believe it makes sense to squash them once again back into 
> commits that you have reviewed already, they are much easier to review
> separately.
> 
> So, if you would agree, I'd merge the current patchset first (once 
> Michael confirms the zlib issue being resolved) and send the new commits
> as a new patchset then?

Feel free to merge patches which have been already approved or
approved with minor nits - in fact this will simplify the task of
reviewing. Please give some more time to review the other ones not yet
approved.
___
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 v10 01/15] fftools/textformat: Formatting and whitespace changes

2025-05-07 Thread Stefano Sabatini
On date Sunday 2025-05-04 02:57:12 +, softworkz wrote:
> From: softworkz 
[...]

nit: use verb-object form in topic line - as in "apply formatting and
whitespace changes" - for consistency and easier human readers
processing.
___
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 v10 04/15] fftools/textformat: Rename name param to key for API consistency

2025-05-07 Thread Stefano Sabatini
On date Sunday 2025-05-04 02:57:15 +, softworkz wrote:
> From: softworkz 
> 
> Signed-off-by: softworkz 
> ---
>  fftools/textformat/avtextformat.c | 14 +++---
>  fftools/textformat/avtextformat.h |  6 +++---
>  2 files changed, 10 insertions(+), 10 deletions(-)

LGTM.
___
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 v10 03/15] fftools/textformat: Remove unused print_rational() pointer from AVTextFormatter

2025-05-07 Thread Stefano Sabatini
On date Sunday 2025-05-04 02:57:14 +, softworkz wrote:
> From: softworkz 
> 
> Signed-off-by: softworkz 
> ---
>  fftools/textformat/avtextformat.h  | 1 -
>  fftools/textformat/avtextwriters.h | 5 -
>  2 files changed, 6 deletions(-)
> 
> diff --git a/fftools/textformat/avtextformat.h 
> b/fftools/textformat/avtextformat.h
> index 86feb9d09d..c61dca159f 100644
> --- a/fftools/textformat/avtextformat.h
> +++ b/fftools/textformat/avtextformat.h
> @@ -75,7 +75,6 @@ typedef struct AVTextFormatter {
>  void (*print_section_header)(AVTextFormatContext *tctx, const void 
> *data);
>  void (*print_section_footer)(AVTextFormatContext *tctx);
>  void (*print_integer)   (AVTextFormatContext *tctx, const char *, 
> int64_t);
> -void (*print_rational)  (AVTextFormatContext *tctx, AVRational *q, 
> char *sep);
>  void (*print_string)(AVTextFormatContext *tctx, const char *, 
> const char *);
>  int flags;  ///< a combination or AV_TEXTFORMAT__FLAG_*
>  } AVTextFormatter;
> diff --git a/fftools/textformat/avtextwriters.h 
> b/fftools/textformat/avtextwriters.h
> index 34db3f1832..fd5cda04ef 100644
> --- a/fftools/textformat/avtextwriters.h
> +++ b/fftools/textformat/avtextwriters.h
> @@ -21,14 +21,9 @@
>  #ifndef FFTOOLS_TEXTFORMAT_AVTEXTWRITERS_H
>  #define FFTOOLS_TEXTFORMAT_AVTEXTWRITERS_H
>  
> -#include 
>  #include 
> -#include "libavutil/attributes.h"
> -#include "libavutil/dict.h"
>  #include "libavformat/avio.h"
>  #include "libavutil/bprint.h"
> -#include "libavutil/rational.h"
> -#include "libavutil/hash.h"

LGTM.
___
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 v10 05/15] fftools/avtextformat: Re-use BPrint in loop

2025-05-07 Thread Stefano Sabatini
On date Sunday 2025-05-04 02:57:16 +, softworkz wrote:
> From: softworkz 
> 

> Instead of initializing a new BPrint in each iteration of
> the loop,

a new BPrint in case of UTF decode error

> re-use the same BPrint struct and just clear it
> for each iteration.
> 
> Signed-off-by: softworkz 
> ---
>  fftools/textformat/avtextformat.c | 23 ++-
>  1 file changed, 14 insertions(+), 9 deletions(-)
> 
> diff --git a/fftools/textformat/avtextformat.c 
> b/fftools/textformat/avtextformat.c
> index 1cd9555ca8..b2c3aa3fc7 100644
> --- a/fftools/textformat/avtextformat.c
> +++ b/fftools/textformat/avtextformat.c
> @@ -311,24 +311,28 @@ void avtext_print_integer(AVTextFormatContext *tctx, 
> const char *key, int64_t va
>  
>  static inline int validate_string(AVTextFormatContext *tctx, char **dstp, 
> const char *src)
>  {
> -const uint8_t *p, *endp;
> +const uint8_t *p, *endp, *srcp = (const uint8_t *)src;
>  AVBPrint dstbuf;

> +AVBPrint bp_invalid_seq;

nit: you can discard bp_ for consistency with dstbuf

>  int invalid_chars_nb = 0, ret = 0;
>  
> +*dstp = NULL;
>  av_bprint_init(&dstbuf, 0, AV_BPRINT_SIZE_UNLIMITED);
> +av_bprint_init(&bp_invalid_seq, 0, AV_BPRINT_SIZE_UNLIMITED);
>  
> -endp = src + strlen(src);
> -for (p = src; *p;) {
> -uint32_t code;
> +endp = srcp + strlen(src);
> +for (p = srcp; *p;) {
> +int32_t code;
>  int invalid = 0;
>  const uint8_t *p0 = p;
>  
>  if (av_utf8_decode(&code, &p, endp, 
> tctx->string_validation_utf8_flags) < 0) {
> -AVBPrint bp;
> -av_bprint_init(&bp, 0, AV_BPRINT_SIZE_AUTOMATIC);
> -bprint_bytes(&bp, p0, p-p0);
> -av_log(tctx, AV_LOG_DEBUG,
> -   "Invalid UTF-8 sequence %s found in string '%s'\n", 
> bp.str, src);
> +
> +av_bprint_clear(&bp_invalid_seq);
> +
> +bprint_bytes(&bp_invalid_seq, p0, p - p0);
> +

> +av_log(tctx, AV_LOG_DEBUG, "Invalid UTF-8 sequence %s found in 
> string '%s'\n", bp_invalid_seq.str, src);

while at it, also quote the invalid string

>  invalid = 1;
>  }
>  
> @@ -358,6 +362,7 @@ static inline int validate_string(AVTextFormatContext 
> *tctx, char **dstp, const
>  
>  end:
>  av_bprint_finalize(&dstbuf, dstp);
> +av_bprint_finalize(&bp_invalid_seq, NULL);
>  return ret;
>  }

Should be good otherwise.
___
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 v10 01/15] fftools/textformat: Formatting and whitespace changes

2025-05-07 Thread softworkz .



> -Original Message-
> From: Stefano Sabatini 
> Sent: Donnerstag, 8. Mai 2025 01:45
> To: FFmpeg development discussions and patches 
> Cc: softworkz 
> Subject: Re: [FFmpeg-devel] [PATCH v10 01/15] fftools/textformat: Formatting
> and whitespace changes
> 
> On date Sunday 2025-05-04 02:57:12 +, softworkz wrote:
> > From: softworkz 
> >
> > Reviewed-by: Stefano Sabatini 
> > Signed-off-by: softworkz 
> > ---
> >  fftools/textformat/avtextformat.c  | 92 +++---
> >  fftools/textformat/avtextformat.h  | 20 +++
> >  fftools/textformat/avtextwriters.h | 11 ++--
> >  fftools/textformat/tf_compact.c| 91 -
> >  fftools/textformat/tf_default.c| 20 +++
> >  fftools/textformat/tf_flat.c   | 26 +
> >  fftools/textformat/tf_ini.c| 36 ++--
> >  fftools/textformat/tf_json.c   | 10 ++--
> >  fftools/textformat/tf_xml.c| 30 +-
> >  9 files changed, 177 insertions(+), 159 deletions(-)
> >
> [...]
> > -if (show_data_hash) {
> > +if (show_data_hash)
> >  if ((ret = av_hash_alloc(&tctx->hash, show_data_hash)) < 0) {
> >  if (ret == AVERROR(EINVAL)) {
> >  const char *n;
> > @@ -211,7 +211,6 @@ int avtext_context_open(AVTextFormatContext **ptctx,
> const AVTextFormatter *form
> >  }
> >  return ret;
> >  }
> > -}
> 
> For the record, I'm a bit against these kind of changes since they do
> not really add to readability and might led to logical issues in case
> an instruction is added to the else block and the parentheses are
> discarded - but not so strongly opposed to block the patch though.
> 
> [...]
> > -void avtext_print_section_header(AVTextFormatContext *tctx,
> > -   const void *data,
> > -   int section_id)
> > +void avtext_print_section_header(AVTextFormatContext *tctx, const void
> *data, int section_id)
> >  {
> >  tctx->level++;
> >  av_assert0(tctx->level < SECTION_MAX_NB_LEVELS);
> > @@ -272,8 +269,9 @@ void avtext_print_section_header(AVTextFormatContext
> *tctx,
> 
> >  void avtext_print_section_footer(AVTextFormatContext *tctx)
> >  {
> >  int section_id = tctx->section[tctx->level]->id;
> > -int parent_section_id = tctx->level ?
> > -tctx->section[tctx->level-1]->id : SECTION_ID_NONE;
> > +int parent_section_id = tctx->level
> > +? tctx->section[tctx->level - 1]->id
> > +: SECTION_ID_NONE;
> 
> nit: I prefer the original form (it now looks less readable).
> 
> [...]
> >  if (section->flags & AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE) {
> >  // add /TYPE to prefix
> > @@ -185,30 +189,33 @@ static void
> compact_print_section_header(AVTextFormatContext *wctx, const void *
> >  char c =
> >  (*p >= '0' && *p <= '9') ||
> >  (*p >= 'a' && *p <= 'z') ||
> > -(*p >= 'A' && *p <= 'Z') ? av_tolower(*p) : '_';
> > +(*p >= 'A' && *p <= 'Z')
> > +? (char)(char)av_tolower(*p)
> > +: '_';
> 
> Ditto.
> 
> [...]
> 
> Should be good otherwise.


Hi Stefano,

In message "[PATCH] [RFC] global/clang-format: Add .clang-format configuration 
for consistent formatting" I'm trying to work out a common format that matches 
the existing code formatting rules.

The patches above are formatted accordingly.

Regarding the first above, FFmpeg rules say:

Don't wrap single-line blocks in braces. Use braces only if there is an 
accompanying else statement.
(https://ffmpeg.org/developer.html#Code-formatting-conventions)

Now, I'm not sure whether this exactly means "single line" - clang-format only 
supports "single statement/block", so if it means "single line", it might be 
difficult to replicate.

Seems, we don't have any rule for ternary operator placement, afaik, the most 
common rule is to place them at the beginning of lines, but I surely can revert 
it.

Thanks,
sw







___
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] [RFC] Shaping the AVTextFormat API Surface

2025-05-07 Thread Stefano Sabatini
On date Monday 2025-05-05 16:32:08 +0200, Nicolas George wrote:
> Stefano Sabatini (HE12025-05-04):
> > I don't understand this claim. There is a root, and each section can
> > have several subsections, so it is a tree in my view, although we set
> > a maximum depth. Where am I wrong?
> 

> Are we looking at the same thing? In ffprobe's output, we have sections
> “packets”, “streams”, “format”, etc., and in each section items, but
> that does not go deeper.

The -sections option will show the ffprobe data "schema".

$ ffprobe -sections -hide_banner
Sections:
W... = Section is a wrapper (contains other sections, no local entries)
.A.. = Section contains an array of elements of the same type
..V. = Section may contain a variable number of fields with variable keys
...T = Section contain a unique type
FLAGS NAME/UNIQUE_NAME

W...  root
.A..  chapters
  chapter
..V.  tags/chapter_tags
  format
..V.  tags/format_tags
.A..  frames
  frame
..V.  tags/frame_tags
.A..  side_data_list/frame_side_data_list
..VT  side_data/frame_side_data
.A..  timecodes
  timecode
.A..  components/frame_side_data_components
..VT  component/frame_side_data_component
.A..  pieces/frame_side_data_pieces
..VT  piece/frame_side_data_piece
.A..  logs
  log
  subtitle
.A..  programs
  program
..V.  tags/program_tags
.A..  streams/program_streams
  stream/program_stream
  disposition/program_stream_disposition
..V.  tags/program_stream_tags
.A..  stream_groups
  stream_group
..V.  tags/stream_group_tags
  disposition/stream_group_disposition
.A..  components/stream_group_components
..VT  component/stream_group_component
.A..  subcomponents
..VT  subcomponent
.A..  pieces/stream_group_pieces
..VT  piece/stream_group_piece
.A..  subpieces
..VT  subpiece
.A..  blocks
..VT  block
.A..  streams/stream_group_streams
  stream/stream_group_stream
  disposition/stream_group_stream_disposition
..V.  tags/stream_group_stream_tags
.A..  streams
  stream
  disposition/stream_disposition
..V.  tags/stream_tags
.A..  side_data_list/stream_side_data_list
..VT  side_data/stream_side_data
.A..  packets
  packet
..V.  tags/packet_tags
.A..  side_data_list/packet_side_data_list
..VT  side_data/packet_side_data
  error
  program_version
.A..  library_versions
  library_version
.A..  pixel_formats
  pixel_format
  flags/pixel_format_flags
.A..  components/pixel_format_components
  component

So yes, this should be a tree, although we hardcode a maximum depth
and the maximum number of items per section - it might be possible to
remove this limitation with some effort. In particular, we migth
benefit from employing a dictionary implementation.
 
> And in the source code of ffprobe, I see extremely ad-hoc code.

This is expected, since this is application-level logic - and we need
to instruct the code to convert the internal data to the
sections-based representation. The recently tagged AVTextFormat API
should be pretty generic. Note that in fact in AVTextFormat there is
no mention to "ffprobe" concepts (packets, frames, etc.) since that's
part of the data schema.

> > I agree with softworkz on this. The AVTextFormat functionality is not
> > about a specific format, it's supposed to be a generic way to
> > represent a data tree using different formats. Being able to provide
> > this generic representation is crucial, since we want a single entry
> > point to represent data in a way which can be parsed in various ways,
> > given a data schema.
> 
> Is this API meant to be a generic API for writing structured data, or is
> it meant to be totally specific to ffprobe and usable by one other use
> case that was designed to behave exactly like ffprobe.
> 
> An API that is not generic should not go into libavutil.
> 
> An API that cannot serve all, or at least most of, our currently
> existing use cases cannot be called generic.

One of the use cases I have in mind is to support structured data
coming from filters - there are several different a

Re: [FFmpeg-devel] [PATCH 01/21] avutil/avassert: Add av_unreachable and av_assume() macros

2025-05-07 Thread Michael Niedermayer
On Wed, May 07, 2025 at 07:14:04PM +, softworkz . wrote:
[...]
> > > > As long as there's no migration to a better way, why not try out making
> > PRs
> > > to https://github.com/ffstaging/FFmpeg?
> > >
> > > I doubt "ffstaging" is affiliated with the project in any capacity.
> > 
> > Hi James,
> > 
> > it works like this:
> > 
> > - You make a PR to https://github.com/ffstaging/FFmpeg
> > - You make a comment with "/submit"
> > - The PR will be submitted to the ML as regular patches
> 
> More specifics:
> 
> - The PR message is sent as the cover-letter text [Patch 0/n]
>   Markdown is converted to ASCII
> 
> - Commit messages are checked for compliance
> 
> - CI builds are run on the last commit (yet you can submit 
>   without waiting)
> 
> - To submit new versions of a patchset, simply force-push to
>   your PR branch and comment "/submit" again.
>   The patchset will automatically be submitted as a new version
>   (v2, v3, etc.)
> 
> - Comments made on the ML are automatically mirrored back as PR
>   comments on GH
> 
> - Cover-letters sent to the ML include a range-diff, showing
>   the changes from the previous version
>   They also include Git links to directly check out the patchset

Should this be added to doc/developer.texi ?
(which shows up as https://ffmpeg.org/developer.html)

We also should put forgejo in there too probably

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

For a strong democracy, genuine criticism is necessary, allegations benefit
noone, they just cause unnecessary conflicts. - Narendra Modi


signature.asc
Description: PGP signature
___
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 v10 01/15] fftools/textformat: Formatting and whitespace changes

2025-05-07 Thread softworkz .


> -Original Message-
> From: Stefano Sabatini 
> Sent: Donnerstag, 8. Mai 2025 02:14
> To: softworkz . 
> Cc: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [PATCH v10 01/15] fftools/textformat: Formatting
> and whitespace changes
> 
> On date Wednesday 2025-05-07 23:59:39 +, softworkz . wrote:
> >
> >
> > > -Original Message-
> > > From: Stefano Sabatini 
> > > Sent: Donnerstag, 8. Mai 2025 01:45
> > > To: FFmpeg development discussions and patches 
> > > Cc: softworkz 
> > > Subject: Re: [FFmpeg-devel] [PATCH v10 01/15] fftools/textformat:
> Formatting
> > > and whitespace changes
> > >
> > > On date Sunday 2025-05-04 02:57:12 +, softworkz wrote:
> > > > From: softworkz 
> > > >
> > > > Reviewed-by: Stefano Sabatini 
> > > > Signed-off-by: softworkz 
> > > > ---
> > > >  fftools/textformat/avtextformat.c  | 92 +++---
> > > >  fftools/textformat/avtextformat.h  | 20 +++
> > > >  fftools/textformat/avtextwriters.h | 11 ++--
> > > >  fftools/textformat/tf_compact.c| 91 -
> > > >  fftools/textformat/tf_default.c| 20 +++
> > > >  fftools/textformat/tf_flat.c   | 26 +
> > > >  fftools/textformat/tf_ini.c| 36 ++--
> > > >  fftools/textformat/tf_json.c   | 10 ++--
> > > >  fftools/textformat/tf_xml.c| 30 +-
> > > >  9 files changed, 177 insertions(+), 159 deletions(-)
> > > >
> > > [...]
> > > > -if (show_data_hash) {
> > > > +if (show_data_hash)
> > > >  if ((ret = av_hash_alloc(&tctx->hash, show_data_hash)) < 0) {
> > > >  if (ret == AVERROR(EINVAL)) {
> > > >  const char *n;
> > > > @@ -211,7 +211,6 @@ int avtext_context_open(AVTextFormatContext **ptctx,
> > > const AVTextFormatter *form
> > > >  }
> > > >  return ret;
> > > >  }
> > > > -}
> > >
> > > For the record, I'm a bit against these kind of changes since they do
> > > not really add to readability and might led to logical issues in case
> > > an instruction is added to the else block and the parentheses are
> > > discarded - but not so strongly opposed to block the patch though.
> > >
> > > [...]
> > > > -void avtext_print_section_header(AVTextFormatContext *tctx,
> > > > -   const void *data,
> > > > -   int section_id)
> > > > +void avtext_print_section_header(AVTextFormatContext *tctx, const void
> > > *data, int section_id)
> > > >  {
> > > >  tctx->level++;
> > > >  av_assert0(tctx->level < SECTION_MAX_NB_LEVELS);
> > > > @@ -272,8 +269,9 @@ void avtext_print_section_header(AVTextFormatContext
> > > *tctx,
> > >
> > > >  void avtext_print_section_footer(AVTextFormatContext *tctx)
> > > >  {
> > > >  int section_id = tctx->section[tctx->level]->id;
> > > > -int parent_section_id = tctx->level ?
> > > > -tctx->section[tctx->level-1]->id : SECTION_ID_NONE;
> > > > +int parent_section_id = tctx->level
> > > > +? tctx->section[tctx->level - 1]->id
> > > > +: SECTION_ID_NONE;
> > >
> > > nit: I prefer the original form (it now looks less readable).
> > >
> > > [...]
> > > >  if (section->flags & AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE) {
> > > >  // add /TYPE to prefix
> > > > @@ -185,30 +189,33 @@ static void
> > > compact_print_section_header(AVTextFormatContext *wctx, const void *
> > > >  char c =
> > > >  (*p >= '0' && *p <= '9') ||
> > > >  (*p >= 'a' && *p <= 'z') ||
> > > > -(*p >= 'A' && *p <= 'Z') ? av_tolower(*p) : '_';
> > > > +(*p >= 'A' && *p <= 'Z')
> > > > +? (char)(char)av_tolower(*p)
> > > > +: '_';
> > >
> > > Ditto.
> > >
> > > [...]
> > >
> > > Should be good otherwise.
> >
> >
> > Hi Stefano,
> >
> > In message "[PATCH] [RFC] global/clang-format: Add .clang-format
> configuration for consistent formatting" I'm trying to work out a common
> format that matches the existing code formatting rules.
> >
> > The patches above are formatted accordingly.
> >
> > Regarding the first above, FFmpeg rules say:
> >
> > Don't wrap single-line blocks in braces. Use braces only if there is an
> accompanying else statement.
> > (https://ffmpeg.org/developer.html#Code-formatting-conventions)
> >
> > Now, I'm not sure whether this exactly means "single line" - clang-format
> only supports "single statement/block", so if it means "single line", it might
> be difficult to replicate.
> >
> 
> So, as I wrote, I don't have strong objections against the brace
> removals if you want to go with that.
> 
> > Seems, we don't have any rule for ternary operator placement, afaik,
> > the most common rule is to place them at the beginning of lines, but
> > I surely can revert it.
> 
> About ternary, I'd drop those changes as they conflict 

Re: [FFmpeg-devel] [PATCH v10 01/15] fftools/textformat: Formatting and whitespace changes

2025-05-07 Thread Stefano Sabatini
On date Wednesday 2025-05-07 23:59:39 +, softworkz . wrote:
> 
> 
> > -Original Message-
> > From: Stefano Sabatini 
> > Sent: Donnerstag, 8. Mai 2025 01:45
> > To: FFmpeg development discussions and patches 
> > Cc: softworkz 
> > Subject: Re: [FFmpeg-devel] [PATCH v10 01/15] fftools/textformat: Formatting
> > and whitespace changes
> > 
> > On date Sunday 2025-05-04 02:57:12 +, softworkz wrote:
> > > From: softworkz 
> > >
> > > Reviewed-by: Stefano Sabatini 
> > > Signed-off-by: softworkz 
> > > ---
> > >  fftools/textformat/avtextformat.c  | 92 +++---
> > >  fftools/textformat/avtextformat.h  | 20 +++
> > >  fftools/textformat/avtextwriters.h | 11 ++--
> > >  fftools/textformat/tf_compact.c| 91 -
> > >  fftools/textformat/tf_default.c| 20 +++
> > >  fftools/textformat/tf_flat.c   | 26 +
> > >  fftools/textformat/tf_ini.c| 36 ++--
> > >  fftools/textformat/tf_json.c   | 10 ++--
> > >  fftools/textformat/tf_xml.c| 30 +-
> > >  9 files changed, 177 insertions(+), 159 deletions(-)
> > >
> > [...]
> > > -if (show_data_hash) {
> > > +if (show_data_hash)
> > >  if ((ret = av_hash_alloc(&tctx->hash, show_data_hash)) < 0) {
> > >  if (ret == AVERROR(EINVAL)) {
> > >  const char *n;
> > > @@ -211,7 +211,6 @@ int avtext_context_open(AVTextFormatContext **ptctx,
> > const AVTextFormatter *form
> > >  }
> > >  return ret;
> > >  }
> > > -}
> > 
> > For the record, I'm a bit against these kind of changes since they do
> > not really add to readability and might led to logical issues in case
> > an instruction is added to the else block and the parentheses are
> > discarded - but not so strongly opposed to block the patch though.
> > 
> > [...]
> > > -void avtext_print_section_header(AVTextFormatContext *tctx,
> > > -   const void *data,
> > > -   int section_id)
> > > +void avtext_print_section_header(AVTextFormatContext *tctx, const void
> > *data, int section_id)
> > >  {
> > >  tctx->level++;
> > >  av_assert0(tctx->level < SECTION_MAX_NB_LEVELS);
> > > @@ -272,8 +269,9 @@ void avtext_print_section_header(AVTextFormatContext
> > *tctx,
> > 
> > >  void avtext_print_section_footer(AVTextFormatContext *tctx)
> > >  {
> > >  int section_id = tctx->section[tctx->level]->id;
> > > -int parent_section_id = tctx->level ?
> > > -tctx->section[tctx->level-1]->id : SECTION_ID_NONE;
> > > +int parent_section_id = tctx->level
> > > +? tctx->section[tctx->level - 1]->id
> > > +: SECTION_ID_NONE;
> > 
> > nit: I prefer the original form (it now looks less readable).
> > 
> > [...]
> > >  if (section->flags & AV_TEXTFORMAT_SECTION_FLAG_HAS_TYPE) {
> > >  // add /TYPE to prefix
> > > @@ -185,30 +189,33 @@ static void
> > compact_print_section_header(AVTextFormatContext *wctx, const void *
> > >  char c =
> > >  (*p >= '0' && *p <= '9') ||
> > >  (*p >= 'a' && *p <= 'z') ||
> > > -(*p >= 'A' && *p <= 'Z') ? av_tolower(*p) : '_';
> > > +(*p >= 'A' && *p <= 'Z')
> > > +? (char)(char)av_tolower(*p)
> > > +: '_';
> > 
> > Ditto.
> > 
> > [...]
> > 
> > Should be good otherwise.
> 
> 
> Hi Stefano,
> 
> In message "[PATCH] [RFC] global/clang-format: Add .clang-format 
> configuration for consistent formatting" I'm trying to work out a common 
> format that matches the existing code formatting rules.
> 
> The patches above are formatted accordingly.
> 
> Regarding the first above, FFmpeg rules say:
> 
> Don't wrap single-line blocks in braces. Use braces only if there is an 
> accompanying else statement.
> (https://ffmpeg.org/developer.html#Code-formatting-conventions)
> 
> Now, I'm not sure whether this exactly means "single line" - clang-format 
> only supports "single statement/block", so if it means "single line", it 
> might be difficult to replicate.
> 

So, as I wrote, I don't have strong objections against the brace
removals if you want to go with that.

> Seems, we don't have any rule for ternary operator placement, afaik,
> the most common rule is to place them at the beginning of lines, but
> I surely can revert it.

About ternary, I'd drop those changes as they conflict with the style
adopted in the whole FFmpeg codebase.
___
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 v10 06/15] fftools/textformat: Introduce AVTextFormatOptions for avtext_context_open()

2025-05-07 Thread softworkz .



> -Original Message-
> From: Stefano Sabatini 
> Sent: Donnerstag, 8. Mai 2025 02:06
> To: FFmpeg development discussions and patches 
> Cc: softworkz 
> Subject: Re: [FFmpeg-devel] [PATCH v10 06/15] fftools/textformat: Introduce
> AVTextFormatOptions for avtext_context_open()
> 
> On date Sunday 2025-05-04 02:57:17 +, softworkz wrote:
> > From: softworkz 
> >
> > This allows future addition of options without
> > changes to the signature of avtext_context_open().
> >
> > Reviewed-by: Stefano Sabatini 
> > Signed-off-by: softworkz 
> > ---
> >  fftools/ffprobe.c | 13 +
> >  fftools/textformat/avtextformat.c | 21 -
> >  fftools/textformat/avtextformat.h | 16 +---
> >  3 files changed, 26 insertions(+), 24 deletions(-)
> >
> > diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
> > index f5c83925b9..1277b1e4f9 100644
> > --- a/fftools/ffprobe.c
> > +++ b/fftools/ffprobe.c
> > @@ -3168,10 +3168,15 @@ int main(int argc, char **argv)
> >  if (ret < 0)
> >  goto end;
> >
> > -if ((ret = avtext_context_open(&tctx, f, wctx, f_args,
> > -   sections, FF_ARRAY_ELEMS(sections),
> show_value_unit,
> > -use_value_prefix, use_byte_value_binary_prefix,
> use_value_sexagesimal_format,
> > -show_optional_fields, show_data_hash)) >= 0) {
> 
> > +AVTextFormatOptions tf_options = {
> > +.show_optional_fields = show_optional_fields,
> > +.show_value_unit = show_value_unit,
> > +.use_value_prefix = use_value_prefix,
> > +.use_byte_value_binary_prefix = use_byte_value_binary_prefix,
> > +.use_value_sexagesimal_format = use_value_sexagesimal_format,
> > +};
> > +
> > +if ((ret = avtext_context_open(&tctx, f, wctx, f_args, sections,
> FF_ARRAY_ELEMS(sections), tf_options, show_data_hash)) >= 0) {
> >  if (f == &avtextformatter_xml)
> >  tctx->string_validation_utf8_flags |=
> AV_UTF8_FLAG_EXCLUDE_XML_INVALID_CONTROL_CODES;
> >
> > diff --git a/fftools/textformat/avtextformat.c
> b/fftools/textformat/avtextformat.c
> > index b2c3aa3fc7..91469ef576 100644
> > --- a/fftools/textformat/avtextformat.c
> > +++ b/fftools/textformat/avtextformat.c
> > @@ -125,13 +125,7 @@ void avtext_context_close(AVTextFormatContext **ptctx)
> >
> >
> >  int avtext_context_open(AVTextFormatContext **ptctx, const AVTextFormatter
> *formatter, AVTextWriterContext *writer_context, const char *args,
> > -const AVTextFormatSection *sections, int
> nb_sections,
> > -int show_value_unit,
> > -int use_value_prefix,
> > -int use_byte_value_binary_prefix,
> > -int use_value_sexagesimal_format,
> > -int show_optional_fields,
> > -char *show_data_hash)
> > +const AVTextFormatSection *sections, int
> nb_sections, AVTextFormatOptions options, char *show_data_hash)
> >  {
> >  AVTextFormatContext *tctx;
> >  int i, ret = 0;
> > @@ -154,11 +148,11 @@ int avtext_context_open(AVTextFormatContext **ptctx,
> const AVTextFormatter *form
> >  goto fail;
> >  }
> >
> > -tctx->show_value_unit = show_value_unit;
> > -tctx->use_value_prefix = use_value_prefix;
> > -tctx->use_byte_value_binary_prefix = use_byte_value_binary_prefix;
> > -tctx->use_value_sexagesimal_format = use_value_sexagesimal_format;
> > -tctx->show_optional_fields = show_optional_fields;
> > +tctx->show_value_unit = options.show_value_unit;
> > +tctx->use_value_prefix = options.use_value_prefix;
> > +tctx->use_byte_value_binary_prefix =
> options.use_byte_value_binary_prefix;
> > +tctx->use_value_sexagesimal_format =
> options.use_value_sexagesimal_format;
> > +tctx->show_optional_fields = options.show_optional_fields;
> >
> >  if (nb_sections > SECTION_MAX_NB_SECTIONS) {
> >  av_log(tctx, AV_LOG_ERROR, "The number of section definitions (%d)
> is larger than the maximum allowed (%d)\n", nb_sections,
> SECTION_MAX_NB_SECTIONS);
> > @@ -201,7 +195,7 @@ int avtext_context_open(AVTextFormatContext **ptctx,
> const AVTextFormatter *form
> >  av_dict_free(&opts);
> >  }
> >
> > -if (show_data_hash)
> > +if (show_data_hash) {
> >  if ((ret = av_hash_alloc(&tctx->hash, show_data_hash)) < 0) {
> >  if (ret == AVERROR(EINVAL)) {
> >  const char *n;
> > @@ -212,6 +206,7 @@ int avtext_context_open(AVTextFormatContext **ptctx,
> const AVTextFormatter *form
> >  }
> >  goto fail;
> >  }
> > +}
> >
> >  /* validate replace string */
> >  {
> > diff --git a/fftools/textformat/avtextformat.h
> b/fftools/textformat/avtextformat.h
> > index 8ff503401a..87f57d8c24 100644
> > --- a/fftools/textformat/avtextformat.h
> > +++ b/fftools/tex

Re: [FFmpeg-devel] [PATCH v2 0/3] avcodec/sanm: Fixes for "StarWars - Making Magic"

2025-05-07 Thread Manuel Lauss
Hi,

If there are no objections, I will commit this with whitespace fixes
in 2-3 days.  I see no regressions with existing sanm video support.

Manuel

On Tue, May 6, 2025 at 5:41 PM Manuel Lauss  wrote:
>
> This patchset extends the SANM codec handler to support video of
> the 1996 CD-ROM Title "StarWars - Making Magic".
> These videos all consist of a 640x480 codec3 background, with 320x240
> codec48 animations put on top at random left/top offsets.
>
> v2: reworded descriptions, fixes in #3.
>
> #1: some "Making Magic" files advertise codec48 compression type 6.
> The actual data stops after the codec headers, and the dos exe as well as
> the codec48 decoder in the MotS game exe don't know of it and simply
> ignore it.
>
> #2: change the FOBJ frame size determination to recognize common sizes.
> With the scheme employed by Making Magic, the codec48 dimensions can no
> longer be blindly trusted.
>
> #3: support video of Making Magic.  This patch also brings the fobj
> handling more in line with what the game engines actually do.
>
> Tested with RA1, RA2 (c37), Outlaws (c47), MotS (c48)
>
> See https://ibb.co/73Pt803  for post/pre fix screenshots.
>
> Manuel Lauss (3):
>   avcodec/sanm: ignore codec48 compression type 6
>   avcodec/sanm: add a whitelist for known FOBJ sizes
>   avcodec/sanm: support "StarWars - Making Magic" video
>
>  libavcodec/sanm.c | 100 --
>  1 file changed, 70 insertions(+), 30 deletions(-)
>
> --
> 2.49.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".