Deprecate availability_time_offset MPD flag
'availability_time_offset' is not an attribute in MPD specification, but used to calculate availability_start_time to adjust segment availability time. A similar effect can be achieved with standard blessed suggested_presentation_delay flag. If suggested_presentation_delay is not set, player is expected to choose a suitable value. Change-Id: I1d540bd4347b4f04b6cc5ec0778e1a5392009b09
This commit is contained in:
parent
bfe302bd5c
commit
18cdbd4121
|
@ -81,10 +81,6 @@ mpd_options.min_buffer_time = 5.0;
|
||||||
|
|
||||||
// The below options are for live profile only.
|
// The below options are for live profile only.
|
||||||
|
|
||||||
// Offset with respect to the wall clock time for MPD availabilityStartTime
|
|
||||||
// and availabilityEndTime values, in seconds.
|
|
||||||
mpd_options.availability_time_offset = 10.0;
|
|
||||||
|
|
||||||
// Indicates to the player how often to refresh the media presentations, in
|
// Indicates to the player how often to refresh the media presentations, in
|
||||||
// seconds.
|
// seconds.
|
||||||
mpd_options.minimum_update_period = 5.0;
|
mpd_options.minimum_update_period = 5.0;
|
||||||
|
@ -93,7 +89,7 @@ mpd_options.minimum_update_period = 5.0;
|
||||||
mpd_options.time_shift_buffer_depth = 1800.0;
|
mpd_options.time_shift_buffer_depth = 1800.0;
|
||||||
|
|
||||||
// Specifies a delay, in seconds, to be added to the media presentation time.
|
// Specifies a delay, in seconds, to be added to the media presentation time.
|
||||||
mpd_options.suggested_presentation_delay = 0.0;
|
mpd_options.suggested_presentation_delay = 10.0;
|
||||||
```
|
```
|
||||||
|
|
||||||
Using MpdBuilder Instance
|
Using MpdBuilder Instance
|
||||||
|
|
|
@ -33,11 +33,6 @@ DEFINE_double(min_buffer_time,
|
||||||
2.0,
|
2.0,
|
||||||
"Specifies, in seconds, a common duration used in the definition "
|
"Specifies, in seconds, a common duration used in the definition "
|
||||||
"of the MPD Representation data rate.");
|
"of the MPD Representation data rate.");
|
||||||
DEFINE_double(availability_time_offset,
|
|
||||||
10.0,
|
|
||||||
"Offset with respect to the wall clock time for MPD "
|
|
||||||
"availabilityStartTime and availabilityEndTime values, in "
|
|
||||||
" seconds. This value is used for live profile only.");
|
|
||||||
DEFINE_double(minimum_update_period,
|
DEFINE_double(minimum_update_period,
|
||||||
5.0,
|
5.0,
|
||||||
"Indicates to the player how often to refresh the media "
|
"Indicates to the player how often to refresh the media "
|
||||||
|
|
|
@ -15,7 +15,6 @@ DECLARE_bool(generate_static_mpd);
|
||||||
DECLARE_bool(output_media_info);
|
DECLARE_bool(output_media_info);
|
||||||
DECLARE_string(mpd_output);
|
DECLARE_string(mpd_output);
|
||||||
DECLARE_string(base_urls);
|
DECLARE_string(base_urls);
|
||||||
DECLARE_double(availability_time_offset);
|
|
||||||
DECLARE_double(minimum_update_period);
|
DECLARE_double(minimum_update_period);
|
||||||
DECLARE_double(min_buffer_time);
|
DECLARE_double(min_buffer_time);
|
||||||
DECLARE_double(time_shift_buffer_depth);
|
DECLARE_double(time_shift_buffer_depth);
|
||||||
|
|
|
@ -216,7 +216,6 @@ MpdOptions GetMpdOptions(bool on_demand_profile) {
|
||||||
mpd_options.mpd_type = (on_demand_profile || FLAGS_generate_static_mpd)
|
mpd_options.mpd_type = (on_demand_profile || FLAGS_generate_static_mpd)
|
||||||
? MpdType::kStatic
|
? MpdType::kStatic
|
||||||
: MpdType::kDynamic;
|
: MpdType::kDynamic;
|
||||||
mpd_options.availability_time_offset = FLAGS_availability_time_offset;
|
|
||||||
mpd_options.minimum_update_period = FLAGS_minimum_update_period;
|
mpd_options.minimum_update_period = FLAGS_minimum_update_period;
|
||||||
mpd_options.min_buffer_time = FLAGS_min_buffer_time;
|
mpd_options.min_buffer_time = FLAGS_min_buffer_time;
|
||||||
mpd_options.time_shift_buffer_depth = FLAGS_time_shift_buffer_depth;
|
mpd_options.time_shift_buffer_depth = FLAGS_time_shift_buffer_depth;
|
||||||
|
|
|
@ -16,6 +16,10 @@ DEFINE_bool(single_segment, true, "This flag is deprecated. Do not use.");
|
||||||
DEFINE_bool(webm_subsample_encryption,
|
DEFINE_bool(webm_subsample_encryption,
|
||||||
true,
|
true,
|
||||||
"This flag is deprecated. Use vp9_subsample_encryption instead.");
|
"This flag is deprecated. Use vp9_subsample_encryption instead.");
|
||||||
|
DEFINE_double(availability_time_offset,
|
||||||
|
10.0,
|
||||||
|
"This flag is deprecated. Use suggested_presentation_delay "
|
||||||
|
"instead which can achieve similar effect.");
|
||||||
|
|
||||||
// The current gflags library does not provide a way to check whether a flag is
|
// The current gflags library does not provide a way to check whether a flag is
|
||||||
// set in command line. If a flag has a different value to its default value,
|
// set in command line. If a flag has a different value to its default value,
|
||||||
|
@ -33,6 +37,13 @@ bool InformRetiredDefaultTrueFlag(const char* flagname, bool value) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool InformRetiredDefaultDoubleFlag(const char* flagname, double value) {
|
||||||
|
if (value != 0)
|
||||||
|
fprintf(stderr, "WARNING: %s is deprecated and ignored.\n", flagname);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
DEFINE_validator(profile, &InformRetiredStringFlag);
|
DEFINE_validator(profile, &InformRetiredStringFlag);
|
||||||
DEFINE_validator(single_segment, &InformRetiredDefaultTrueFlag);
|
DEFINE_validator(single_segment, &InformRetiredDefaultTrueFlag);
|
||||||
DEFINE_validator(webm_subsample_encryption, &InformRetiredDefaultTrueFlag);
|
DEFINE_validator(webm_subsample_encryption, &InformRetiredDefaultTrueFlag);
|
||||||
|
DEFINE_validator(availability_time_offset, &InformRetiredDefaultDoubleFlag);
|
||||||
|
|
|
@ -9,3 +9,4 @@
|
||||||
DECLARE_string(profile);
|
DECLARE_string(profile);
|
||||||
DECLARE_bool(single_segment);
|
DECLARE_bool(single_segment);
|
||||||
DECLARE_bool(webm_subsample_encryption);
|
DECLARE_bool(webm_subsample_encryption);
|
||||||
|
DECLARE_double(availability_time_offset);
|
||||||
|
|
|
@ -575,10 +575,8 @@ void MpdBuilder::AddDynamicMpdInfo(XmlNode* mpd_node) {
|
||||||
if (availability_start_time_.empty()) {
|
if (availability_start_time_.empty()) {
|
||||||
double earliest_presentation_time;
|
double earliest_presentation_time;
|
||||||
if (GetEarliestTimestamp(&earliest_presentation_time)) {
|
if (GetEarliestTimestamp(&earliest_presentation_time)) {
|
||||||
availability_start_time_ =
|
availability_start_time_ = XmlDateTimeNowWithOffset(
|
||||||
XmlDateTimeNowWithOffset(mpd_options_.availability_time_offset -
|
-std::ceil(earliest_presentation_time), clock_.get());
|
||||||
std::ceil(earliest_presentation_time),
|
|
||||||
clock_.get());
|
|
||||||
} else {
|
} else {
|
||||||
LOG(ERROR) << "Could not determine the earliest segment presentation "
|
LOG(ERROR) << "Could not determine the earliest segment presentation "
|
||||||
"time for availabilityStartTime calculation.";
|
"time for availabilityStartTime calculation.";
|
||||||
|
|
|
@ -23,7 +23,6 @@ enum class MpdType { kStatic, kDynamic };
|
||||||
struct MpdOptions {
|
struct MpdOptions {
|
||||||
DashProfile dash_profile = DashProfile::kOnDemand;
|
DashProfile dash_profile = DashProfile::kOnDemand;
|
||||||
MpdType mpd_type = MpdType::kStatic;
|
MpdType mpd_type = MpdType::kStatic;
|
||||||
double availability_time_offset = 0;
|
|
||||||
double minimum_update_period = 0;
|
double minimum_update_period = 0;
|
||||||
// TODO(tinskip): Set min_buffer_time in unit tests rather than here.
|
// TODO(tinskip): Set min_buffer_time in unit tests rather than here.
|
||||||
double min_buffer_time = 2.0;
|
double min_buffer_time = 2.0;
|
||||||
|
|
Loading…
Reference in New Issue