* [FFmpeg-devel] [PATCH 1/5] avfilter: tighten semantics on hw_device_ctx
@ 2024-02-09 14:53 Niklas Haas
2024-02-09 14:53 ` [FFmpeg-devel] [PATCH 2/5] fftools/ffmpeg_filter: provide hwctx when probing graph Niklas Haas
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Niklas Haas @ 2024-02-09 14:53 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Niklas Haas
From: Niklas Haas <git@haasn.dev>
Currently, such filters defer hardware device initialization to
query_formats(), which is not really the correct place to have it. It
would be far more logical for these filters to create the hardware
context at init time, and error out otherwise.
By contrast, filters which merely receive or process hardware frames
typically do this at link config time, because they do not need access
to the hwframe specifics in order to query supported formats.
The intention here is to specifically stop creating hardware devices in
query_formats.
---
libavfilter/avfilter.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 246d000251..b6adcf2473 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -464,7 +464,8 @@ struct AVFilterContext {
*
* May be set by the caller on filters flagged with AVFILTER_FLAG_HWDEVICE
* before initializing the filter with avfilter_init_str() or
- * avfilter_init_dict().
+ * avfilter_init_dict(). *Must* be set for filters which do not have another
+ * way of obtaining a hardware device context (e.g. from an input link).
*/
AVBufferRef *hw_device_ctx;
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 2/5] fftools/ffmpeg_filter: provide hwctx when probing graph
2024-02-09 14:53 [FFmpeg-devel] [PATCH 1/5] avfilter: tighten semantics on hw_device_ctx Niklas Haas
@ 2024-02-09 14:53 ` Niklas Haas
2024-02-09 17:12 ` Anton Khirnov
2024-02-09 14:53 ` [FFmpeg-devel] [PATCH 3/5] avfilter/hwupload: move hwctx init to init() Niklas Haas
` (3 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Niklas Haas @ 2024-02-09 14:53 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Niklas Haas
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();
+
+ ret = graph_parse(graph, fgp->graph_desc, &inputs, &outputs, hw_device);
if (ret < 0)
goto fail;
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 3/5] avfilter/hwupload: move hwctx init to init()
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 14:53 ` Niklas Haas
2024-02-09 17:17 ` Anton Khirnov
2024-02-09 14:53 ` [FFmpeg-devel] [PATCH 4/5] avfilter/libplacebo: " Niklas Haas
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: Niklas Haas @ 2024-02-09 14:53 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Niklas Haas
From: Niklas Haas <git@haasn.dev>
---
libavfilter/vf_hwupload.c | 49 ++++++++++++++++++++++-----------------
1 file changed, 28 insertions(+), 21 deletions(-)
diff --git a/libavfilter/vf_hwupload.c b/libavfilter/vf_hwupload.c
index ef61bb4137..bc1e32af1a 100644
--- a/libavfilter/vf_hwupload.c
+++ b/libavfilter/vf_hwupload.c
@@ -39,35 +39,41 @@ typedef struct HWUploadContext {
char *device_type;
} HWUploadContext;
-static int hwupload_query_formats(AVFilterContext *avctx)
+static av_cold int hwupload_init(AVFilterContext *avctx)
{
HWUploadContext *ctx = avctx->priv;
- AVHWFramesConstraints *constraints = NULL;
- const enum AVPixelFormat *input_pix_fmts, *output_pix_fmts;
- AVFilterFormats *input_formats = NULL;
- int err, i;
+ int err;
- if (ctx->hwdevice_ref) {
- /* We already have a specified device. */
- } else if (avctx->hw_device_ctx) {
- if (ctx->device_type) {
- err = av_hwdevice_ctx_create_derived(
- &ctx->hwdevice_ref,
- av_hwdevice_find_type_by_name(ctx->device_type),
- avctx->hw_device_ctx, 0);
- if (err < 0)
- return err;
- } else {
- ctx->hwdevice_ref = av_buffer_ref(avctx->hw_device_ctx);
- if (!ctx->hwdevice_ref)
- return AVERROR(ENOMEM);
- }
- } else {
+ if (!avctx->hw_device_ctx) {
av_log(ctx, AV_LOG_ERROR, "A hardware device reference is required "
"to upload frames to.\n");
return AVERROR(EINVAL);
}
+ if (ctx->device_type) {
+ err = av_hwdevice_ctx_create_derived(
+ &ctx->hwdevice_ref,
+ av_hwdevice_find_type_by_name(ctx->device_type),
+ avctx->hw_device_ctx, 0);
+ if (err < 0)
+ return err;
+ } else {
+ ctx->hwdevice_ref = av_buffer_ref(avctx->hw_device_ctx);
+ if (!ctx->hwdevice_ref)
+ return AVERROR(ENOMEM);
+ }
+
+ return 0;
+}
+
+static int hwupload_query_formats(AVFilterContext *avctx)
+{
+ HWUploadContext *ctx = avctx->priv;
+ AVHWFramesConstraints *constraints = NULL;
+ const enum AVPixelFormat *input_pix_fmts, *output_pix_fmts;
+ AVFilterFormats *input_formats = NULL;
+ int err, i;
+
constraints = av_hwdevice_get_hwframe_constraints(ctx->hwdevice_ref, NULL);
if (!constraints) {
err = AVERROR(EINVAL);
@@ -251,6 +257,7 @@ static const AVFilterPad hwupload_outputs[] = {
const AVFilter ff_vf_hwupload = {
.name = "hwupload",
.description = NULL_IF_CONFIG_SMALL("Upload a normal frame to a hardware frame"),
+ .init = hwupload_init,
.uninit = hwupload_uninit,
.priv_size = sizeof(HWUploadContext),
.priv_class = &hwupload_class,
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 4/5] avfilter/libplacebo: move hwctx init to init()
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 14:53 ` [FFmpeg-devel] [PATCH 3/5] avfilter/hwupload: move hwctx init to init() Niklas Haas
@ 2024-02-09 14:53 ` 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
4 siblings, 0 replies; 8+ messages in thread
From: Niklas Haas @ 2024-02-09 14:53 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Niklas Haas
From: Niklas Haas <git@haasn.dev>
---
libavfilter/vf_libplacebo.c | 24 +++++++++++-------------
1 file changed, 11 insertions(+), 13 deletions(-)
diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c
index a9a3d884ce..f41d8be0c0 100644
--- a/libavfilter/vf_libplacebo.c
+++ b/libavfilter/vf_libplacebo.c
@@ -544,6 +544,7 @@ static int parse_shader(AVFilterContext *avctx, const void *shader, size_t len)
static void libplacebo_uninit(AVFilterContext *avctx);
static int libplacebo_config_input(AVFilterLink *inlink);
+static int init_vulkan(AVFilterContext *avctx);
static int libplacebo_init(AVFilterContext *avctx)
{
@@ -610,8 +611,7 @@ static int libplacebo_init(AVFilterContext *avctx)
if (strcmp(s->fps_string, "none") != 0)
RET(av_parse_video_rate(&s->fps, s->fps_string));
- /* Note: s->vulkan etc. are initialized later, when hwctx is available */
- return 0;
+ return init_vulkan(avctx);
fail:
return err;
@@ -656,13 +656,20 @@ static void input_uninit(LibplaceboInput *input)
av_fifo_freep2(&input->out_pts);
}
-static int init_vulkan(AVFilterContext *avctx, const AVVulkanDeviceContext *hwctx)
+static int init_vulkan(AVFilterContext *avctx)
{
int err = 0;
LibplaceboContext *s = avctx->priv;
+ const AVVulkanDeviceContext *hwctx = NULL;
uint8_t *buf = NULL;
size_t buf_len;
+ if (avctx->hw_device_ctx) {
+ const AVHWDeviceContext *avhwctx = (void *) avctx->hw_device_ctx->data;
+ if (avhwctx->type == AV_HWDEVICE_TYPE_VULKAN)
+ hwctx = s->vkctx.hwctx = avhwctx->hwctx;
+ }
+
if (hwctx) {
#if PL_API_VER >= 278
/* Import libavfilter vulkan context into libplacebo */
@@ -1127,18 +1134,9 @@ static int libplacebo_query_format(AVFilterContext *ctx)
{
int err;
LibplaceboContext *s = ctx->priv;
- const AVVulkanDeviceContext *vkhwctx = NULL;
const AVPixFmtDescriptor *desc = NULL;
AVFilterFormats *infmts = NULL, *outfmts = NULL;
- if (ctx->hw_device_ctx) {
- const AVHWDeviceContext *avhwctx = (void *) ctx->hw_device_ctx->data;
- if (avhwctx->type == AV_HWDEVICE_TYPE_VULKAN)
- vkhwctx = avhwctx->hwctx;
- }
-
- RET(init_vulkan(ctx, vkhwctx));
-
while ((desc = av_pix_fmt_desc_next(desc))) {
enum AVPixelFormat pixfmt = av_pix_fmt_desc_get_id(desc);
@@ -1150,7 +1148,7 @@ static int libplacebo_query_format(AVFilterContext *ctx)
#endif
if (pixfmt == AV_PIX_FMT_VULKAN) {
- if (!vkhwctx || vkhwctx->act_dev != s->vulkan->device)
+ if (!s->vkctx.hwctx || s->vkctx.hwctx->act_dev != s->vulkan->device)
continue;
}
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* [FFmpeg-devel] [PATCH 5/5] avfilter/vsrc_ddagrab: move hwctx init to init()
2024-02-09 14:53 [FFmpeg-devel] [PATCH 1/5] avfilter: tighten semantics on hw_device_ctx Niklas Haas
` (2 preceding siblings ...)
2024-02-09 14:53 ` [FFmpeg-devel] [PATCH 4/5] avfilter/libplacebo: " Niklas Haas
@ 2024-02-09 14:53 ` Niklas Haas
2024-02-09 16:53 ` [FFmpeg-devel] [PATCH 1/5] avfilter: tighten semantics on hw_device_ctx Anton Khirnov
4 siblings, 0 replies; 8+ messages in thread
From: Niklas Haas @ 2024-02-09 14:53 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Niklas Haas
From: Niklas Haas <git@haasn.dev>
Not as strongly motivated as the previous commits, but there's still no
reason to do this from config_props if we can avoid it.
---
libavfilter/vsrc_ddagrab.c | 99 ++++++++++++++++++--------------------
1 file changed, 48 insertions(+), 51 deletions(-)
diff --git a/libavfilter/vsrc_ddagrab.c b/libavfilter/vsrc_ddagrab.c
index 51e928d785..c89eff6e5a 100644
--- a/libavfilter/vsrc_ddagrab.c
+++ b/libavfilter/vsrc_ddagrab.c
@@ -445,7 +445,54 @@ static av_cold int ddagrab_init(AVFilterContext *avctx)
dda->mouse_x = -1;
dda->mouse_y = -1;
- return 0;
+ /* Init hardware context */
+ if (avctx->hw_device_ctx) {
+ dda->device_ctx = (AVHWDeviceContext*)avctx->hw_device_ctx->data;
+
+ if (dda->device_ctx->type != AV_HWDEVICE_TYPE_D3D11VA) {
+ av_log(avctx, AV_LOG_ERROR, "Non-D3D11VA input hw_device_ctx\n");
+ return AVERROR(EINVAL);
+ }
+
+ dda->device_ref = av_buffer_ref(avctx->hw_device_ctx);
+ if (!dda->device_ref)
+ return AVERROR(ENOMEM);
+
+ av_log(avctx, AV_LOG_VERBOSE, "Using provided hw_device_ctx\n");
+ } else {
+ ret = av_hwdevice_ctx_create(&dda->device_ref, AV_HWDEVICE_TYPE_D3D11VA, NULL, NULL, 0);
+ if (ret < 0) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to create D3D11VA device.\n");
+ return ret;
+ }
+
+ dda->device_ctx = (AVHWDeviceContext*)dda->device_ref->data;
+
+ av_log(avctx, AV_LOG_VERBOSE, "Created internal hw_device_ctx\n");
+ }
+
+ dda->device_hwctx = (AVD3D11VADeviceContext*)dda->device_ctx->hwctx;
+
+ ret = init_dxgi_dda(avctx);
+ if (ret < 0)
+ return ret;
+
+ ret = probe_output_format(avctx);
+ if (ret < 0)
+ return ret;
+
+ if (dda->out_fmt && dda->raw_format != dda->out_fmt && (!dda->allow_fallback || dda->force_fmt)) {
+ av_log(avctx, AV_LOG_ERROR, "Requested output format unavailable.\n");
+ return AVERROR(ENOTSUP);
+ }
+
+ if (dda->draw_mouse) {
+ ret = init_render_resources(avctx);
+ if (ret < 0)
+ return ret;
+ }
+
+ return init_hwframes_ctx(avctx);
}
static int create_d3d11_pointer_tex(AVFilterContext *avctx,
@@ -814,46 +861,6 @@ static int ddagrab_config_props(AVFilterLink *outlink)
DdagrabContext *dda = avctx->priv;
int ret;
- if (avctx->hw_device_ctx) {
- dda->device_ctx = (AVHWDeviceContext*)avctx->hw_device_ctx->data;
-
- if (dda->device_ctx->type != AV_HWDEVICE_TYPE_D3D11VA) {
- av_log(avctx, AV_LOG_ERROR, "Non-D3D11VA input hw_device_ctx\n");
- return AVERROR(EINVAL);
- }
-
- dda->device_ref = av_buffer_ref(avctx->hw_device_ctx);
- if (!dda->device_ref)
- return AVERROR(ENOMEM);
-
- av_log(avctx, AV_LOG_VERBOSE, "Using provided hw_device_ctx\n");
- } else {
- ret = av_hwdevice_ctx_create(&dda->device_ref, AV_HWDEVICE_TYPE_D3D11VA, NULL, NULL, 0);
- if (ret < 0) {
- av_log(avctx, AV_LOG_ERROR, "Failed to create D3D11VA device.\n");
- return ret;
- }
-
- dda->device_ctx = (AVHWDeviceContext*)dda->device_ref->data;
-
- av_log(avctx, AV_LOG_VERBOSE, "Created internal hw_device_ctx\n");
- }
-
- dda->device_hwctx = (AVD3D11VADeviceContext*)dda->device_ctx->hwctx;
-
- ret = init_dxgi_dda(avctx);
- if (ret < 0)
- return ret;
-
- ret = probe_output_format(avctx);
- if (ret < 0)
- return ret;
-
- if (dda->out_fmt && dda->raw_format != dda->out_fmt && (!dda->allow_fallback || dda->force_fmt)) {
- av_log(avctx, AV_LOG_ERROR, "Requested output format unavailable.\n");
- return AVERROR(ENOTSUP);
- }
-
dda->width -= FFMAX(dda->width - dda->raw_width + dda->offset_x, 0);
dda->height -= FFMAX(dda->height - dda->raw_height + dda->offset_y, 0);
@@ -861,16 +868,6 @@ static int ddagrab_config_props(AVFilterLink *outlink)
dda->time_frame = av_gettime_relative() / av_q2d(dda->time_base);
dda->time_timeout = av_rescale_q(1, dda->time_base, (AVRational) { 1, 1000 }) / 2;
- if (dda->draw_mouse) {
- ret = init_render_resources(avctx);
- if (ret < 0)
- return ret;
- }
-
- ret = init_hwframes_ctx(avctx);
- if (ret < 0)
- return ret;
-
outlink->hw_frames_ctx = av_buffer_ref(dda->frames_ref);
if (!outlink->hw_frames_ctx)
return AVERROR(ENOMEM);
--
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-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/5] avfilter: tighten semantics on hw_device_ctx
2024-02-09 14:53 [FFmpeg-devel] [PATCH 1/5] avfilter: tighten semantics on hw_device_ctx Niklas Haas
` (3 preceding siblings ...)
2024-02-09 14:53 ` [FFmpeg-devel] [PATCH 5/5] avfilter/vsrc_ddagrab: " Niklas Haas
@ 2024-02-09 16:53 ` Anton Khirnov
4 siblings, 0 replies; 8+ messages in thread
From: Anton Khirnov @ 2024-02-09 16:53 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Niklas Haas
Quoting Niklas Haas (2024-02-09 15:53:45)
> From: Niklas Haas <git@haasn.dev>
>
> Currently, such filters defer hardware device initialization to
> query_formats(), which is not really the correct place to have it. It
> would be far more logical for these filters to create the hardware
> context at init time, and error out otherwise.
>
> By contrast, filters which merely receive or process hardware frames
> typically do this at link config time, because they do not need access
> to the hwframe specifics in order to query supported formats.
>
> The intention here is to specifically stop creating hardware devices in
> query_formats.
> ---
> libavfilter/avfilter.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
> index 246d000251..b6adcf2473 100644
> --- a/libavfilter/avfilter.h
> +++ b/libavfilter/avfilter.h
> @@ -464,7 +464,8 @@ struct AVFilterContext {
> *
> * May be set by the caller on filters flagged with AVFILTER_FLAG_HWDEVICE
> * before initializing the filter with avfilter_init_str() or
> - * avfilter_init_dict().
> + * avfilter_init_dict(). *Must* be set for filters which do not have another
> + * way of obtaining a hardware device context (e.g. from an input link).
This now reads as if the user is required to set this field for any
AVFILTER_FLAG_HWDEVICE filter, which is not true.
IMO the text already requires callers to set it before init, so there's
no need to change anything.
--
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/5] fftools/ffmpeg_filter: provide hwctx when probing graph
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
0 siblings, 0 replies; 8+ messages in thread
From: Anton Khirnov @ 2024-02-09 17:12 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Niklas Haas
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/5] avfilter/hwupload: move hwctx init to init()
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
0 siblings, 0 replies; 8+ messages in thread
From: Anton Khirnov @ 2024-02-09 17:17 UTC (permalink / raw)
To: FFmpeg development discussions and patches; +Cc: Niklas Haas
Quoting Niklas Haas (2024-02-09 15:53:47)
> From: Niklas Haas <git@haasn.dev>
>
> ---
> libavfilter/vf_hwupload.c | 49 ++++++++++++++++++++++-----------------
> 1 file changed, 28 insertions(+), 21 deletions(-)
LGTM
--
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".
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-02-09 17:17 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
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