summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc_hevc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-01-07 07:58:24 +0100
committerAnton Khirnov <anton@khirnov.net>2016-01-12 09:23:34 +0100
commitee359c72ef8735122929da96006565e1558f1e55 (patch)
treed464c29c3cd8450f96bafa471f3b02af256c26e9 /libavcodec/nvenc_hevc.c
parent39571e86cb0d55536f649210a025c54e440c632b (diff)
nvenc: rename encoders
Change 'nvenc_<codec>' to '<codec>_nvenc', which is consistent with other similar decoders and encoders (QSV, MMAL).
Diffstat (limited to 'libavcodec/nvenc_hevc.c')
-rw-r--r--libavcodec/nvenc_hevc.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index 58bde7731e..2a6919797e 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -89,7 +89,7 @@ static const AVCodecDefault defaults[] = {
};
AVCodec ff_hevc_nvenc_encoder = {
- .name = "nvenc_hevc",
+ .name = "hevc_nvenc",
.long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC HEVC encoder"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_HEVC,
@@ -106,3 +106,38 @@ AVCodec ff_hevc_nvenc_encoder = {
.capabilities = AV_CODEC_CAP_DELAY,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};
+
+#if FF_API_NVENC_OLD_NAME
+
+static int nvenc_old_init(AVCodecContext *avctx)
+{
+ av_log(avctx, AV_LOG_WARNING, "This encoder is deprecated, use 'hevc_nvenc' instead\n");
+ return ff_nvenc_encode_init(avctx);
+}
+
+static const AVClass nvenc_hevc_old_class = {
+ .class_name = "nvenc_hevc",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_nvenc_hevc_encoder = {
+ .name = "nvenc_hevc",
+ .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC HEVC encoder"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_HEVC,
+ .init = nvenc_old_init,
+ .encode2 = ff_nvenc_encode_frame,
+ .close = ff_nvenc_encode_close,
+ .priv_data_size = sizeof(NVENCContext),
+ .priv_class = &nvenc_hevc_old_class,
+ .defaults = defaults,
+ .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12,
+ AV_PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_NONE },
+ .capabilities = AV_CODEC_CAP_DELAY,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
+};
+#endif