diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2016-06-25 22:24:13 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2016-06-25 23:05:17 +0200 |
commit | 888a5c794778a2f2aad22e9b4a3952dff92b11fa (patch) | |
tree | 166aa2d553bb1e33fc64ecda29e8de21d1c35507 /libavcodec/nvenc_hevc.c | |
parent | 6ee7adb881e4513ebacf76ba97d413fcbd6cf3e3 (diff) | |
download | ffmpeg-888a5c794778a2f2aad22e9b4a3952dff92b11fa.tar.gz |
avcodec/nvenc: Bring encoder names in line with other encoders
Diffstat (limited to 'libavcodec/nvenc_hevc.c')
-rw-r--r-- | libavcodec/nvenc_hevc.c | 49 |
1 files changed, 41 insertions, 8 deletions
diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c index cef19f7d71..1ce7c89a4b 100644 --- a/libavcodec/nvenc_hevc.c +++ b/libavcodec/nvenc_hevc.c @@ -83,13 +83,6 @@ static const AVOption options[] = { { NULL } }; -static const AVClass nvenc_hevc_class = { - .class_name = "nvenc_hevc", - .item_name = av_default_item_name, - .option = options, - .version = LIBAVUTIL_VERSION_INT, -}; - static const AVCodecDefault defaults[] = { { "b", "2M" }, { "qmin", "-1" }, @@ -102,12 +95,27 @@ static const AVCodecDefault defaults[] = { { NULL }, }; +#if FF_API_NVENC_OLD_NAME + +static av_cold 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_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 = ff_nvenc_encode_init, + .init = nvenc_old_init, .encode2 = ff_nvenc_encode_frame, .close = ff_nvenc_encode_close, .priv_data_size = sizeof(NvencContext), @@ -117,3 +125,28 @@ AVCodec ff_nvenc_hevc_encoder = { .capabilities = AV_CODEC_CAP_DELAY, .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, }; + +#endif + +static const AVClass hevc_nvenc_class = { + .class_name = "hevc_nvenc", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + +AVCodec ff_hevc_nvenc_encoder = { + .name = "hevc_nvenc", + .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC hevc encoder"), + .type = AVMEDIA_TYPE_VIDEO, + .id = AV_CODEC_ID_HEVC, + .init = ff_nvenc_encode_init, + .encode2 = ff_nvenc_encode_frame, + .close = ff_nvenc_encode_close, + .priv_data_size = sizeof(NvencContext), + .priv_class = &hevc_nvenc_class, + .defaults = defaults, + .pix_fmts = ff_nvenc_pix_fmts, + .capabilities = AV_CODEC_CAP_DELAY, + .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, +}; |