summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-08-26 22:11:21 +0100
committerCarl Hetherington <cth@carlh.net>2013-08-26 22:11:21 +0100
commit596d77476b0ab7e1ccacbbe5b7ebaccfd99bbfd4 (patch)
tree9d3447978d17df8b2a9598e6daf0e568ac58c3cf
parentcc57a01f142a32e06f22622118dd8d24e3dfb140 (diff)
Try to add correct namespace for 3D CPLs.
-rw-r--r--src/asset.h3
-rw-r--r--src/mxf_asset.cc4
-rw-r--r--src/mxf_asset.h5
-rw-r--r--src/picture_asset.cc14
-rw-r--r--src/picture_asset.h2
-rw-r--r--src/reel.cc4
-rw-r--r--src/subtitle_asset.cc2
-rw-r--r--src/subtitle_asset.h2
8 files changed, 26 insertions, 10 deletions
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<string> (_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<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;
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<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? */
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<const Asset>, EqualityOptions, boost::function<void (NoteType, std::string)> note) const {
/* XXX */
note (ERROR, "subtitle assets not compared yet");