Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: ArazIusubov via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: ArazIusubov <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] avcodec/d3d12va_encode: support pre-codec get codec data (PR #20740)
Date: Thu, 23 Oct 2025 14:44:26 -0000
Message-ID: <176123066669.25.1247236056010427646@7d278768979e> (raw)

PR #20740 opened by ArazIusubov
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20740
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20740.patch


>From 52bdbbc48ba6a35a5ecae850244833635959ea79 Mon Sep 17 00:00:00 2001
From: Araz Iusubov <Primeadvice@gmail.com>
Date: Thu, 23 Oct 2025 16:40:50 +0200
Subject: [PATCH] avcodec/d3d12va_encode: support pre-codec get codec data

---
 libavcodec/d3d12va_encode.c | 6 +++++-
 libavcodec/d3d12va_encode.h | 5 +++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavcodec/d3d12va_encode.c b/libavcodec/d3d12va_encode.c
index 4a8672a359..a7151af121 100644
--- a/libavcodec/d3d12va_encode.c
+++ b/libavcodec/d3d12va_encode.c
@@ -732,6 +732,7 @@ end:
 static int d3d12va_encode_output(AVCodecContext *avctx,
                                  FFHWBaseEncodePicture *base_pic, AVPacket *pkt)
 {
+    D3D12VAEncodeContext* ctx = avctx->priv_data;
     FFHWBaseEncodeContext *base_ctx = avctx->priv_data;
     D3D12VAEncodePicture *pic = base_pic->priv;
     AVPacket *pkt_ptr = pkt;
@@ -741,7 +742,10 @@ static int d3d12va_encode_output(AVCodecContext *avctx,
     if (err < 0)
         return err;
 
-    err = d3d12va_encode_get_coded_data(avctx, pic, pkt);
+    if (ctx->codec->get_coded_data)
+        err = ctx->codec->get_coded_data(avctx, pic, pkt);
+    else
+        err = d3d12va_encode_get_coded_data(avctx, pic, pkt);
     if (err < 0)
         return err;
 
diff --git a/libavcodec/d3d12va_encode.h b/libavcodec/d3d12va_encode.h
index 5bd1eedb7f..6d175cb028 100644
--- a/libavcodec/d3d12va_encode.h
+++ b/libavcodec/d3d12va_encode.h
@@ -327,6 +327,11 @@ typedef struct D3D12VAEncodeType {
      */
     int (*write_sequence_header)(AVCodecContext *avctx,
                                  char *data, size_t *data_len);
+    /**
+     * Fill the coded data into AVPacket
+     */
+    int (*get_coded_data)(AVCodecContext *avctx,
+                          D3D12VAEncodePicture *pic, AVPacket *pkt);
 } D3D12VAEncodeType;
 
 int ff_d3d12va_encode_receive_packet(AVCodecContext *avctx, AVPacket *pkt);
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2025-10-23 14:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=176123066669.25.1247236056010427646@7d278768979e \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git