aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_thumbnail_cuda.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-08-05 18:00:30 +0200
committerAnton Khirnov <anton@khirnov.net>2024-08-15 19:34:24 +0200
commit7f17e0e6dd0b28b29295c1eeb1a38546eebc3946 (patch)
tree450c2507aab591b2428f63f0860be3c9fa155846 /libavfilter/vf_thumbnail_cuda.c
parentce24b5ba8f8d61eae518809e1188f74614db73d5 (diff)
downloadffmpeg-7f17e0e6dd0b28b29295c1eeb1a38546eebc3946.tar.gz
lavfi: move AVFilterLink.hw_frames_ctx to FilterLink
Diffstat (limited to 'libavfilter/vf_thumbnail_cuda.c')
-rw-r--r--libavfilter/vf_thumbnail_cuda.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavfilter/vf_thumbnail_cuda.c b/libavfilter/vf_thumbnail_cuda.c
index 8efb54f079..be27d85dc7 100644
--- a/libavfilter/vf_thumbnail_cuda.c
+++ b/libavfilter/vf_thumbnail_cuda.c
@@ -28,6 +28,7 @@
#include "libavutil/pixdesc.h"
#include "avfilter.h"
+#include "filters.h"
#include "internal.h"
#include "cuda/load_helper.h"
@@ -358,8 +359,10 @@ static int format_is_supported(enum AVPixelFormat fmt)
static int config_props(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
+ FilterLink *inl = ff_filter_link(inlink);
+ FilterLink *outl = ff_filter_link(ctx->outputs[0]);
ThumbnailCudaContext *s = ctx->priv;
- AVHWFramesContext *hw_frames_ctx = (AVHWFramesContext*)inlink->hw_frames_ctx->data;
+ AVHWFramesContext *hw_frames_ctx = (AVHWFramesContext*)inl->hw_frames_ctx->data;
AVCUDADeviceContext *device_hwctx = hw_frames_ctx->device_ctx->hwctx;
CUcontext dummy, cuda_ctx = device_hwctx->cuda_ctx;
CudaFunctions *cu = device_hwctx->internal->cuda_dl;
@@ -401,10 +404,10 @@ static int config_props(AVFilterLink *inlink)
CHECK_CU(cu->cuCtxPopCurrent(&dummy));
- s->hw_frames_ctx = ctx->inputs[0]->hw_frames_ctx;
+ s->hw_frames_ctx = inl->hw_frames_ctx;
- ctx->outputs[0]->hw_frames_ctx = av_buffer_ref(s->hw_frames_ctx);
- if (!ctx->outputs[0]->hw_frames_ctx)
+ outl->hw_frames_ctx = av_buffer_ref(s->hw_frames_ctx);
+ if (!outl->hw_frames_ctx)
return AVERROR(ENOMEM);
s->tb = inlink->time_base;