aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/vf_hwupload.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_hwupload.c
parentce24b5ba8f8d61eae518809e1188f74614db73d5 (diff)
downloadffmpeg-7f17e0e6dd0b28b29295c1eeb1a38546eebc3946.tar.gz
lavfi: move AVFilterLink.hw_frames_ctx to FilterLink
Diffstat (limited to 'libavfilter/vf_hwupload.c')
-rw-r--r--libavfilter/vf_hwupload.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/libavfilter/vf_hwupload.c b/libavfilter/vf_hwupload.c
index ef61bb4137..9c11e72759 100644
--- a/libavfilter/vf_hwupload.c
+++ b/libavfilter/vf_hwupload.c
@@ -24,6 +24,7 @@
#include "libavutil/opt.h"
#include "avfilter.h"
+#include "filters.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
@@ -106,8 +107,10 @@ fail:
static int hwupload_config_output(AVFilterLink *outlink)
{
+ FilterLink *outl = ff_filter_link(outlink);
AVFilterContext *avctx = outlink->src;
AVFilterLink *inlink = avctx->inputs[0];
+ FilterLink *inl = ff_filter_link(inlink);
HWUploadContext *ctx = avctx->priv;
int err;
@@ -116,13 +119,13 @@ static int hwupload_config_output(AVFilterLink *outlink)
if (inlink->format == outlink->format) {
// The input is already a hardware format, so we just want to
// pass through the input frames in their own hardware context.
- if (!inlink->hw_frames_ctx) {
+ if (!inl->hw_frames_ctx) {
av_log(ctx, AV_LOG_ERROR, "No input hwframe context.\n");
return AVERROR(EINVAL);
}
- outlink->hw_frames_ctx = av_buffer_ref(inlink->hw_frames_ctx);
- if (!outlink->hw_frames_ctx)
+ outl->hw_frames_ctx = av_buffer_ref(inl->hw_frames_ctx);
+ if (!outl->hw_frames_ctx)
return AVERROR(ENOMEM);
return 0;
@@ -138,9 +141,9 @@ static int hwupload_config_output(AVFilterLink *outlink)
av_get_pix_fmt_name(inlink->format));
ctx->hwframes->format = outlink->format;
- if (inlink->hw_frames_ctx) {
+ if (inl->hw_frames_ctx) {
AVHWFramesContext *in_hwframe_ctx =
- (AVHWFramesContext*)inlink->hw_frames_ctx->data;
+ (AVHWFramesContext*)inl->hw_frames_ctx->data;
ctx->hwframes->sw_format = in_hwframe_ctx->sw_format;
} else {
ctx->hwframes->sw_format = inlink->format;
@@ -155,8 +158,8 @@ static int hwupload_config_output(AVFilterLink *outlink)
if (err < 0)
goto fail;
- outlink->hw_frames_ctx = av_buffer_ref(ctx->hwframes_ref);
- if (!outlink->hw_frames_ctx) {
+ outl->hw_frames_ctx = av_buffer_ref(ctx->hwframes_ref);
+ if (!outl->hw_frames_ctx) {
err = AVERROR(ENOMEM);
goto fail;
}