[FFmpeg-devel] [PATCH 2/2] avcodec/utils: Warn if a encoder is missing the pix_fmts or sample_fmts list

Michael Niedermayer michael at niedermayer.cc
Sun Feb 28 00:17:36 CET 2016


This would require listing supported formats for rawvideo and wrapped_avframe

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/utils.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 2690d0d..267c973 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -188,6 +188,11 @@ av_cold void avcodec_register(AVCodec *codec)
 
     if (codec->init_static_data)
         codec->init_static_data(codec);
+
+    if (av_codec_is_encoder(codec) && codec->type == AVMEDIA_TYPE_VIDEO && !codec->pix_fmts)
+        av_log(NULL, AV_LOG_WARNING, "Encoder %s is missing the pix_fmts field\n", codec->name);
+    if (av_codec_is_encoder(codec) && codec->type == AVMEDIA_TYPE_AUDIO  && !codec->sample_fmts)
+        av_log(NULL, AV_LOG_WARNING, "Encoder %s is missing the sample_fmts field\n", codec->name);
 }
 
 #if FF_API_EMU_EDGE
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list