2022-08-26 15:44:59 +00:00
|
|
|
// Copyright 2017 Google LLC. All rights reserved.
|
2017-07-27 18:49:50 +00:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
|
2023-10-14 16:36:01 +00:00
|
|
|
#ifndef PACKAGER_PUBLIC_MPD_PARAMS_H_
|
|
|
|
#define PACKAGER_PUBLIC_MPD_PARAMS_H_
|
2017-07-27 18:49:50 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace shaka {
|
|
|
|
|
|
|
|
/// DASH MPD related parameters.
|
|
|
|
struct MpdParams {
|
|
|
|
/// MPD output file path.
|
|
|
|
std::string mpd_output;
|
|
|
|
/// BaseURLs for the MPD. The values will be added as <BaseURL> element(s)
|
|
|
|
/// under the <MPD> element.
|
|
|
|
std::vector<std::string> base_urls;
|
|
|
|
/// Set MPD@minBufferTime attribute, which specifies, in seconds, a common
|
|
|
|
/// duration used in the definition of the MPD representation data rate. A
|
|
|
|
/// client can be assured of having enough data for continous playout
|
|
|
|
/// providing playout begins at min_buffer_time after the first bit is
|
|
|
|
/// received.
|
|
|
|
double min_buffer_time = 2.0;
|
2018-03-17 01:37:53 +00:00
|
|
|
/// Set MPD@minimumUpdatePeriod attribute, which indicates to the player how
|
|
|
|
/// often to refresh the MPD in seconds. For dynamic MPD only.
|
|
|
|
double minimum_update_period = 0;
|
2017-07-27 18:49:50 +00:00
|
|
|
/// Set MPD@suggestedPresentationDelay attribute. For 'dynamic' media
|
|
|
|
/// presentations, it specifies a delay, in seconds, to be added to the media
|
|
|
|
/// presentation time. The attribute is not set if the value is 0; the client
|
|
|
|
/// is expected to choose a suitable value in this case.
|
|
|
|
static constexpr double kSuggestedPresentationDelayNotSet = 0;
|
|
|
|
double suggested_presentation_delay = kSuggestedPresentationDelayNotSet;
|
2018-03-17 01:37:53 +00:00
|
|
|
/// Set MPD@timeShiftBufferDepth attribute, which is the guaranteed duration
|
|
|
|
/// of the time shifting buffer for 'dynamic' media presentations, in seconds.
|
|
|
|
double time_shift_buffer_depth = 0;
|
2018-05-01 17:47:06 +00:00
|
|
|
/// Segments outside the live window (defined by 'time_shift_buffer_depth'
|
|
|
|
/// above) are automatically removed except for the most recent X segments
|
|
|
|
/// defined by this parameter. This is needed to accommodate latencies in
|
|
|
|
/// various stages of content serving pipeline, so that the segments stay
|
|
|
|
/// accessible as they may still be accessed by the player. The segments are
|
|
|
|
/// not removed if the value is zero.
|
2018-04-04 23:17:59 +00:00
|
|
|
size_t preserved_segments_outside_live_window = 0;
|
2018-03-17 01:37:53 +00:00
|
|
|
/// UTCTimings. For dynamic MPD only.
|
|
|
|
struct UtcTiming {
|
|
|
|
std::string scheme_id_uri;
|
|
|
|
std::string value;
|
|
|
|
};
|
|
|
|
std::vector<UtcTiming> utc_timings;
|
2017-07-27 18:49:50 +00:00
|
|
|
/// The 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.
|
2018-11-20 00:09:24 +00:00
|
|
|
/// This applies to both audio and text tracks. The default language for text
|
|
|
|
/// tracks can be overriden by 'default_text_language'.
|
2017-07-27 18:49:50 +00:00
|
|
|
std::string default_language;
|
2018-11-20 00:09:24 +00:00
|
|
|
/// Same as above, but this overrides the default language for text tracks,
|
|
|
|
/// i.e. subtitles or close-captions.
|
|
|
|
std::string default_text_language;
|
2018-03-17 01:37:53 +00:00
|
|
|
/// Generate static MPD for live profile. Note that this flag has no effect
|
|
|
|
/// for on-demand profile, in which case static MPD is always used.
|
|
|
|
bool generate_static_live_mpd = false;
|
2017-07-27 18:49:50 +00:00
|
|
|
/// Try to generate DASH-IF IOP compliant MPD.
|
|
|
|
bool generate_dash_if_iop_compliant_mpd = true;
|
2017-09-25 19:18:50 +00:00
|
|
|
/// For live profile only.
|
|
|
|
/// If enabled, segments with close duration (i.e. with difference less than
|
|
|
|
/// one sample) are considered to have the same duration. This enables
|
|
|
|
/// MPD generator to generate less SegmentTimeline entries. If all segments
|
|
|
|
/// are of the same duration except the last one, we will do further
|
|
|
|
/// optimization to use SegmentTemplate@duration instead and omit
|
|
|
|
/// SegmentTimeline completely.
|
|
|
|
/// Ignored if $Time$ is used in segment template, since $Time$ requires
|
|
|
|
/// accurate Segment Timeline.
|
|
|
|
bool allow_approximate_segment_timeline = false;
|
2018-11-14 20:47:48 +00:00
|
|
|
/// This is the target segment duration requested by the user. The actual
|
|
|
|
/// segment duration may be different to the target segment duration.
|
|
|
|
/// This parameter is included here to calculate the approximate
|
2019-07-11 21:32:10 +00:00
|
|
|
/// SegmentTimeline if it is enabled. It will be populated from segment
|
|
|
|
/// duration specified in ChunkingParams if not specified.
|
2018-11-14 20:47:48 +00:00
|
|
|
double target_segment_duration = 0;
|
2020-03-18 02:33:44 +00:00
|
|
|
/// If enabled, allow switching between different codecs, if they have the
|
|
|
|
/// same language, media type (audio, video etc) and container type.
|
|
|
|
bool allow_codec_switching = false;
|
2020-04-17 17:20:03 +00:00
|
|
|
/// If enabled, PlayReady Object <mspr:pro> will be inserted into
|
|
|
|
/// <ContentProtection ...> element alongside with <cenc:pssh>
|
|
|
|
/// when using PlayReady protection system.
|
|
|
|
bool include_mspr_pro = true;
|
2021-05-25 19:08:58 +00:00
|
|
|
/// Uses SegmentList instead of SegmentBase. Use this if the
|
|
|
|
/// content is huge and the total number of (sub)segment references
|
|
|
|
/// is greater than what the sidx atom allows (65535).
|
|
|
|
bool use_segment_list = false;
|
2021-08-25 15:38:05 +00:00
|
|
|
/// Enable LL-DASH streaming.
|
|
|
|
/// Each segment constists of many fragments, and each fragment contains one
|
|
|
|
/// chunk. A chunk is the smallest unit and is constructed of a single moof
|
|
|
|
/// and mdat atom. Each chunk is uploaded immediately upon creation,
|
|
|
|
/// decoupling latency from segment duration.
|
|
|
|
bool low_latency_dash_mode = false;
|
|
|
|
/// This is the target latency in seconds requested by the user. The actual
|
|
|
|
/// latency may be different to the target latency
|
|
|
|
/// and is greatly influnced by the player.
|
|
|
|
/// This parameter is required by DASH-IF Low Latency standards.
|
|
|
|
double target_latency_seconds = 1;
|
2017-07-27 18:49:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace shaka
|
|
|
|
|
2023-10-14 16:36:01 +00:00
|
|
|
#endif // PACKAGER_PUBLIC_MPD_PARAMS_H_
|