From d9871330e7ca36dfd69c11a9994583f54b8e120b Mon Sep 17 00:00:00 2001 From: KongQun Yang Date: Thu, 18 Jan 2018 11:26:47 -0800 Subject: [PATCH] Move common manifest flags out of mpd_flags.cc Also updated documentations. Fixes #304 Change-Id: I5e8e87b005ebfa9dc78d47e2501585b083120f6c --- docs/source/options/dash_options.rst | 16 ++++++++-------- docs/source/options/hls_options.rst | 8 +++++++- packager/app/manifest_flags.cc | 19 +++++++++++++++++++ packager/app/manifest_flags.h | 17 +++++++++++++++++ packager/app/mpd_flags.cc | 9 --------- packager/app/mpd_flags.h | 2 -- packager/app/packager_main.cc | 1 + packager/packager.gyp | 2 ++ 8 files changed, 54 insertions(+), 20 deletions(-) create mode 100644 packager/app/manifest_flags.cc create mode 100644 packager/app/manifest_flags.h diff --git a/docs/source/options/dash_options.rst b/docs/source/options/dash_options.rst index 749e68def4..0428e993d1 100644 --- a/docs/source/options/dash_options.rst +++ b/docs/source/options/dash_options.rst @@ -28,18 +28,18 @@ DASH options Indicates to the player how often to refresh the media presentation description in seconds. This value is used for dynamic MPD only. ---time_shift_buffer_depth - - Guaranteed duration of the time shifting buffer for dynamic media - presentations, in seconds. - --suggested_presentation_delay Specifies a delay, in seconds, to be added to the media presentation time. This value is used for dynamic MPD only. +--time_shift_buffer_depth + + Guaranteed duration of the time shifting buffer for dynamic media + presentations, in seconds. + --default_language - Any tracks tagged with this language will have - in the manifest. This allows the player to choose the correct default - language for the content. + Any audio/text tracks tagged with this language will have + in the manifest. This allows the player to + choose the correct default language for the content. diff --git a/docs/source/options/hls_options.rst b/docs/source/options/hls_options.rst index 52bed9a071..87a8ee6950 100644 --- a/docs/source/options/hls_options.rst +++ b/docs/source/options/hls_options.rst @@ -24,5 +24,11 @@ HLS options --time_shift_buffer_depth - Guaranteed duration of the time shifting buffer for LIVE playlist, in + Guaranteed duration of the time shifting buffer for LIVE playlists, in seconds. + +--default_language + + The first audio/text rendition in a group tagged with this language will + have 'DEFAULT' attribute set to 'YES'. This allows the player to choose the + correct default language for the content. diff --git a/packager/app/manifest_flags.cc b/packager/app/manifest_flags.cc new file mode 100644 index 0000000000..393a9a45a6 --- /dev/null +++ b/packager/app/manifest_flags.cc @@ -0,0 +1,19 @@ +// Copyright 2018 Google Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd + +#include "packager/app/manifest_flags.h" + +DEFINE_double(time_shift_buffer_depth, + 1800.0, + "Guaranteed duration of the time shifting buffer for HLS LIVE " + "playlists and DASH dynamic media presentations, in seconds."); +DEFINE_string(default_language, + "", + "For DASH, any audio/text tracks tagged with this language will " + "have in the manifest; For HLS, the " + "first audio/text rendition in a group tagged with this language " + "will have 'DEFAULT' attribute set to 'YES'. This allows the " + "player to choose the correct default language for the content."); diff --git a/packager/app/manifest_flags.h b/packager/app/manifest_flags.h new file mode 100644 index 0000000000..1b9f50a570 --- /dev/null +++ b/packager/app/manifest_flags.h @@ -0,0 +1,17 @@ +// Copyright 2018 Google Inc. All rights reserved. +// +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file or at +// https://developers.google.com/open-source/licenses/bsd +// +// Common flags applicable to both DASH and HLS. + +#ifndef PACKAGER_APP_MANIFEST_FLAGS_H_ +#define PACKAGER_APP_MANIFEST_FLAGS_H_ + +#include + +DECLARE_double(time_shift_buffer_depth); +DECLARE_string(default_language); + +#endif // PACKAGER_APP_MANIFEST_FLAGS_H_ diff --git a/packager/app/mpd_flags.cc b/packager/app/mpd_flags.cc index 4c4bcb8b10..a2674dc071 100644 --- a/packager/app/mpd_flags.cc +++ b/packager/app/mpd_flags.cc @@ -39,19 +39,10 @@ DEFINE_double(minimum_update_period, "Indicates to the player how often to refresh the media " "presentation description in seconds. This value is used for " "dynamic MPD only."); -DEFINE_double(time_shift_buffer_depth, - 1800.0, - "Guaranteed duration of the time shifting buffer for dynamic " - "media presentations, in seconds."); 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 dynamic MPD only."); -DEFINE_string(default_language, - "", - "Any tracks tagged with this language will have " - " in the manifest. This allows the " - "player to choose the correct default language for the content."); DEFINE_bool(generate_dash_if_iop_compliant_mpd, true, "Try to generate DASH-IF IOP compliant MPD. This is best effort " diff --git a/packager/app/mpd_flags.h b/packager/app/mpd_flags.h index f29e272771..21e25cc055 100644 --- a/packager/app/mpd_flags.h +++ b/packager/app/mpd_flags.h @@ -17,9 +17,7 @@ DECLARE_string(mpd_output); DECLARE_string(base_urls); 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_ diff --git a/packager/app/packager_main.cc b/packager/app/packager_main.cc index f0e5c6e39a..e4ddcf8aed 100644 --- a/packager/app/packager_main.cc +++ b/packager/app/packager_main.cc @@ -10,6 +10,7 @@ #include "packager/app/ad_cue_generator_flags.h" #include "packager/app/crypto_flags.h" #include "packager/app/hls_flags.h" +#include "packager/app/manifest_flags.h" #include "packager/app/mpd_flags.h" #include "packager/app/muxer_flags.h" #include "packager/app/packager_util.h" diff --git a/packager/packager.gyp b/packager/packager.gyp index 51519fc6ac..261e1bc485 100644 --- a/packager/packager.gyp +++ b/packager/packager.gyp @@ -70,6 +70,8 @@ 'app/gflags_hex_bytes.h', 'app/hls_flags.cc', 'app/hls_flags.h', + 'app/manifest_flags.cc', + 'app/manifest_flags.h', 'app/mpd_flags.cc', 'app/mpd_flags.h', 'app/muxer_flags.cc',