Try to add correct namespace for 3D CPLs.
authorCarl Hetherington <cth@carlh.net>
Mon, 26 Aug 2013 21:11:21 +0000 (22:11 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 26 Aug 2013 21:11:21 +0000 (22:11 +0100)
src/asset.h
src/mxf_asset.cc
src/mxf_asset.h
src/picture_asset.cc
src/picture_asset.h
src/reel.cc
src/subtitle_asset.cc
src/subtitle_asset.h

index 3dffa9abc3becc84b126d7ddeaf1dcfe64873711..a2202cd68f658172c4d9168deb8c14ce7673a000 100644 (file)
@@ -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.
index a7cc0a582b2edbf7caf6309ddbd39e0150872c75..f8f54861b9c13d60f7da71255ca3c176ef5b4ba2 100644 (file)
@@ -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<string> (_edit_rate) + " 1");
index b9842dda0b96cce53229734df0c2c6b78eac3a27..3a0c107175638e27370e30fabb46773ec0a02a1e 100644 (file)
@@ -61,7 +61,7 @@ public:
 
        virtual bool equals (boost::shared_ptr<const Asset> other, EqualityOptions opt, boost::function<void (NoteType, std::string)> 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<void (float)>* _progress;
index e1c1f86c8460bfb46d0c15822cbd29fb9e8444b5..07cc195dd1ca4ba5334b98e66ab459752b0a7b6d 100644 (file)
@@ -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();
index d9f2fe6901b65ace36a5e83f3326a57fc8d57dab..bd5770b72cae05b0347ffe1576ea2d2388c32e31 100644 (file)
@@ -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;
 };
        
index d039f95b2b93974d9ceded487ac2bc7c82a90a54..3b49042a144cd10e148e780880f8bd2f79e0ff7c 100644 (file)
@@ -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);
        }
 }
        
index 7f4d47d0d4cb7980e59e9751663388acf2bafa64..44f2f74a2ffebed75fa201e894663d7968af3d3d 100644 (file)
@@ -278,7 +278,7 @@ SubtitleAsset::add (shared_ptr<Subtitle> 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? */
 
index a76a307697d40997adb63e01927c0e6f268ed564..fc0d932c0790aa788044cb59112b48432f1b9526 100644 (file)
@@ -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<const Asset>, EqualityOptions, boost::function<void (NoteType, std::string)> note) const {
                /* XXX */
                note (ERROR, "subtitle assets not compared yet");