diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-09-13 10:33:27 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-09-13 10:33:27 +0100 |
| commit | f40c9704ce44234558bba1ad15de42a50475f1e3 (patch) | |
| tree | 23b9351c4996fe19a3f455ffc0915bcea58b6830 | |
| parent | f7c73615a49d308040a4a5d40677ecab08c21841 (diff) | |
Various fixes to incorrect Atmos read/write wrt XML namespaces.
| -rw-r--r-- | src/reel.cc | 2 | ||||
| -rw-r--r-- | src/reel_asset.cc | 12 | ||||
| -rw-r--r-- | src/reel_asset.h | 7 | ||||
| -rw-r--r-- | src/reel_atmos_asset.cc | 9 | ||||
| -rw-r--r-- | src/reel_atmos_asset.h | 1 | ||||
| -rw-r--r-- | test/dcp_test.cc | 14 | ||||
| -rw-r--r-- | test/ref/DCP/dcp_test5/ASSETMAP.xml | 2 | ||||
| -rw-r--r-- | test/ref/DCP/dcp_test5/cpl_330161f5-434e-424a-a701-3d3f26700c52.xml | 2 | ||||
| -rw-r--r-- | test/ref/DCP/dcp_test5/pkl_a0488650-63ea-4b53-92a3-00a2c4e516fe.xml | 2 |
9 files changed, 43 insertions, 8 deletions
diff --git a/src/reel.cc b/src/reel.cc index 50c780f4..b94197d0 100644 --- a/src/reel.cc +++ b/src/reel.cc @@ -82,7 +82,7 @@ Reel::Reel (boost::shared_ptr<const cxml::Node> node) _main_subtitle.reset (new ReelSubtitleAsset (main_subtitle)); } - shared_ptr<cxml::Node> atmos = asset_list->optional_node_child ("axd:AuxData"); + shared_ptr<cxml::Node> atmos = asset_list->optional_node_child ("AuxData"); if (atmos) { _atmos.reset (new ReelAtmosAsset (atmos)); } diff --git a/src/reel_asset.cc b/src/reel_asset.cc index 60c3242c..bed05dfa 100644 --- a/src/reel_asset.cc +++ b/src/reel_asset.cc @@ -95,11 +95,15 @@ ReelAsset::ReelAsset (shared_ptr<const cxml::Node> node) void ReelAsset::write_to_cpl (xmlpp::Node* node, Standard standard) const { - pair<string, string> const attr = cpl_node_attribute (standard); xmlpp::Element* a = node->add_child (cpl_node_name ()); + pair<string, string> const attr = cpl_node_attribute (standard); if (!attr.first.empty ()) { a->set_attribute (attr.first, attr.second); } + pair<string, string> const ns = cpl_node_namespace (); + if (!ns.first.empty ()) { + a->set_namespace_declaration (ns.first, ns.second); + } a->add_child("Id")->add_child_text ("urn:uuid:" + _id); a->add_child("AnnotationText")->add_child_text (_annotation_text); a->add_child("EditRate")->add_child_text (String::compose ("%1 %2", _edit_rate.numerator, _edit_rate.denominator)); @@ -117,6 +121,12 @@ ReelAsset::cpl_node_attribute (Standard) const return make_pair ("", ""); } +pair<string, string> +ReelAsset::cpl_node_namespace () const +{ + return make_pair ("", ""); +} + bool ReelAsset::equals (shared_ptr<const ReelAsset> other, EqualityOptions opt, NoteHandler note) const { diff --git a/src/reel_asset.h b/src/reel_asset.h index c7c9f73e..1e826a33 100644 --- a/src/reel_asset.h +++ b/src/reel_asset.h @@ -122,11 +122,12 @@ protected: */ virtual std::string cpl_node_name () const = 0; - /** @return Any attribute that should be used on the asset's node in the - * CPL. - */ + /** @return Any attribute that should be used on the asset's node in the CPL */ virtual std::pair<std::string, std::string> cpl_node_attribute (Standard) const; + /** @return Any namespace that should be used on the asset's node in the CPL */ + virtual std::pair<std::string, std::string> cpl_node_namespace () const; + /** Reference to the asset (MXF or XML file) that this reel entry * applies to. */ diff --git a/src/reel_atmos_asset.cc b/src/reel_atmos_asset.cc index f1f7d7f6..8726b39c 100644 --- a/src/reel_atmos_asset.cc +++ b/src/reel_atmos_asset.cc @@ -41,6 +41,8 @@ #include <libxml++/libxml++.h> using std::string; +using std::pair; +using std::make_pair; using boost::shared_ptr; using namespace dcp; @@ -53,6 +55,7 @@ ReelAtmosAsset::ReelAtmosAsset (boost::shared_ptr<AtmosAsset> asset, int64_t ent ReelAtmosAsset::ReelAtmosAsset (boost::shared_ptr<const cxml::Node> node) : ReelAsset (node) { + node->ignore_child ("DataType"); node->done (); } @@ -62,6 +65,12 @@ ReelAtmosAsset::cpl_node_name () const return "axd:AuxData"; } +pair<string, string> +ReelAtmosAsset::cpl_node_namespace () const +{ + return make_pair ("http://www.dolby.com/schemas/2012/AD", "axd"); +} + string ReelAtmosAsset::key_type () const { diff --git a/src/reel_atmos_asset.h b/src/reel_atmos_asset.h index 75e50e8d..e7ea51aa 100644 --- a/src/reel_atmos_asset.h +++ b/src/reel_atmos_asset.h @@ -64,6 +64,7 @@ public: private: std::string key_type () const; std::string cpl_node_name () const; + std::pair<std::string, std::string> cpl_node_namespace () const; }; } diff --git a/test/dcp_test.cc b/test/dcp_test.cc index ce10ee28..0d7cea2d 100644 --- a/test/dcp_test.cc +++ b/test/dcp_test.cc @@ -278,3 +278,17 @@ BOOST_AUTO_TEST_CASE (dcp_test5) /* build/test/DCP/dcp_test5 is checked against test/ref/DCP/dcp_test5 by run/tests */ } + +/** Basic tests of reading a 2D DCP with an Atmos track */ +BOOST_AUTO_TEST_CASE (dcp_test6) +{ + dcp::DCP dcp ("test/ref/DCP/dcp_test5"); + dcp.read (); + + BOOST_REQUIRE_EQUAL (dcp.cpls().size(), 1); + BOOST_REQUIRE_EQUAL (dcp.cpls().front()->reels().size(), 1); + BOOST_CHECK (dcp.cpls().front()->reels().front()->main_picture()); + BOOST_CHECK (dcp.cpls().front()->reels().front()->main_sound()); + BOOST_CHECK (!dcp.cpls().front()->reels().front()->main_subtitle()); + BOOST_CHECK (dcp.cpls().front()->reels().front()->atmos()); +} diff --git a/test/ref/DCP/dcp_test5/ASSETMAP.xml b/test/ref/DCP/dcp_test5/ASSETMAP.xml index ebe88a8e..9bda0c4d 100644 --- a/test/ref/DCP/dcp_test5/ASSETMAP.xml +++ b/test/ref/DCP/dcp_test5/ASSETMAP.xml @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?> -<AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM"><Id>urn:uuid:7c247206-50b3-487d-96ed-29b19512a4bb</Id><AnnotationText>Created by OpenDCP 0.0.25</AnnotationText><Creator>OpenDCP 0.0.25</Creator><VolumeCount>1</VolumeCount><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><AssetList><Asset><Id>urn:uuid:a0488650-63ea-4b53-92a3-00a2c4e516fe</Id><PackingList>true</PackingList><ChunkList><Chunk><Path>pkl_a0488650-63ea-4b53-92a3-00a2c4e516fe.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1022</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:330161f5-434e-424a-a701-3d3f26700c52</Id><ChunkList><Chunk><Path>cpl_330161f5-434e-424a-a701-3d3f26700c52.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1768</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:402c5a88-2512-4465-9c0b-cfa687dbc5d0</Id><ChunkList><Chunk><Path>video.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>26080</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:78f4f085-0901-4a0f-96f9-e21987072a51</Id><ChunkList><Chunk><Path>audio.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>161326</Length></Chunk></ChunkList></Asset></AssetList></AssetMap> +<AssetMap xmlns="http://www.smpte-ra.org/schemas/429-9/2007/AM"><Id>urn:uuid:7c247206-50b3-487d-96ed-29b19512a4bb</Id><AnnotationText>Created by OpenDCP 0.0.25</AnnotationText><Creator>OpenDCP 0.0.25</Creator><VolumeCount>1</VolumeCount><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><AssetList><Asset><Id>urn:uuid:a0488650-63ea-4b53-92a3-00a2c4e516fe</Id><PackingList>true</PackingList><ChunkList><Chunk><Path>pkl_a0488650-63ea-4b53-92a3-00a2c4e516fe.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1022</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:330161f5-434e-424a-a701-3d3f26700c52</Id><ChunkList><Chunk><Path>cpl_330161f5-434e-424a-a701-3d3f26700c52.xml</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>1817</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:402c5a88-2512-4465-9c0b-cfa687dbc5d0</Id><ChunkList><Chunk><Path>video.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>26080</Length></Chunk></ChunkList></Asset><Asset><Id>urn:uuid:78f4f085-0901-4a0f-96f9-e21987072a51</Id><ChunkList><Chunk><Path>audio.mxf</Path><VolumeIndex>1</VolumeIndex><Offset>0</Offset><Length>161326</Length></Chunk></ChunkList></Asset></AssetList></AssetMap> diff --git a/test/ref/DCP/dcp_test5/cpl_330161f5-434e-424a-a701-3d3f26700c52.xml b/test/ref/DCP/dcp_test5/cpl_330161f5-434e-424a-a701-3d3f26700c52.xml index 7a584957..45587f5a 100644 --- a/test/ref/DCP/dcp_test5/cpl_330161f5-434e-424a-a701-3d3f26700c52.xml +++ b/test/ref/DCP/dcp_test5/cpl_330161f5-434e-424a-a701-3d3f26700c52.xml @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?> -<CompositionPlaylist xmlns="http://www.smpte-ra.org/schemas/429-7/2006/CPL"><Id>urn:uuid:330161f5-434e-424a-a701-3d3f26700c52</Id><AnnotationText>A Test DCP</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><ContentTitleText>A Test DCP</ContentTitleText><ContentKind>feature</ContentKind><ContentVersion><Id>urn:uri:81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00</Id><LabelText>81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00</LabelText></ContentVersion><RatingList/><ReelList><Reel><Id>urn:uuid:4be406ed-9b7d-4746-bf35-e73598ef1e64</Id><AssetList><MainPicture><Id>urn:uuid:402c5a88-2512-4465-9c0b-cfa687dbc5d0</Id><AnnotationText>video.mxf</AnnotationText><EditRate>24 1</EditRate><IntrinsicDuration>24</IntrinsicDuration><EntryPoint>0</EntryPoint><Duration>24</Duration><Hash>eiqr9sUevuwoy7pprmgU6r0zBD8=</Hash><FrameRate>24 1</FrameRate><ScreenAspectRatio>32 32</ScreenAspectRatio></MainPicture><MainSound><Id>urn:uuid:78f4f085-0901-4a0f-96f9-e21987072a51</Id><AnnotationText>audio.mxf</AnnotationText><EditRate>24 1</EditRate><IntrinsicDuration>24</IntrinsicDuration><EntryPoint>0</EntryPoint><Duration>24</Duration><Hash>iTTXhr9BviLgys5ldPFRzPXP2GM=</Hash></MainSound><axd:AuxData><Id>urn:uuid:73f2a92b-f963-47cc-a3d7-c7ca2fd10a64</Id><AnnotationText>20160218_NameOfFilm_FTR_OV_EN_A_dcs_r01.mxf</AnnotationText><EditRate>24 1</EditRate><IntrinsicDuration>1489</IntrinsicDuration><EntryPoint>0</EntryPoint><Duration>1489</Duration><Hash>jo8pQSebhScPN4EVvvpIUWRrDeM=</Hash><axd:DataType>urn:smpte:ul:060e2b34.04010105.0e090604.00000000</axd:DataType></axd:AuxData></AssetList></Reel></ReelList></CompositionPlaylist> +<CompositionPlaylist xmlns="http://www.smpte-ra.org/schemas/429-7/2006/CPL"><Id>urn:uuid:330161f5-434e-424a-a701-3d3f26700c52</Id><AnnotationText>A Test DCP</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><ContentTitleText>A Test DCP</ContentTitleText><ContentKind>feature</ContentKind><ContentVersion><Id>urn:uri:81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00</Id><LabelText>81fb54df-e1bf-4647-8788-ea7ba154375b_2012-07-17T04:45:18+00:00</LabelText></ContentVersion><RatingList/><ReelList><Reel><Id>urn:uuid:4be406ed-9b7d-4746-bf35-e73598ef1e64</Id><AssetList><MainPicture><Id>urn:uuid:402c5a88-2512-4465-9c0b-cfa687dbc5d0</Id><AnnotationText>video.mxf</AnnotationText><EditRate>24 1</EditRate><IntrinsicDuration>24</IntrinsicDuration><EntryPoint>0</EntryPoint><Duration>24</Duration><Hash>eiqr9sUevuwoy7pprmgU6r0zBD8=</Hash><FrameRate>24 1</FrameRate><ScreenAspectRatio>32 32</ScreenAspectRatio></MainPicture><MainSound><Id>urn:uuid:78f4f085-0901-4a0f-96f9-e21987072a51</Id><AnnotationText>audio.mxf</AnnotationText><EditRate>24 1</EditRate><IntrinsicDuration>24</IntrinsicDuration><EntryPoint>0</EntryPoint><Duration>24</Duration><Hash>iTTXhr9BviLgys5ldPFRzPXP2GM=</Hash></MainSound><axd:AuxData xmlns:axd="http://www.dolby.com/schemas/2012/AD"><Id>urn:uuid:73f2a92b-f963-47cc-a3d7-c7ca2fd10a64</Id><AnnotationText>20160218_NameOfFilm_FTR_OV_EN_A_dcs_r01.mxf</AnnotationText><EditRate>24 1</EditRate><IntrinsicDuration>1489</IntrinsicDuration><EntryPoint>0</EntryPoint><Duration>1489</Duration><Hash>jo8pQSebhScPN4EVvvpIUWRrDeM=</Hash><axd:DataType>urn:smpte:ul:060e2b34.04010105.0e090604.00000000</axd:DataType></axd:AuxData></AssetList></Reel></ReelList></CompositionPlaylist> diff --git a/test/ref/DCP/dcp_test5/pkl_a0488650-63ea-4b53-92a3-00a2c4e516fe.xml b/test/ref/DCP/dcp_test5/pkl_a0488650-63ea-4b53-92a3-00a2c4e516fe.xml index 537dd15b..b9411549 100644 --- a/test/ref/DCP/dcp_test5/pkl_a0488650-63ea-4b53-92a3-00a2c4e516fe.xml +++ b/test/ref/DCP/dcp_test5/pkl_a0488650-63ea-4b53-92a3-00a2c4e516fe.xml @@ -1,2 +1,2 @@ <?xml version="1.0" encoding="UTF-8"?> -<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL"><Id>urn:uuid:a0488650-63ea-4b53-92a3-00a2c4e516fe</Id><AnnotationText>A Test DCP</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><AssetList><Asset><Id>urn:uuid:330161f5-434e-424a-a701-3d3f26700c52</Id><AnnotationText>330161f5-434e-424a-a701-3d3f26700c52</AnnotationText><Hash>xLrvmvHjV78RTv9EMZlcR6LMusY=</Hash><Size>1768</Size><Type>text/xml</Type></Asset><Asset><Id>urn:uuid:402c5a88-2512-4465-9c0b-cfa687dbc5d0</Id><AnnotationText>402c5a88-2512-4465-9c0b-cfa687dbc5d0</AnnotationText><Hash>eiqr9sUevuwoy7pprmgU6r0zBD8=</Hash><Size>26080</Size><Type>application/mxf</Type></Asset><Asset><Id>urn:uuid:78f4f085-0901-4a0f-96f9-e21987072a51</Id><AnnotationText>78f4f085-0901-4a0f-96f9-e21987072a51</AnnotationText><Hash>iTTXhr9BviLgys5ldPFRzPXP2GM=</Hash><Size>161326</Size><Type>application/mxf</Type></Asset></AssetList></PackingList> +<PackingList xmlns="http://www.smpte-ra.org/schemas/429-8/2007/PKL"><Id>urn:uuid:a0488650-63ea-4b53-92a3-00a2c4e516fe</Id><AnnotationText>A Test DCP</AnnotationText><IssueDate>2012-07-17T04:45:18+00:00</IssueDate><Issuer>OpenDCP 0.0.25</Issuer><Creator>OpenDCP 0.0.25</Creator><AssetList><Asset><Id>urn:uuid:330161f5-434e-424a-a701-3d3f26700c52</Id><AnnotationText>330161f5-434e-424a-a701-3d3f26700c52</AnnotationText><Hash>1k7O7TxEnXk811VbcQz/cVYF0lI=</Hash><Size>1817</Size><Type>text/xml</Type></Asset><Asset><Id>urn:uuid:402c5a88-2512-4465-9c0b-cfa687dbc5d0</Id><AnnotationText>402c5a88-2512-4465-9c0b-cfa687dbc5d0</AnnotationText><Hash>eiqr9sUevuwoy7pprmgU6r0zBD8=</Hash><Size>26080</Size><Type>application/mxf</Type></Asset><Asset><Id>urn:uuid:78f4f085-0901-4a0f-96f9-e21987072a51</Id><AnnotationText>78f4f085-0901-4a0f-96f9-e21987072a51</AnnotationText><Hash>iTTXhr9BviLgys5ldPFRzPXP2GM=</Hash><Size>161326</Size><Type>application/mxf</Type></Asset></AssetList></PackingList> |
