Add default_language flag
Setting this flag will tag any matching tracks with kRoleMain. The player will then know which tracks should be default when there is not a language match. Closes #155 Change-Id: I827304c49e345d07b1e76f7a46421b60f228f0ba
This commit is contained in:
parent
07c4b4f3bd
commit
cda495fb57
|
@ -43,6 +43,11 @@ DEFINE_double(suggested_presentation_delay,
|
|||
0.0,
|
||||
"Specifies a delay, in seconds, to be added to the media "
|
||||
"presentation time. This value is used for live profile only.");
|
||||
DEFINE_string(default_language,
|
||||
"",
|
||||
"Any tracks tagged with this language will have "
|
||||
"<Role ... value=\"main\" /> in the manifest. This allows the "
|
||||
"player to choose the correct default language for the content.");
|
||||
DEFINE_bool(generate_dash_if_iop_compliant_mpd,
|
||||
false,
|
||||
"Try to generate DASH-IF IOPv3 compliant MPD. This is best effort "
|
||||
|
|
|
@ -19,6 +19,7 @@ DECLARE_double(minimum_update_period);
|
|||
DECLARE_double(min_buffer_time);
|
||||
DECLARE_double(time_shift_buffer_depth);
|
||||
DECLARE_double(suggested_presentation_delay);
|
||||
DECLARE_string(default_language);
|
||||
DECLARE_bool(generate_dash_if_iop_compliant_mpd);
|
||||
|
||||
#endif // APP_MPD_FLAGS_H_
|
||||
|
|
|
@ -177,6 +177,7 @@ bool GetMpdOptions(MpdOptions* mpd_options) {
|
|||
mpd_options->time_shift_buffer_depth = FLAGS_time_shift_buffer_depth;
|
||||
mpd_options->suggested_presentation_delay =
|
||||
FLAGS_suggested_presentation_delay;
|
||||
mpd_options->default_language = FLAGS_default_language;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -413,8 +413,12 @@ AdaptationSet* MpdBuilder::AddAdaptationSet(const std::string& lang) {
|
|||
std::unique_ptr<AdaptationSet> adaptation_set(
|
||||
new AdaptationSet(adaptation_set_counter_.GetNext(), lang, mpd_options_,
|
||||
type_, &representation_counter_));
|
||||
|
||||
DCHECK(adaptation_set);
|
||||
|
||||
if (!lang.empty() && lang == mpd_options_.default_language) {
|
||||
adaptation_set->AddRole(AdaptationSet::kRoleMain);
|
||||
}
|
||||
|
||||
adaptation_sets_.push_back(std::move(adaptation_set));
|
||||
return adaptation_sets_.back().get();
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ struct MpdOptions {
|
|||
double min_buffer_time;
|
||||
double time_shift_buffer_depth;
|
||||
double suggested_presentation_delay;
|
||||
std::string default_language;
|
||||
};
|
||||
|
||||
} // namespace shaka
|
||||
|
|
Loading…
Reference in New Issue