This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch release/8.1 in repository ffmpeg.
commit e5f25f8e73874b8b8151c0f24f3e3e563dcc6ba7 Author: James Almer <[email protected]> AuthorDate: Fri Mar 27 19:31:38 2026 -0300 Commit: Timo Rothenpieler <[email protected]> CommitDate: Thu Oct 8 21:34:32 2026 +0200 avcodec/decode: add a hwaccel specific post_process callback to FrameDecodeData Leave the existing one for non decoder-specific, post processing usage. With this, scenarios like nvdec decoding can work algonside lcevc enhancement application. Signed-off-by: James Almer <[email protected]> --- libavcodec/decode.c | 8 ++++++++ libavcodec/decode.h | 4 ++++ libavcodec/nvdec.c | 2 +- libavcodec/videotoolbox.c | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index ba896b3908..353f647cf3 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -698,6 +698,14 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame, if (frame->private_ref) { FrameDecodeData *fdd = frame->private_ref; + if (fdd->hwaccel_priv_post_process) { + ret = fdd->hwaccel_priv_post_process(avctx, frame); + if (ret < 0) { + av_frame_unref(frame); + return ret; + } + } + if (fdd->post_process) { ret = fdd->post_process(avctx, frame); if (ret < 0) { diff --git a/libavcodec/decode.h b/libavcodec/decode.h index e4a250e7b8..2e5c65d53b 100644 --- a/libavcodec/decode.h +++ b/libavcodec/decode.h @@ -47,7 +47,11 @@ typedef struct FrameDecodeData { /** * Per-frame private data for hwaccels. + * + * Same as @ref post_process, but used only by some hwaccels to retrieve or + * finalize frames, and executed first. */ + int (*hwaccel_priv_post_process)(void *logctx, AVFrame *frame); void *hwaccel_priv; void (*hwaccel_priv_free)(void *priv); } FrameDecodeData; diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c index 787a9d7c28..0774fb4d5e 100644 --- a/libavcodec/nvdec.c +++ b/libavcodec/nvdec.c @@ -601,7 +601,7 @@ int ff_nvdec_start_frame(AVCodecContext *avctx, AVFrame *frame) fdd->hwaccel_priv = cf; fdd->hwaccel_priv_free = nvdec_fdd_priv_free; - fdd->post_process = nvdec_retrieve_data; + fdd->hwaccel_priv_post_process = nvdec_retrieve_data; return 0; fail: diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 2cd22cba1a..7d68a3cd4f 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -168,7 +168,7 @@ int ff_videotoolbox_alloc_frame(AVCodecContext *avctx, AVFrame *frame) frame->buf[0] = buf; fdd = frame->private_ref; - fdd->post_process = videotoolbox_postproc_frame; + fdd->hwaccel_priv_post_process = videotoolbox_postproc_frame; frame->width = avctx->width; frame->height = avctx->height; -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
