diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-08-05 18:00:30 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-08-15 19:34:24 +0200 |
commit | 7f17e0e6dd0b28b29295c1eeb1a38546eebc3946 (patch) | |
tree | 450c2507aab591b2428f63f0860be3c9fa155846 /libavfilter/vf_transpose_vt.c | |
parent | ce24b5ba8f8d61eae518809e1188f74614db73d5 (diff) | |
download | ffmpeg-7f17e0e6dd0b28b29295c1eeb1a38546eebc3946.tar.gz |
lavfi: move AVFilterLink.hw_frames_ctx to FilterLink
Diffstat (limited to 'libavfilter/vf_transpose_vt.c')
-rw-r--r-- | libavfilter/vf_transpose_vt.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/libavfilter/vf_transpose_vt.c b/libavfilter/vf_transpose_vt.c index e0f35fdb5a..72bab3d53b 100644 --- a/libavfilter/vf_transpose_vt.c +++ b/libavfilter/vf_transpose_vt.c @@ -24,6 +24,8 @@ #include "libavutil/hwcontext_videotoolbox.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" + +#include "filters.h" #include "internal.h" #include "transpose.h" #include "video.h" @@ -105,17 +107,19 @@ fail: static int transpose_vt_recreate_hw_ctx(AVFilterLink *outlink) { + FilterLink *outl = ff_filter_link(outlink); AVFilterContext *avctx = outlink->src; AVFilterLink *inlink = outlink->src->inputs[0]; + FilterLink *inl = ff_filter_link(inlink); AVHWFramesContext *hw_frame_ctx_in; AVHWFramesContext *hw_frame_ctx_out; int err; - av_buffer_unref(&outlink->hw_frames_ctx); + av_buffer_unref(&outl->hw_frames_ctx); - hw_frame_ctx_in = (AVHWFramesContext *)inlink->hw_frames_ctx->data; - outlink->hw_frames_ctx = av_hwframe_ctx_alloc(hw_frame_ctx_in->device_ref); - hw_frame_ctx_out = (AVHWFramesContext *)outlink->hw_frames_ctx->data; + hw_frame_ctx_in = (AVHWFramesContext *)inl->hw_frames_ctx->data; + outl->hw_frames_ctx = av_hwframe_ctx_alloc(hw_frame_ctx_in->device_ref); + hw_frame_ctx_out = (AVHWFramesContext *)outl->hw_frames_ctx->data; hw_frame_ctx_out->format = AV_PIX_FMT_VIDEOTOOLBOX; hw_frame_ctx_out->sw_format = hw_frame_ctx_in->sw_format; hw_frame_ctx_out->width = outlink->w; @@ -125,7 +129,7 @@ static int transpose_vt_recreate_hw_ctx(AVFilterLink *outlink) if (err < 0) return err; - err = av_hwframe_ctx_init(outlink->hw_frames_ctx); + err = av_hwframe_ctx_init(outl->hw_frames_ctx); if (err < 0) { av_log(avctx, AV_LOG_ERROR, "Failed to init videotoolbox frame context, %s\n", @@ -139,16 +143,18 @@ static int transpose_vt_recreate_hw_ctx(AVFilterLink *outlink) static int transpose_vt_config_output(AVFilterLink *outlink) { int err; + FilterLink *outl = ff_filter_link(outlink); AVFilterContext *avctx = outlink->src; TransposeVtContext *s = avctx->priv; AVFilterLink *inlink = outlink->src->inputs[0]; + FilterLink *inl = ff_filter_link(inlink); CFStringRef rotation = kVTRotation_0; CFBooleanRef vflip = kCFBooleanFalse; CFBooleanRef hflip = kCFBooleanFalse; int swap_w_h = 0; - av_buffer_unref(&outlink->hw_frames_ctx); - outlink->hw_frames_ctx = av_buffer_ref(inlink->hw_frames_ctx); + av_buffer_unref(&outl->hw_frames_ctx); + outl->hw_frames_ctx = av_buffer_ref(inl->hw_frames_ctx); if ((inlink->w >= inlink->h && s->passthrough == TRANSPOSE_PT_TYPE_LANDSCAPE) || (inlink->w <= inlink->h && s->passthrough == TRANSPOSE_PT_TYPE_PORTRAIT)) { |