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;