From 869d7f4620317d1ce2b4484b90dc5c16cd787167 Mon Sep 17 00:00:00 2001 From: Rintaro Kuroiwa Date: Tue, 4 Aug 2015 15:26:15 -0700 Subject: [PATCH] Add generate_dash_if_iop_compliant_mpd flag for the driver Change-Id: I0ad320848ad6eb36dfe358fe858a3d5f1f42dbcf --- packager/app/mpd_flags.cc | 5 +++++ packager/app/mpd_flags.h | 1 + packager/app/packager_main.cc | 10 ++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packager/app/mpd_flags.cc b/packager/app/mpd_flags.cc index 147ad6decc..a119394ab7 100644 --- a/packager/app/mpd_flags.cc +++ b/packager/app/mpd_flags.cc @@ -51,3 +51,8 @@ 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_bool(generate_dash_if_iop_compliant_mpd, + false, + "Try to generate DASH-IF IOPv3 compliant MPD. This is best effort " + "and does not guarantee compliance. Off by default until players " + "support IOP MPDs."); diff --git a/packager/app/mpd_flags.h b/packager/app/mpd_flags.h index ec1865c040..9f6ef3ec18 100644 --- a/packager/app/mpd_flags.h +++ b/packager/app/mpd_flags.h @@ -20,5 +20,6 @@ DECLARE_double(minimum_update_period); DECLARE_double(min_buffer_time); DECLARE_double(time_shift_buffer_depth); DECLARE_double(suggested_presentation_delay); +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 8be8a8fc18..1c8fb550fb 100644 --- a/packager/app/packager_main.cc +++ b/packager/app/packager_main.cc @@ -25,6 +25,7 @@ #include "packager/media/event/mpd_notify_muxer_listener.h" #include "packager/media/event/vod_media_info_dump_muxer_listener.h" #include "packager/media/formats/mp4/mp4_muxer.h" +#include "packager/mpd/base/dash_iop_mpd_notifier.h" #include "packager/mpd/base/mpd_builder.h" #include "packager/mpd/base/simple_mpd_notifier.h" @@ -258,8 +259,13 @@ bool RunPackager(const StreamDescriptorList& stream_descriptors) { FLAGS_single_segment ? kOnDemandProfile : kLiveProfile; std::vector base_urls; base::SplitString(FLAGS_base_urls, ',', &base_urls); - mpd_notifier.reset(new SimpleMpdNotifier(profile, mpd_options, base_urls, - FLAGS_mpd_output)); + if (FLAGS_generate_dash_if_iop_compliant_mpd) { + mpd_notifier.reset(new DashIopMpdNotifier(profile, mpd_options, base_urls, + FLAGS_mpd_output)); + } else { + mpd_notifier.reset(new SimpleMpdNotifier(profile, mpd_options, base_urls, + FLAGS_mpd_output)); + } if (!mpd_notifier->Init()) { LOG(ERROR) << "MpdNotifier failed to initialize."; return false;