[FFmpeg-cvslog] avcodec/nvenc: add compile time check for outputRecoveryPointSEI for HEVC

James Almer git at videolan.org
Tue Feb 4 15:40:07 EET 2025


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Feb  4 10:30:34 2025 -0300| [873204e6e4173e42e6eb606cd5ea52c5b0e670e2] | committer: James Almer

avcodec/nvenc: add compile time check for outputRecoveryPointSEI for HEVC

Fixes compilation when using API headers older than 12.0

Reviewed-by: Martin Storsjö <martin at martin.st>
Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavcodec/nvenc.c | 2 ++
 libavcodec/nvenc.h | 5 +++++
 2 files changed, 7 insertions(+)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index c359c2bc8a..1f6b670c1b 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1462,7 +1462,9 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
         hevc->intraRefreshPeriod = cc->gopLength;
         hevc->intraRefreshCnt = cc->gopLength - 1;
         cc->gopLength = NVENC_INFINITE_GOPLENGTH;
+#ifdef NVENC_HAVE_HEVC_OUTPUT_RECOVERY_POINT_SEI
         hevc->outputRecoveryPointSEI = 1;
+#endif
 #ifdef NVENC_HAVE_SINGLE_SLICE_INTRA_REFRESH
         hevc->singleSliceIntraRefresh = ctx->single_slice_intra_refresh;
 #endif
diff --git a/libavcodec/nvenc.h b/libavcodec/nvenc.h
index 341a242cf7..55a95f8399 100644
--- a/libavcodec/nvenc.h
+++ b/libavcodec/nvenc.h
@@ -78,6 +78,11 @@ typedef void ID3D11Device;
 #define NVENC_HAVE_SINGLE_SLICE_INTRA_REFRESH
 #endif
 
+// SDK 12.0 compile time feature checks
+#if NVENCAPI_CHECK_VERSION(12, 0)
+#define NVENC_HAVE_HEVC_OUTPUT_RECOVERY_POINT_SEI
+#endif
+
 // SDK 12.1 compile time feature checks
 #if NVENCAPI_CHECK_VERSION(12, 1)
 #define NVENC_NO_DEPRECATED_RC



More information about the ffmpeg-cvslog mailing list