[FFmpeg-devel] [PATCH 2/2] avcodec/mediacodecenc: warning when global header is requested.

Zhao Zhili quinkblack at foxmail.com
Wed Mar 15 18:27:52 EET 2023


From: Zhao Zhili <zhilizhao at tencent.com>

Add suggests to use extract_extradata bsf.

Signed-off-by: Zhao Zhili <zhilizhao at tencent.com>
---
 libavcodec/mediacodecenc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 2ab56597fe..27a2cd883d 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -317,6 +317,10 @@ static av_cold int mediacodec_init(AVCodecContext *avctx)
         goto bailout;
 
     mediacodec_output_format(avctx);
+    if (avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER)
+        av_log(avctx, AV_LOG_WARNING,
+                "Mediacodec encoder doesn't support AV_CODEC_FLAG_GLOBAL_HEADER. "
+                "Use extract_extradata bsf when necessary.\n");
 
     s->frame = av_frame_alloc();
     if (!s->frame)
-- 
2.34.1



More information about the ffmpeg-devel mailing list