2013-10-17 21:10:38 +00:00
|
|
|
// This file defines the protocol between Muxer and classes for generating MPD
|
|
|
|
// files.
|
|
|
|
|
|
|
|
syntax = "proto2";
|
|
|
|
|
2016-05-20 21:19:33 +00:00
|
|
|
package shaka;
|
2013-10-17 21:10:38 +00:00
|
|
|
|
|
|
|
message Range {
|
|
|
|
optional uint64 begin = 1;
|
|
|
|
optional uint64 end = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message MediaInfo {
|
2014-01-06 20:00:14 +00:00
|
|
|
enum ContainerType {
|
|
|
|
CONTAINER_UNKNOWN = 0;
|
|
|
|
CONTAINER_MP4 = 1;
|
|
|
|
CONTAINER_MPEG2_TS= 2;
|
|
|
|
CONTAINER_WEBM = 3;
|
2015-10-29 20:58:36 +00:00
|
|
|
CONTAINER_TEXT = 4;
|
2014-01-06 20:00:14 +00:00
|
|
|
}
|
|
|
|
|
2013-10-17 21:10:38 +00:00
|
|
|
message VideoInfo {
|
|
|
|
optional string codec = 1;
|
2015-06-09 22:29:14 +00:00
|
|
|
|
|
|
|
// The width and height of the actual number of pixels. This will not be the
|
|
|
|
// same as the visual width and height if the sample aspect ratio (sar)
|
|
|
|
// is not 1:1.
|
2013-10-17 21:10:38 +00:00
|
|
|
optional uint32 width = 2;
|
|
|
|
optional uint32 height = 3;
|
2015-06-09 22:29:14 +00:00
|
|
|
|
2013-12-11 00:27:25 +00:00
|
|
|
optional uint32 time_scale = 4;
|
2013-10-17 21:10:38 +00:00
|
|
|
// Relative to |time_scale|. IOW |time_scale| / |frame_duration| is the
|
|
|
|
// framerate.
|
2013-12-11 00:27:25 +00:00
|
|
|
optional uint64 frame_duration = 5;
|
|
|
|
optional bytes decoder_config = 6;
|
2015-06-09 22:29:14 +00:00
|
|
|
|
|
|
|
// pixel_width:pixel_height is the the sample aspect ratio (sar) of the
|
|
|
|
// video.
|
|
|
|
// Note that (pixel_width * width):(pixel_height * height) is the picture
|
|
|
|
// aspect ratio, or the @par attribute set on AdaptationSet element.
|
|
|
|
optional uint32 pixel_width = 7;
|
|
|
|
optional uint32 pixel_height = 8;
|
2017-03-21 23:14:46 +00:00
|
|
|
|
|
|
|
// trick_play_rate: sample rate of the key frame from the original stream.
|
|
|
|
// e.g., 1 means every key frame, 2 means every two key frames.
|
|
|
|
optional uint32 trick_play_rate = 9;
|
|
|
|
// playback_rate: the playout capability (e.g., 4x, 8x, 16x fast foward) of
|
|
|
|
// the trick play stream.
|
|
|
|
optional uint32 playback_rate = 10;
|
2013-10-17 21:10:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message AudioInfo {
|
|
|
|
optional string codec = 1;
|
|
|
|
optional uint32 sampling_frequency = 2;
|
2013-12-11 00:27:25 +00:00
|
|
|
optional uint32 time_scale = 3;
|
|
|
|
optional uint32 num_channels = 4;
|
|
|
|
optional string language = 5;
|
|
|
|
optional bytes decoder_config = 6;
|
2016-02-09 00:22:01 +00:00
|
|
|
optional AudioCodecSpecificData codec_specific_data = 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
message AudioCodecSpecificData {
|
|
|
|
// EC3 Channel map bit fields, encoded based on ETSI TS 102 366 V1.3.1
|
|
|
|
// Digital Audio Compression (AC-3, Enhanced AC-3) Standard E.1.3.1.8.
|
|
|
|
optional uint32 ec3_channel_map = 1;
|
2013-10-17 21:10:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message TextInfo {
|
2015-10-29 20:58:36 +00:00
|
|
|
enum TextType {
|
|
|
|
UNKNOWN = 0;
|
|
|
|
CAPTION = 1;
|
|
|
|
SUBTITLE = 2;
|
|
|
|
}
|
2013-10-17 21:10:38 +00:00
|
|
|
optional string format = 1;
|
|
|
|
optional string language = 2;
|
2015-10-29 20:58:36 +00:00
|
|
|
optional TextType type = 3;
|
2013-10-17 21:10:38 +00:00
|
|
|
}
|
|
|
|
|
2015-07-08 00:52:28 +00:00
|
|
|
message ProtectedContent {
|
|
|
|
message ContentProtectionEntry {
|
|
|
|
// Human readable UUID of the DRM.
|
|
|
|
optional string uuid = 1;
|
|
|
|
// Human readable DRM name and version string.
|
|
|
|
// e.g. "My Content Protection v1.0"
|
|
|
|
optional string name_version = 2;
|
|
|
|
// The raw 'pssh' box for the media.
|
|
|
|
optional bytes pssh = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
// The default key ID for the encrypted media.
|
|
|
|
optional bytes default_key_id = 1;
|
|
|
|
repeated ContentProtectionEntry content_protection_entry = 2;
|
2016-04-21 23:21:16 +00:00
|
|
|
// Specifies the protection scheme: 'cenc', 'cens', 'cbc1', 'cbcs'.
|
2017-04-04 20:57:50 +00:00
|
|
|
// "cbca" is also valid which is a place holder for SAMPLE-AES encryption.
|
2016-04-21 23:21:16 +00:00
|
|
|
optional string protection_scheme = 3 [default = 'cenc'];
|
2015-07-08 00:52:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO(rkuroiwa): Remove this. <ContentProtection> element that must be added
|
|
|
|
// should be done by directly using the MpdBuilder interface.
|
|
|
|
// Use this to specify ContentProtection elements that should be set in
|
|
|
|
// the MPD, if ContentProtectionEntry is not sufficient.
|
2014-01-10 20:04:09 +00:00
|
|
|
message ContentProtectionXml {
|
|
|
|
message AttributeNameValuePair {
|
|
|
|
optional string name = 1;
|
|
|
|
optional string value = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message Element {
|
2014-01-14 22:56:06 +00:00
|
|
|
optional string name = 1;
|
|
|
|
repeated AttributeNameValuePair attributes = 2;
|
|
|
|
repeated Element subelements = 3;
|
2014-01-10 20:04:09 +00:00
|
|
|
}
|
|
|
|
|
2014-01-14 22:56:06 +00:00
|
|
|
// These two string fields are specified by the MPD spec. Just for
|
|
|
|
// clarification, the string set in |value| is the rhs of 'value' field in
|
|
|
|
// <ContentProtection>.
|
2014-01-10 20:04:09 +00:00
|
|
|
optional string scheme_id_uri = 1;
|
|
|
|
optional string value = 2;
|
|
|
|
repeated AttributeNameValuePair attributes = 3;
|
|
|
|
repeated Element subelements = 4;
|
2013-10-17 21:10:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
optional uint32 bandwidth = 1;
|
2015-06-09 23:58:32 +00:00
|
|
|
|
|
|
|
// Note that DASH IOP v3.0 explicitly mentions that a segment should only
|
|
|
|
// have one {video, audio, text} track.
|
|
|
|
optional VideoInfo video_info = 2;
|
|
|
|
optional AudioInfo audio_info = 3;
|
|
|
|
optional TextInfo text_info = 4;
|
2014-01-10 20:04:09 +00:00
|
|
|
repeated ContentProtectionXml content_protections = 5;
|
2013-10-17 21:10:38 +00:00
|
|
|
|
2015-07-08 00:52:28 +00:00
|
|
|
// This is set if the content is protected with a content protection,
|
|
|
|
// i.e. encrypted.
|
|
|
|
optional ProtectedContent protected_content = 15;
|
|
|
|
|
2013-12-18 01:17:35 +00:00
|
|
|
// This is the reference time scale if there are multiple VideoInfo and/or
|
|
|
|
// AudioInfo.
|
|
|
|
optional uint32 reference_time_scale = 13;
|
2014-01-06 20:00:14 +00:00
|
|
|
optional ContainerType container_type = 14 [default = CONTAINER_UNKNOWN];
|
2013-12-18 01:17:35 +00:00
|
|
|
|
2013-10-17 21:10:38 +00:00
|
|
|
// VOD only.
|
2013-12-11 00:27:25 +00:00
|
|
|
optional Range init_range = 6;
|
|
|
|
optional Range index_range = 7;
|
|
|
|
optional string media_file_name = 8;
|
2013-10-17 21:10:38 +00:00
|
|
|
// END VOD only.
|
|
|
|
|
2017-02-09 00:42:44 +00:00
|
|
|
// VOD and static LIVE.
|
|
|
|
optional float media_duration_seconds = 9;
|
|
|
|
|
2013-10-17 21:10:38 +00:00
|
|
|
// LIVE only.
|
2013-12-11 00:27:25 +00:00
|
|
|
optional string init_segment_name = 10;
|
|
|
|
optional string segment_template = 11;
|
2013-10-17 21:10:38 +00:00
|
|
|
// This value is the user input “segment duration”.
|
|
|
|
// This value is not necessarily the same as the value passed to
|
|
|
|
// MpdNotifier::NotifyNewSegment().
|
2013-12-11 00:27:25 +00:00
|
|
|
optional float segment_duration_seconds = 12;
|
2013-10-17 21:10:38 +00:00
|
|
|
// END LIVE only.
|
|
|
|
}
|