shaka-packager/packager/mpd/base/media_info.proto

109 lines
3.1 KiB
Protocol Buffer
Raw Normal View History

// This file defines the protocol between Muxer and classes for generating MPD
// files.
syntax = "proto2";
package edash_packager;
message Range {
optional uint64 begin = 1;
optional uint64 end = 2;
}
message MediaInfo {
enum ContainerType {
CONTAINER_UNKNOWN = 0;
CONTAINER_MP4 = 1;
CONTAINER_MPEG2_TS= 2;
CONTAINER_WEBM = 3;
}
message VideoInfo {
optional string codec = 1;
// 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.
optional uint32 width = 2;
optional uint32 height = 3;
optional uint32 time_scale = 4;
// Relative to |time_scale|. IOW |time_scale| / |frame_duration| is the
// framerate.
optional uint64 frame_duration = 5;
optional bytes decoder_config = 6;
// 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;
}
message AudioInfo {
optional string codec = 1;
optional uint32 sampling_frequency = 2;
optional uint32 time_scale = 3;
optional uint32 num_channels = 4;
optional string language = 5;
optional bytes decoder_config = 6;
}
message TextInfo {
optional string format = 1;
optional string language = 2;
}
message ContentProtectionXml {
message AttributeNameValuePair {
optional string name = 1;
optional string value = 2;
}
message Element {
optional string name = 1;
repeated AttributeNameValuePair attributes = 2;
repeated Element subelements = 3;
}
// 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>.
optional string scheme_id_uri = 1;
optional string value = 2;
repeated AttributeNameValuePair attributes = 3;
repeated Element subelements = 4;
}
optional uint32 bandwidth = 1;
// 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;
repeated ContentProtectionXml content_protections = 5;
// This is the reference time scale if there are multiple VideoInfo and/or
// AudioInfo.
optional uint32 reference_time_scale = 13;
optional ContainerType container_type = 14 [default = CONTAINER_UNKNOWN];
// VOD only.
optional Range init_range = 6;
optional Range index_range = 7;
optional string media_file_name = 8;
optional float media_duration_seconds = 9;
// END VOD only.
// LIVE only.
optional string init_segment_name = 10;
optional string segment_template = 11;
// This value is the user input “segment duration”.
// This value is not necessarily the same as the value passed to
// MpdNotifier::NotifyNewSegment().
optional float segment_duration_seconds = 12;
// END LIVE only.
}