summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-01-15 09:43:41 +0000
committerCarl Hetherington <cth@carlh.net>2014-01-15 09:43:41 +0000
commitbf59c288798851808359575662f202d390032aa7 (patch)
treecbf4f646a60787614e25eeeb3c436432a04ea739 /src
parent39f0ae0efb3406357253d19bf7588f3832735d0b (diff)
Use MXFAsset::_interop to decide on whether to write asset XML as Interop or SMPTE.
Diffstat (limited to 'src')
-rw-r--r--src/asset.h3
-rw-r--r--src/cpl.cc2
-rw-r--r--src/mono_picture_asset.cc2
-rw-r--r--src/mxf_asset.cc8
-rw-r--r--src/mxf_asset.h7
-rw-r--r--src/picture_asset.cc6
-rw-r--r--src/picture_asset.h2
-rw-r--r--src/picture_asset_writer_common.cc2
-rw-r--r--src/reel.cc10
-rw-r--r--src/reel.h2
-rw-r--r--src/sound_asset.cc4
-rw-r--r--src/stereo_picture_asset.cc4
-rw-r--r--src/stereo_picture_asset.h2
-rw-r--r--src/subtitle_asset.cc2
-rw-r--r--src/subtitle_asset.h2
15 files changed, 28 insertions, 30 deletions
diff --git a/src/asset.h b/src/asset.h
index dbe3deba..269d5c4b 100644
--- a/src/asset.h
+++ b/src/asset.h
@@ -59,9 +59,8 @@ public:
/** Write details of the asset to a CPL AssetList node.
* @param p Parent element.
- * @param i true to use the Interop standard, false for SMPTE.
*/
- virtual void write_to_cpl (xmlpp::Element* p, bool i) const = 0;
+ virtual void write_to_cpl (xmlpp::Element* p) const = 0;
/** Write details of the asset to a PKL AssetList node.
* @param p Parent node.
diff --git a/src/cpl.cc b/src/cpl.cc
index 12fdf102..dcb730ff 100644
--- a/src/cpl.cc
+++ b/src/cpl.cc
@@ -228,7 +228,7 @@ CPL::write_xml (bool interop, XMLMetadata const & metadata, shared_ptr<const Sig
xmlpp::Element* reel_list = root->add_child ("ReelList");
for (list<shared_ptr<Reel> >::const_iterator i = _reels.begin(); i != _reels.end(); ++i) {
- (*i)->write_to_cpl (reel_list, interop);
+ (*i)->write_to_cpl (reel_list);
}
if (signer) {
diff --git a/src/mono_picture_asset.cc b/src/mono_picture_asset.cc
index 8986e1ff..c446408d 100644
--- a/src/mono_picture_asset.cc
+++ b/src/mono_picture_asset.cc
@@ -58,7 +58,7 @@ MonoPictureAsset::create (boost::function<boost::filesystem::path (int)> get_pat
picture_desc.EditRate = ASDCP::Rational (_edit_rate, 1);
ASDCP::WriterInfo writer_info;
- fill_writer_info (&writer_info, _uuid, _interop, _metadata);
+ fill_writer_info (&writer_info, _uuid, _metadata);
ASDCP::JP2K::MXFWriter mxf_writer;
r = mxf_writer.OpenWrite (path().string().c_str(), writer_info, picture_desc, 16384, false);
diff --git a/src/mxf_asset.cc b/src/mxf_asset.cc
index eef8ff63..a2ee9f25 100644
--- a/src/mxf_asset.cc
+++ b/src/mxf_asset.cc
@@ -59,13 +59,13 @@ MXFAsset::~MXFAsset ()
}
void
-MXFAsset::fill_writer_info (ASDCP::WriterInfo* writer_info, string uuid, bool interop, MXFMetadata const & metadata)
+MXFAsset::fill_writer_info (ASDCP::WriterInfo* writer_info, string uuid, MXFMetadata const & metadata)
{
writer_info->ProductVersion = metadata.product_version;
writer_info->CompanyName = metadata.company_name;
writer_info->ProductName = metadata.product_name.c_str();
- if (interop) {
+ if (_interop) {
writer_info->LabelSetType = ASDCP::LS_MXF_INTEROP;
} else {
writer_info->LabelSetType = ASDCP::LS_MXF_SMPTE;
@@ -108,9 +108,9 @@ MXFAsset::equals (shared_ptr<const Asset> other, EqualityOptions opt, boost::fun
}
void
-MXFAsset::write_to_cpl (xmlpp::Element* node, bool interop) const
+MXFAsset::write_to_cpl (xmlpp::Element* node) const
{
- pair<string, string> const attr = cpl_node_attribute (interop);
+ pair<string, string> const attr = cpl_node_attribute ();
xmlpp::Element* a = node->add_child (cpl_node_name ());
if (!attr.first.empty ()) {
a->set_attribute (attr.first, attr.second);
diff --git a/src/mxf_asset.h b/src/mxf_asset.h
index 68445425..e406f400 100644
--- a/src/mxf_asset.h
+++ b/src/mxf_asset.h
@@ -50,15 +50,14 @@ public:
~MXFAsset ();
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::Element *, bool interop) const;
+ virtual void write_to_cpl (xmlpp::Element *) const;
virtual std::string key_type () const = 0;
/** Fill in a ADSCP::WriteInfo struct.
* @param w struct to fill in.
* @param uuid uuid to use.
- * @param true to label as interop, false for SMPTE.
*/
- void fill_writer_info (ASDCP::WriterInfo* w, std::string uuid, bool interop, MXFMetadata const & metadata);
+ void fill_writer_info (ASDCP::WriterInfo* w, std::string uuid, MXFMetadata const & metadata);
void set_progress (boost::signals2::signal<void (float)>* progress) {
_progress = progress;
@@ -107,7 +106,7 @@ public:
protected:
virtual std::string cpl_node_name () const = 0;
- virtual std::pair<std::string, std::string> cpl_node_attribute (bool) const {
+ virtual std::pair<std::string, std::string> cpl_node_attribute () const {
return std::make_pair ("", "");
}
diff --git a/src/picture_asset.cc b/src/picture_asset.cc
index 20ea2c9f..b2eecee5 100644
--- a/src/picture_asset.cc
+++ b/src/picture_asset.cc
@@ -59,9 +59,9 @@ PictureAsset::PictureAsset (boost::filesystem::path directory, boost::filesystem
}
void
-PictureAsset::write_to_cpl (xmlpp::Element* node, bool interop) const
+PictureAsset::write_to_cpl (xmlpp::Element* node) const
{
- MXFAsset::write_to_cpl (node, interop);
+ MXFAsset::write_to_cpl (node);
xmlpp::Node::NodeList c = node->get_children ();
xmlpp::Node::NodeList::iterator i = c.begin();
@@ -72,7 +72,7 @@ PictureAsset::write_to_cpl (xmlpp::Element* node, bool interop) const
assert (i != c.end ());
(*i)->add_child ("FrameRate")->add_child_text (lexical_cast<string> (_edit_rate * edit_rate_factor ()) + " 1");
- if (interop) {
+ if (_interop) {
stringstream s;
s << std::fixed << std::setprecision (2) << (float (_size.width) / _size.height);
(*i)->add_child ("ScreenAspectRatio")->add_child_text (s.str ());
diff --git a/src/picture_asset.h b/src/picture_asset.h
index a11c286c..b8dab052 100644
--- a/src/picture_asset.h
+++ b/src/picture_asset.h
@@ -76,7 +76,7 @@ public:
_size = s;
}
- void write_to_cpl (xmlpp::Element *, bool) const;
+ void write_to_cpl (xmlpp::Element *) const;
protected:
diff --git a/src/picture_asset_writer_common.cc b/src/picture_asset_writer_common.cc
index 99f55be0..bb418fe0 100644
--- a/src/picture_asset_writer_common.cc
+++ b/src/picture_asset_writer_common.cc
@@ -42,7 +42,7 @@ void libdcp::start (PictureAssetWriter* writer, shared_ptr<P> state, Q* asset, u
state->j2k_parser.FillPictureDescriptor (state->picture_descriptor);
state->picture_descriptor.EditRate = ASDCP::Rational (asset->edit_rate(), 1);
- asset->fill_writer_info (&state->writer_info, asset->uuid(), writer->_asset->interop(), writer->_asset->metadata());
+ asset->fill_writer_info (&state->writer_info, asset->uuid(), writer->_asset->metadata());
Kumu::Result_t r = state->mxf_writer.OpenWrite (
asset->path().string().c_str(),
diff --git a/src/reel.cc b/src/reel.cc
index b729695c..ff51c025 100644
--- a/src/reel.cc
+++ b/src/reel.cc
@@ -35,7 +35,7 @@ using boost::dynamic_pointer_cast;
using namespace libdcp;
void
-Reel::write_to_cpl (xmlpp::Element* node, bool interop) const
+Reel::write_to_cpl (xmlpp::Element* node) const
{
xmlpp::Element* reel = node->add_child ("Reel");
reel->add_child("Id")->add_child_text ("urn:uuid:" + make_uuid());
@@ -43,20 +43,20 @@ Reel::write_to_cpl (xmlpp::Element* node, bool interop) const
if (_main_picture && dynamic_pointer_cast<MonoPictureAsset> (_main_picture)) {
/* Mono pictures come before other stuff... */
- _main_picture->write_to_cpl (asset_list, interop);
+ _main_picture->write_to_cpl (asset_list);
}
if (_main_sound) {
- _main_sound->write_to_cpl (asset_list, interop);
+ _main_sound->write_to_cpl (asset_list);
}
if (_main_subtitle) {
- _main_subtitle->write_to_cpl (asset_list, interop);
+ _main_subtitle->write_to_cpl (asset_list);
}
if (_main_picture && dynamic_pointer_cast<StereoPictureAsset> (_main_picture)) {
/* ... but stereo pictures must come after */
- _main_picture->write_to_cpl (asset_list, interop);
+ _main_picture->write_to_cpl (asset_list);
}
}
diff --git a/src/reel.h b/src/reel.h
index 54be9a5d..35302f17 100644
--- a/src/reel.h
+++ b/src/reel.h
@@ -64,7 +64,7 @@ public:
return _main_subtitle;
}
- void write_to_cpl (xmlpp::Element *, bool) const;
+ void write_to_cpl (xmlpp::Element *) const;
bool encrypted () const;
diff --git a/src/sound_asset.cc b/src/sound_asset.cc
index 7033f6af..0cc7cdba 100644
--- a/src/sound_asset.cc
+++ b/src/sound_asset.cc
@@ -150,7 +150,7 @@ SoundAsset::create (boost::function<boost::filesystem::path (Channel)> get_path)
frame_buffer.Size (ASDCP::PCM::CalcFrameBufferSize (audio_desc));
ASDCP::WriterInfo writer_info;
- MXFAsset::fill_writer_info (&writer_info, _uuid, _interop, _metadata);
+ MXFAsset::fill_writer_info (&writer_info, _uuid, _metadata);
ASDCP::PCM::MXFWriter mxf_writer;
r = mxf_writer.OpenWrite (path().string().c_str(), writer_info, audio_desc);
@@ -332,7 +332,7 @@ SoundAssetWriter::SoundAssetWriter (SoundAsset* a)
_state->frame_buffer.Size (ASDCP::PCM::CalcFrameBufferSize (_state->audio_desc));
memset (_state->frame_buffer.Data(), 0, _state->frame_buffer.Capacity());
- _asset->fill_writer_info (&_state->writer_info, _asset->uuid (), _asset->interop(), _asset->metadata());
+ _asset->fill_writer_info (&_state->writer_info, _asset->uuid (), _asset->metadata());
Kumu::Result_t r = _state->mxf_writer.OpenWrite (_asset->path().string().c_str(), _state->writer_info, _state->audio_desc);
if (ASDCP_FAILURE (r)) {
diff --git a/src/stereo_picture_asset.cc b/src/stereo_picture_asset.cc
index 1f2230f7..47a41cc2 100644
--- a/src/stereo_picture_asset.cc
+++ b/src/stereo_picture_asset.cc
@@ -132,9 +132,9 @@ StereoPictureAsset::cpl_node_name () const
}
pair<string, string>
-StereoPictureAsset::cpl_node_attribute (bool interop) const
+StereoPictureAsset::cpl_node_attribute () const
{
- if (interop) {
+ if (_interop) {
return make_pair ("xmlns:msp-cpl", "http://www.digicine.com/schemas/437-Y/2007/Main-Stereo-Picture-CPL");
} else {
return make_pair ("xmlns:msp-cpl", "http://www.smpte-ra.org/schemas/429-10/2008/Main-Stereo-Picture-CPL");
diff --git a/src/stereo_picture_asset.h b/src/stereo_picture_asset.h
index 6a96bf02..64cdb6b3 100644
--- a/src/stereo_picture_asset.h
+++ b/src/stereo_picture_asset.h
@@ -40,7 +40,7 @@ public:
private:
std::string cpl_node_name () const;
- std::pair<std::string, std::string> cpl_node_attribute (bool) const;
+ std::pair<std::string, std::string> cpl_node_attribute () const;
int edit_rate_factor () const;
};
diff --git a/src/subtitle_asset.cc b/src/subtitle_asset.cc
index 97c48978..a48a614d 100644
--- a/src/subtitle_asset.cc
+++ b/src/subtitle_asset.cc
@@ -279,7 +279,7 @@ SubtitleAsset::add (shared_ptr<Subtitle> s)
}
void
-SubtitleAsset::write_to_cpl (xmlpp::Element* node, bool) const
+SubtitleAsset::write_to_cpl (xmlpp::Element* node) const
{
/* XXX: should EditRate, Duration and IntrinsicDuration be in here? */
diff --git a/src/subtitle_asset.h b/src/subtitle_asset.h
index 7a00e036..74ab9873 100644
--- a/src/subtitle_asset.h
+++ b/src/subtitle_asset.h
@@ -139,7 +139,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::Element *, bool) const;
+ void write_to_cpl (xmlpp::Element *) 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");