Commit 2602f39f55 for ffmpeg
commit 2602f39f55468b3c5ca9a2bf40f86ef8bcefad98
Author: Niklas Haas <git@haasn.dev>
Date: Thu Oct 29 13:27:15 2026 +0100
avfilter: deprecate AVFilterGraph.max_buffered_frames
In favor of the new API.
Signed-off-by: Niklas Haas <git@haasn.dev>
diff --git a/doc/APIchanges b/doc/APIchanges
index 031025e979..a0373238a7 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@ The last version increases of all libraries were on 2026-06-23.
API changes, most recent first:
+2026-10-xx - xxxxxxxxxx - lavfi 12.12.100 - avfilter.h
+ Deprecate AVFilterGraph.max_buffered_frames in favor of
+ avfilter_graph_set_max_buffered_frames().
+
2026-10-xx - xxxxxxxxxx - lavfi 12.11.100 - avfilter.h
Add avfilter_graph_set_max_buffered_frames().
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 23977679fe..36857d6cce 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -620,14 +620,19 @@ typedef struct AVFilterGraph {
char *aresample_swr_opts; ///< swr options to use for the auto-inserted aresample filters, Access ONLY through AVOptions
+#if FF_API_MAX_BUFFERED_FRAMES
/**
* Sets the maximum number of combined buffered frames of each media type
* in the filtergraph.
*
* Zero means no limit. This field must be set before calling
* avfilter_graph_config().
+ *
+ * @deprecated use avfilter_graph_set_max_buffered_frames() instead
*/
+ attribute_deprecated
unsigned max_buffered_frames;
+#endif
} AVFilterGraph;
/**
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 304589e50b..deca8bb47a 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -45,6 +45,7 @@
#define F AV_OPT_FLAG_FILTERING_PARAM
#define V AV_OPT_FLAG_VIDEO_PARAM
#define A AV_OPT_FLAG_AUDIO_PARAM
+FF_DISABLE_DEPRECATION_WARNINGS
static const AVOption filtergraph_options[] = {
{ "thread_type", "Allowed thread types", OFFSET(thread_type), AV_OPT_TYPE_FLAGS,
{ .i64 = AVFILTER_THREAD_SLICE }, 0, INT_MAX, F|V|A, .unit = "thread_type" },
@@ -56,10 +57,13 @@ static const AVOption filtergraph_options[] = {
AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, F|V },
{"aresample_swr_opts" , "default aresample filter options" , OFFSET(aresample_swr_opts) ,
AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, F|A },
+#if FF_API_MAX_BUFFERED_FRAMES
{"max_buffered_frames" , "maximum number of buffered frames allowed", OFFSET(max_buffered_frames),
- AV_OPT_TYPE_UINT, {.i64 = 0}, 0, UINT_MAX, F|V|A },
+ AV_OPT_TYPE_UINT, {.i64 = 0}, 0, UINT_MAX, F|V|A|AV_OPT_FLAG_DEPRECATED },
+#endif
{ NULL },
};
+FF_ENABLE_DEPRECATION_WARNINGS
static const AVClass filtergraph_class = {
.class_name = "AVFilterGraph",
@@ -1478,9 +1482,13 @@ int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)
FFFilterGraph *graphi = fffiltergraph(graphctx);
int ret;
- size_t max_queued = graphctx->max_buffered_frames;
- if (!max_queued)
- max_queued = SIZE_MAX;
+ size_t max_queued = SIZE_MAX;
+#if FF_API_MAX_BUFFERED_FRAMES
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (graphctx->max_buffered_frames)
+ max_queued = graphctx->max_buffered_frames;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
for (int i = 0; i < FF_ARRAY_ELEMS(graphi->frame_queues); i++) {
/* only infer the value from graphctx->max_buffered_frames if it was
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 8f4a7a9cd3..64cd692ab6 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -31,7 +31,7 @@
#include "version_major.h"
-#define LIBAVFILTER_VERSION_MINOR 11
+#define LIBAVFILTER_VERSION_MINOR 12
#define LIBAVFILTER_VERSION_MICRO 100
diff --git a/libavfilter/version_major.h b/libavfilter/version_major.h
index a5d93410f3..45f63a8936 100644
--- a/libavfilter/version_major.h
+++ b/libavfilter/version_major.h
@@ -35,4 +35,6 @@
* the public API and may change, break or disappear at any time.
*/
+#define FF_API_MAX_BUFFERED_FRAMES (LIBAVFILTER_VERSION_MAJOR < 13)
+
#endif /* AVFILTER_VERSION_MAJOR_H */