[FFmpeg-devel] [PATCH 2/5] fftools/ffmpeg_filter: provide hwctx when probing graph
Niklas Haas
ffmpeg at haasn.xyz
Fri Feb 9 16:53:46 EET 2024
From: Niklas Haas <git at haasn.dev>
Otherwise, filters that depend on a hw_device_ctx being present at
init() time would fail configuring under the semantics outlined in the
previous commit.
---
fftools/ffmpeg_filter.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
index 38ddd1963a..46e1d790e7 100644
--- a/fftools/ffmpeg_filter.c
+++ b/fftools/ffmpeg_filter.c
@@ -931,6 +931,7 @@ int fg_create(FilterGraph **pfg, char *graph_desc, Scheduler *sch)
AVFilterInOut *inputs, *outputs;
AVFilterGraph *graph;
+ AVBufferRef *hw_device;
int ret = 0;
fgp = allocate_array_elem(&filtergraphs, sizeof(*fgp), &nb_filtergraphs);
@@ -961,7 +962,9 @@ int fg_create(FilterGraph **pfg, char *graph_desc, Scheduler *sch)
return AVERROR(ENOMEM);;
graph->nb_threads = 1;
- ret = graph_parse(graph, fgp->graph_desc, &inputs, &outputs, NULL);
+ hw_device = hw_device_for_filter();
+
+ ret = graph_parse(graph, fgp->graph_desc, &inputs, &outputs, hw_device);
if (ret < 0)
goto fail;
--
2.43.0
More information about the ffmpeg-devel
mailing list