]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/nvenc_h264.c
avformat/avio: Add Metacube support
[ffmpeg] / libavcodec / nvenc_h264.c
index 750ff33c2e60ce1f40ccf6f7dc49ce29ee589090..5ad6b358366f4f7e4ef0cb62cc54a4a9042d066e 100644 (file)
@@ -193,80 +193,11 @@ static const AVCodecDefault defaults[] = {
     { "qblur", "-1" },
     { "qcomp", "-1" },
     { "g", "250" },
-    { "bf", "0" },
+    { "bf", "-1" },
     { "refs", "0" },
     { 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",
-    .item_name = av_default_item_name,
-    .option = options,
-    .version = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_nvenc_encoder = {
-    .name           = "nvenc",
-    .long_name      = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H.264 encoder"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H264,
-    .init           = nvenc_old_init,
-    .receive_packet = ff_nvenc_receive_packet,
-    .close          = ff_nvenc_encode_close,
-    .flush          = ff_nvenc_encode_flush,
-    .priv_data_size = sizeof(NvencContext),
-    .priv_class     = &nvenc_class,
-    .defaults       = defaults,
-    .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
-                      AV_CODEC_CAP_ENCODER_FLUSH,
-    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
-    .pix_fmts       = ff_nvenc_pix_fmts,
-    .wrapper_name   = "nvenc",
-    .hw_configs     = ff_nvenc_hw_configs,
-};
-#endif
-
-/* Add an alias for nvenc_h264 */
-#if CONFIG_NVENC_H264_ENCODER
-static const AVClass nvenc_h264_class = {
-    .class_name = "nvenc_h264",
-    .item_name = av_default_item_name,
-    .option = options,
-    .version = LIBAVUTIL_VERSION_INT,
-};
-
-AVCodec ff_nvenc_h264_encoder = {
-    .name           = "nvenc_h264",
-    .long_name      = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H.264 encoder"),
-    .type           = AVMEDIA_TYPE_VIDEO,
-    .id             = AV_CODEC_ID_H264,
-    .init           = nvenc_old_init,
-    .receive_packet = ff_nvenc_receive_packet,
-    .close          = ff_nvenc_encode_close,
-    .flush          = ff_nvenc_encode_flush,
-    .priv_data_size = sizeof(NvencContext),
-    .priv_class     = &nvenc_h264_class,
-    .defaults       = defaults,
-    .capabilities   = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE |
-                      AV_CODEC_CAP_ENCODER_FLUSH,
-    .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
-    .pix_fmts       = ff_nvenc_pix_fmts,
-    .wrapper_name   = "nvenc",
-    .hw_configs     = ff_nvenc_hw_configs,
-};
-#endif
-
-#endif
-
 static const AVClass h264_nvenc_class = {
     .class_name = "h264_nvenc",
     .item_name = av_default_item_name,
@@ -274,7 +205,7 @@ static const AVClass h264_nvenc_class = {
     .version = LIBAVUTIL_VERSION_INT,
 };
 
-AVCodec ff_h264_nvenc_encoder = {
+const AVCodec ff_h264_nvenc_encoder = {
     .name           = "h264_nvenc",
     .long_name      = NULL_IF_CONFIG_SMALL("NVIDIA NVENC H.264 encoder"),
     .type           = AVMEDIA_TYPE_VIDEO,
@@ -287,7 +218,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",