From: Anton Khirnov <anton@khirnov.net>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Cc: Niklas Haas <git@haasn.dev>
Subject: Re: [FFmpeg-devel] [PATCH 2/5] fftools/ffmpeg_filter: provide hwctx when probing graph
Date: Fri, 09 Feb 2024 18:12:18 +0100
Message-ID: <170749873831.8914.6028886677274528210@lain.khirnov.net> (raw)
In-Reply-To: <20240209145349.104511-2-ffmpeg@haasn.xyz>
Quoting Niklas Haas (2024-02-09 15:53:46)
> From: Niklas Haas <git@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();
This function may be called before any decoders are opened, and if I'm
reading the code right, opening decoders may creat new globally
available devices which are then returned from hw_device_for_filter().
It should probably be ok to cache the device you get here in
FilterGraphPriv to ensure you always use the same device.
--
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-02-09 17:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-09 14:53 [FFmpeg-devel] [PATCH 1/5] avfilter: tighten semantics on hw_device_ctx Niklas Haas
2024-02-09 14:53 ` [FFmpeg-devel] [PATCH 2/5] fftools/ffmpeg_filter: provide hwctx when probing graph Niklas Haas
2024-02-09 17:12 ` Anton Khirnov [this message]
2024-02-09 14:53 ` [FFmpeg-devel] [PATCH 3/5] avfilter/hwupload: move hwctx init to init() Niklas Haas
2024-02-09 17:17 ` Anton Khirnov
2024-02-09 14:53 ` [FFmpeg-devel] [PATCH 4/5] avfilter/libplacebo: " Niklas Haas
2024-02-09 14:53 ` [FFmpeg-devel] [PATCH 5/5] avfilter/vsrc_ddagrab: " Niklas Haas
2024-02-09 16:53 ` [FFmpeg-devel] [PATCH 1/5] avfilter: tighten semantics on hw_device_ctx Anton Khirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=170749873831.8914.6028886677274528210@lain.khirnov.net \
--to=anton@khirnov.net \
--cc=ffmpeg-devel@ffmpeg.org \
--cc=git@haasn.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git