From 596d77476b0ab7e1ccacbbe5b7ebaccfd99bbfd4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 26 Aug 2013 22:11:21 +0100 Subject: Try to add correct namespace for 3D CPLs. --- src/asset.h | 3 ++- src/mxf_asset.cc | 4 ++-- src/mxf_asset.h | 5 ++++- src/picture_asset.cc | 14 +++++++++++++- src/picture_asset.h | 2 +- src/reel.cc | 4 ++-- src/subtitle_asset.cc | 2 +- src/subtitle_asset.h | 2 +- 8 files changed, 26 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/asset.h b/src/asset.h index 3dffa9ab..a2202cd6 100644 --- a/src/asset.h +++ b/src/asset.h @@ -59,8 +59,9 @@ public: /** Write details of the asset to a CPL AssetList node. * @param p Parent node. + * @param i true to use the Interop standard, false for SMPTE. */ - virtual void write_to_cpl (xmlpp::Node *) const = 0; + virtual void write_to_cpl (xmlpp::Node* p, bool i) const = 0; /** Write details of the asset to a PKL AssetList node. * @param p Parent node. diff --git a/src/mxf_asset.cc b/src/mxf_asset.cc index a7cc0a58..f8f54861 100644 --- a/src/mxf_asset.cc +++ b/src/mxf_asset.cc @@ -144,9 +144,9 @@ MXFAsset::add_typed_key_id (xmlpp::Element* parent) const } void -MXFAsset::write_to_cpl (xmlpp::Node* node) const +MXFAsset::write_to_cpl (xmlpp::Node* node, bool interop) const { - xmlpp::Node* a = node->add_child (cpl_node_name ()); + xmlpp::Node* a = node->add_child (cpl_node_name (), cpl_node_namespace (interop)); a->add_child ("Id")->add_child_text ("urn:uuid:" + _uuid); a->add_child ("AnnotationText")->add_child_text (_file_name); a->add_child ("EditRate")->add_child_text (lexical_cast (_edit_rate) + " 1"); diff --git a/src/mxf_asset.h b/src/mxf_asset.h index b9842dda..3a0c1071 100644 --- a/src/mxf_asset.h +++ b/src/mxf_asset.h @@ -61,7 +61,7 @@ public: virtual bool equals (boost::shared_ptr other, EqualityOptions opt, boost::function note) const; - virtual void write_to_cpl (xmlpp::Node *) const; + virtual void write_to_cpl (xmlpp::Node *, bool interop) const; /** Fill in a ADSCP::WriteInfo struct. * @param w struct to fill in. @@ -89,6 +89,9 @@ public: protected: virtual std::string key_type () const = 0; virtual std::string cpl_node_name () const = 0; + virtual std::string cpl_node_namespace (bool) const { + return ""; + } /** Signal to emit to report progress, or 0 */ boost::signals2::signal* _progress; diff --git a/src/picture_asset.cc b/src/picture_asset.cc index e1c1f86c..07cc195d 100644 --- a/src/picture_asset.cc +++ b/src/picture_asset.cc @@ -85,6 +85,18 @@ StereoPictureAsset::cpl_node_name () const return "MainStereoscopicPicture"; } +string +StereoPictureAsset::cpl_node_namespace (bool interop) const +{ + if (interop) { + return "http://www.digicine.com/schemas/437-Y/2007/Main-Stereo-Picture-CPL"; + } else { + return "http://www.smpte-ra.org/schemas/429-10/2008/Main-Stereo-Picture-CPL"; + } + + return ""; +} + int StereoPictureAsset::edit_rate_factor () const { @@ -94,7 +106,7 @@ StereoPictureAsset::edit_rate_factor () const void PictureAsset::write_to_cpl (xmlpp::Node* node, bool interop) const { - MXFAsset::write_to_cpl (node); + MXFAsset::write_to_cpl (node, interop); xmlpp::Node::NodeList c = node->get_children (); xmlpp::Node::NodeList::iterator i = c.begin(); diff --git a/src/picture_asset.h b/src/picture_asset.h index d9f2fe69..bd5770b7 100644 --- a/src/picture_asset.h +++ b/src/picture_asset.h @@ -95,7 +95,6 @@ protected: private: std::string key_type () const; - std::string cpl_node_name () const = 0; virtual int edit_rate_factor () const = 0; }; @@ -206,6 +205,7 @@ public: private: std::string cpl_node_name () const; + std::string cpl_node_namespace (bool) const; int edit_rate_factor () const; }; diff --git a/src/reel.cc b/src/reel.cc index d039f95b..3b49042a 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -43,11 +43,11 @@ Reel::write_to_cpl (xmlpp::Node* node, bool interop) const } if (_main_sound) { - _main_sound->write_to_cpl (asset_list); + _main_sound->write_to_cpl (asset_list, interop); } if (_main_subtitle) { - _main_subtitle->write_to_cpl (asset_list); + _main_subtitle->write_to_cpl (asset_list, interop); } } diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc index 7f4d47d0..44f2f74a 100644 --- a/src/subtitle_asset.cc +++ b/src/subtitle_asset.cc @@ -278,7 +278,7 @@ SubtitleAsset::add (shared_ptr s) } void -SubtitleAsset::write_to_cpl (xmlpp::Node* node) const +SubtitleAsset::write_to_cpl (xmlpp::Node* node, bool) const { /* XXX: should EditRate, Duration and IntrinsicDuration be in here? */ diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h index a76a3076..fc0d932c 100644 --- a/src/subtitle_asset.h +++ b/src/subtitle_asset.h @@ -130,7 +130,7 @@ public: SubtitleAsset (std::string directory, std::string xml_file); SubtitleAsset (std::string directory, std::string movie_title, std::string language); - void write_to_cpl (xmlpp::Node *) const; + void write_to_cpl (xmlpp::Node *, bool) const; virtual bool equals (boost::shared_ptr, EqualityOptions, boost::function note) const { /* XXX */ note (ERROR, "subtitle assets not compared yet"); -- cgit v1.2.3