summaryrefslogtreecommitdiff
path: root/libavcodec/nvenc_h264.c
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2016-06-25 22:24:13 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2016-06-25 23:05:17 +0200
commit888a5c794778a2f2aad22e9b4a3952dff92b11fa (patch)
tree166aa2d553bb1e33fc64ecda29e8de21d1c35507 /libavcodec/nvenc_h264.c
parent6ee7adb881e4513ebacf76ba97d413fcbd6cf3e3 (diff)
avcodec/nvenc: Bring encoder names in line with other encoders
Diffstat (limited to 'libavcodec/nvenc_h264.c')
-rw-r--r--libavcodec/nvenc_h264.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/libavcodec/nvenc_h264.c b/libavcodec/nvenc_h264.c
index 19103f95d5..b576f15b36 100644
--- a/libavcodec/nvenc_h264.c
+++ b/libavcodec/nvenc_h264.c
@@ -98,6 +98,14 @@ 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 'h264_nvenc' instead\n");
+ return ff_nvenc_encode_init(avctx);
+}
+
#if CONFIG_NVENC_ENCODER
static const AVClass nvenc_class = {
.class_name = "nvenc",
@@ -111,7 +119,7 @@ AVCodec ff_nvenc_encoder = {
.long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H.264 encoder"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
- .init = ff_nvenc_encode_init,
+ .init = nvenc_old_init,
.encode2 = ff_nvenc_encode_frame,
.close = ff_nvenc_encode_close,
.priv_data_size = sizeof(NvencContext),
@@ -137,7 +145,7 @@ AVCodec ff_nvenc_h264_encoder = {
.long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H.264 encoder"),
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264,
- .init = ff_nvenc_encode_init,
+ .init = nvenc_old_init,
.encode2 = ff_nvenc_encode_frame,
.close = ff_nvenc_encode_close,
.priv_data_size = sizeof(NvencContext),
@@ -148,3 +156,28 @@ AVCodec ff_nvenc_h264_encoder = {
.pix_fmts = ff_nvenc_pix_fmts,
};
#endif
+
+#endif
+
+static const AVClass h264_nvenc_class = {
+ .class_name = "h264_nvenc",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
+AVCodec ff_h264_nvenc_encoder = {
+ .name = "h264_nvenc",
+ .long_name = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H.264 encoder"),
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = AV_CODEC_ID_H264,
+ .init = ff_nvenc_encode_init,
+ .encode2 = ff_nvenc_encode_frame,
+ .close = ff_nvenc_encode_close,
+ .priv_data_size = sizeof(NvencContext),
+ .priv_class = &h264_nvenc_class,
+ .defaults = defaults,
+ .capabilities = AV_CODEC_CAP_DELAY,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
+ .pix_fmts = ff_nvenc_pix_fmts,
+};