From b5cce096e05e79ee7e47016a8be84b249daad047 Mon Sep 17 00:00:00 2001 From: Rintaro Kuroiwa Date: Thu, 17 Oct 2013 14:10:38 -0700 Subject: [PATCH] media_info.proto protobuf for MpdBuilder TEST=compiles Change-Id: I4a67013f7770f8ce41426be527919cd969894d50 --- mpd/base/media_info.proto | 71 +++++++++++++++++++++++++++++++++++++++ mpd/mpd.gyp | 19 +++++++++++ 2 files changed, 90 insertions(+) create mode 100644 mpd/base/media_info.proto create mode 100644 mpd/mpd.gyp diff --git a/mpd/base/media_info.proto b/mpd/base/media_info.proto new file mode 100644 index 0000000000..241941b0ec --- /dev/null +++ b/mpd/base/media_info.proto @@ -0,0 +1,71 @@ +// This file defines the protocol between Muxer and classes for generating MPD +// files. + +syntax = "proto2"; + +option optimize_for = LITE_RUNTIME; + +package dash_packager; + +message Range { + optional uint64 begin = 1; + optional uint64 end = 2; +} + +message MediaInfo { + message VideoInfo { + optional string codec = 1; + optional uint32 width = 2; + optional uint32 height = 3; + + // Relative to |time_scale|. IOW |time_scale| / |frame_duration| is the + // framerate. + optional uint64 frame_duration = 4; + + optional bytes decoder_config = 5; + } + + message AudioInfo { + optional string codec = 1; + optional uint32 sampling_frequency = 2; + optional uint32 num_channels = 3; + optional string language = 4; + optional bytes decoder_config = 5; + } + + message TextInfo { + optional string format = 1; + optional string language = 2; + } + + message ContentProtection { + optional bytes key_id = 1; + optional bytes pssh = 2; + } + + optional uint32 bandwidth = 1; + optional uint32 time_scale = 2; + repeated VideoInfo video_info = 3; + repeated AudioInfo audio_info = 4; + repeated TextInfo text_info = 5; + repeated ContentProtection content_protections = 6; + + // VOD only. + optional Range init_range = 7; + optional Range index_range = 8; + optional string media_file_name = 9; + + // This value is relative to |time_scale|. + optional uint64 media_duration = 10; + // END VOD only. + + // LIVE only. + optional string init_segment_name = 11; + optional string segment_template = 12; + + // This value is the user input “segment duration”. + // This value is not necessarily the same as the value passed to + // MpdNotifier::NotifyNewSegment(). + optional uint64 segment_duration = 13; + // END LIVE only. +} diff --git a/mpd/mpd.gyp b/mpd/mpd.gyp new file mode 100644 index 0000000000..e5d2cff6e1 --- /dev/null +++ b/mpd/mpd.gyp @@ -0,0 +1,19 @@ +# GYP file for any MPD generation targets. + +{ + 'targets': [ + { + 'target_name': 'media_info_proto', + + 'type': 'static_library', + 'sources': [ + 'base/media_info.proto', + ], + 'variables': { + 'proto_in_dir': 'base', + 'proto_out_dir': 'mpd/base', + }, + 'includes': ['../build/protoc.gypi'], + }, + ], +}