[FFmpeg-cvslog] avcodec/nvenc: use AVCodecContext.get_encode_buffer()

James Almer git at videolan.org
Wed Mar 17 18:54:09 EET 2021


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Mar 12 20:50:01 2021 -0300| [238e08b12e2e2da55d86a113259c4444e9541955] | committer: James Almer

avcodec/nvenc: use AVCodecContext.get_encode_buffer()

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=238e08b12e2e2da55d86a113259c4444e9541955
---

 libavcodec/nvenc.c      | 2 +-
 libavcodec/nvenc_h264.c | 2 +-
 libavcodec/nvenc_hevc.c | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index fbf55ebc9d..dddee8cac1 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1971,7 +1971,7 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur
         goto error;
     }
 
-    res = av_new_packet(pkt, lock_params.bitstreamSizeInBytes);
+    res = ff_get_encode_buffer(avctx, pkt, lock_params.bitstreamSizeInBytes, 0);
 
     if (res < 0) {
         p_nvenc->nvEncUnlockBitstream(ctx->nvencoder, tmpoutsurf->output_surface);
diff --git a/libavcodec/nvenc_h264.c b/libavcodec/nvenc_h264.c
index 4c118d3138..4c2585876e 100644
--- a/libavcodec/nvenc_h264.c
+++ b/libavcodec/nvenc_h264.c
@@ -287,7 +287,7 @@ AVCodec ff_h264_nvenc_encoder = {
     .priv_class     = &h264_nvenc_class,
     .defaults       = defaults,
     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
-                      AV_CODEC_CAP_ENCODER_FLUSH,
+                      AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1,
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .pix_fmts       = ff_nvenc_pix_fmts,
     .wrapper_name   = "nvenc",
diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index 031d2ef44e..441e7871d2 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -237,7 +237,7 @@ AVCodec ff_hevc_nvenc_encoder = {
     .defaults       = defaults,
     .pix_fmts       = ff_nvenc_pix_fmts,
     .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
-                      AV_CODEC_CAP_ENCODER_FLUSH,
+                      AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1,
     .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
     .wrapper_name   = "nvenc",
     .hw_configs     = ff_nvenc_hw_configs,



More information about the ffmpeg-cvslog mailing list