summaryrefslogtreecommitdiff
path: root/libavformat/isom.c
diff options
context:
space:
mode:
authorJan Ekström <jan.ekstrom@24i.com>2021-07-15 09:57:48 +0300
committerJan Ekström <jeebjp@gmail.com>2021-10-04 17:55:27 +0300
commit7a446b1179301b6b9d05a7d39574e75e8fa5a862 (patch)
tree543651142a0d40eb59d970c2c450a612a51f690b /libavformat/isom.c
parent847fd8de7c13abe41ca59464014f17c56555ef7b (diff)
avformat/{isom,mov,movenc}: add support for CMAF DASH roles
This information is coded in a standard MP4 KindBox and utilizes the scheme and values as per the DASH role scheme defined in MPEG-DASH. Other schemes are technically allowed, but where multiple schemes define the same concepts, the DASH scheme should be utilized. Such flagging is additionally utilized by the DASH-IF CMAF ingest specification, enabling an encoder to inform the following component of the roles of the incoming media streams. A test is added for this functionality in a similar manner to the matroska test. Signed-off-by: Jan Ekström <jan.ekstrom@24i.com>
Diffstat (limited to 'libavformat/isom.c')
-rw-r--r--libavformat/isom.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libavformat/isom.c b/libavformat/isom.c
index 4df5440023..300ba927c2 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -430,3 +430,22 @@ void ff_mov_write_chan(AVIOContext *pb, int64_t channel_layout)
}
avio_wb32(pb, 0); // mNumberChannelDescriptions
}
+
+static const struct MP4TrackKindValueMapping dash_role_map[] = {
+ { AV_DISPOSITION_HEARING_IMPAIRED|AV_DISPOSITION_CAPTIONS,
+ "caption" },
+ { AV_DISPOSITION_COMMENT,
+ "commentary" },
+ { AV_DISPOSITION_VISUAL_IMPAIRED|AV_DISPOSITION_DESCRIPTIONS,
+ "description" },
+ { AV_DISPOSITION_DUB,
+ "dub" },
+ { AV_DISPOSITION_FORCED,
+ "forced-subtitle" },
+ { 0, NULL }
+};
+
+const struct MP4TrackKindMapping ff_mov_track_kind_table[] = {
+ { "urn:mpeg:dash:role:2011", dash_role_map },
+ { 0, NULL }
+};