From c9cf540a0fee44b724d1f879489dd7e7f51c60c7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 27 Aug 2013 20:13:53 +0100 Subject: Basics of OV/supplemental support when reading. --- src/cpl.cc | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'src/cpl.cc') diff --git a/src/cpl.cc b/src/cpl.cc index 8d8f6a00..e22ddc71 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -54,10 +54,10 @@ CPL::CPL (string directory, string name, ContentKind content_kind, int length, i /** Construct a CPL object from a XML file. * @param directory The directory containing this CPL's DCP. * @param file The CPL XML filename. - * @param asset_map The corresponding asset map. + * @param asset_maps AssetMaps to look for assets in. * @param require_mxfs true to throw an exception if a required MXF file does not exist. */ -CPL::CPL (string directory, string file, shared_ptr asset_map, bool require_mxfs) +CPL::CPL (string directory, string file, list > asset_maps, bool require_mxfs) : _directory (directory) , _content_kind (FEATURE) , _length (0) @@ -79,7 +79,7 @@ CPL::CPL (string directory, string file, shared_ptrid.substr (9); - for (list >::iterator i = cpl->reels.begin(); i != cpl->reels.end(); ++i) { + for (list >::iterator i = cpl->reels.begin(); i != cpl->reels.end(); ++i) { shared_ptr p; @@ -107,7 +107,7 @@ CPL::CPL (string directory, string file, shared_ptrasset_from_id (p->id)->chunks.front()->path + asset_from_id (asset_maps, p->id)->chunks.front()->path ) ); @@ -127,7 +127,7 @@ CPL::CPL (string directory, string file, shared_ptrasset_from_id (p->id)->chunks.front()->path, + asset_from_id (asset_maps, p->id)->chunks.front()->path, _fps, p->duration ) @@ -153,7 +153,7 @@ CPL::CPL (string directory, string file, shared_ptrasset_from_id ((*i)->asset_list->main_sound->id)->chunks.front()->path + asset_from_id (asset_maps, (*i)->asset_list->main_sound->id)->chunks.front()->path ) ); @@ -176,7 +176,7 @@ CPL::CPL (string directory, string file, shared_ptrasset_from_id ((*i)->asset_list->main_subtitle->id)->chunks.front()->path + asset_from_id (asset_maps, (*i)->asset_list->main_subtitle->id)->chunks.front()->path ) ); @@ -508,3 +508,16 @@ CPL::add_kdm (KDM const & kdm) (*i)->add_kdm (kdm); } } + +shared_ptr +CPL::asset_from_id (list > asset_maps, string id) const +{ + for (list >::const_iterator i = asset_maps.begin(); i != asset_maps.end(); ++i) { + shared_ptr a = (*i)->asset_from_id (id); + if (a) { + return a; + } + } + + return shared_ptr (); +} -- cgit v1.2.3