summaryrefslogtreecommitdiff
path: root/libavformat/mux.h
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-19 21:40:54 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-03-22 23:57:19 +0100
commitf4167842c12ad0e406a2bed4c2bb17084b184710 (patch)
treec7230409284fe0232e5f9cee586edfc0763f599c /libavformat/mux.h
parentc6bc2d4fea99bfc0ad125897f61d205d78d0a8c1 (diff)
avformat/mux: Add flag for "not more than one stream of each type"
More exactly: Not more than one stream of each type for which a default codec (i.e. AVOutputFormat.(audio|video|subtitle)_codec) is set; for those types for which no such codec is set (or for which no designated default codec in AVOutputFormat exists at all) no streams are permitted. Given that with this flag set the default codecs become more important, they are now set explicitly to AV_CODEC_ID_NONE for "unset"; the earlier code relied on AV_CODEC_ID_NONE being equal to zero, so that default static initialization set it accordingly; but this is not how one is supposed to use an enum. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat/mux.h')
-rw-r--r--libavformat/mux.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavformat/mux.h b/libavformat/mux.h
index bd3eb53380..a13721a03e 100644
--- a/libavformat/mux.h
+++ b/libavformat/mux.h
@@ -36,6 +36,18 @@ struct AVDeviceInfoList;
* of the return value in case of flushing.
*/
#define FF_OFMT_FLAG_ALLOW_FLUSH (1 << 1)
+/**
+ * If this flag is set, it indicates that for each codec type
+ * whose corresponding default codec (i.e. AVOutputFormat.audio_codec,
+ * AVOutputFormat.video_codec and AVOutputFormat.subtitle_codec)
+ * is set (i.e. != AV_CODEC_ID_NONE) only one stream of this type
+ * can be muxed. It furthermore indicates that no stream with
+ * a codec type that has no default codec or whose default codec
+ * is AV_CODEC_ID_NONE can be muxed.
+ * Both of these restrictions are checked generically before
+ * the actual muxer's init/write_header callbacks.
+ */
+#define FF_OFMT_FLAG_MAX_ONE_OF_EACH (1 << 2)
typedef struct FFOutputFormat {
/**