avformat/mux: Add flag for "only default codecs allowed"

AVOutputFormat has default codecs for audio, video and subtitle
and often these are the only codecs of this type allowed.
So add a flag to AVOutputFormat so that this can be checked generically.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2024-03-19 23:28:36 +01:00
parent 03b04eef72
commit a24bccc238
27 changed files with 72 additions and 169 deletions

View File

@@ -44,6 +44,8 @@ int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
codec_id == ofmt->audio_codec ||
codec_id == ofmt->subtitle_codec))
return 1;
else if (ffofmt(ofmt)->flags_internal & FF_OFMT_FLAG_ONLY_DEFAULT_CODECS)
return 0;
else if (ffofmt(ofmt)->flags_internal & FF_OFMT_FLAG_MAX_ONE_OF_EACH) {
enum AVMediaType type = avcodec_get_type(codec_id);
switch (type) {