This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/8.0
in repository ffmpeg.

commit 938c25c067e95da01cc6a3d192fa6ade86cca7af
Author:     James Almer <[email protected]>
AuthorDate: Fri Mar 27 19:31:38 2026 -0300
Commit:     Timo Rothenpieler <[email protected]>
CommitDate: Thu Oct 8 21:33:25 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 d94232081c..fc2e8fe281 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -686,6 +686,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 6cafb48cd1..06a57ae0c4 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 7c29f25718..251c2cf875 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 ccba249140..52c2edc4b9 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]

Reply via email to