summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-04-02 23:10:24 +0200
committerCarl Hetherington <cth@carlh.net>2023-04-04 23:37:15 +0200
commit2da55dbe6da21975612584365db17db2ae9935b8 (patch)
tree732e00fbe2ff44a01644d0b7572c8fa346e97eba /test
parent5adfa769c56f9594ffe895eb89bcbfb38c90c192 (diff)
Pass MainSoundConfiguration object rather than a string.
I guess originally it was a string mostly because it's not very well defined, and Interop seemingly does whatever it wants. This basic change also means that things are checked more carefully, and so we must be more relaxed with some things seen in the wild that I can't find contradictions for in the standard (and also with the case of channel IDs, which does seem to be mentioned in the standard).
Diffstat (limited to 'test')
-rw-r--r--test/combine_test.cc4
-rw-r--r--test/cpl_metadata_test.cc24
-rw-r--r--test/mca_test.cc6
-rw-r--r--test/test.cc2
-rw-r--r--test/verify_test.cc12
5 files changed, 34 insertions, 14 deletions
diff --git a/test/combine_test.cc b/test/combine_test.cc
index 1ef4b882..23d4869c 100644
--- a/test/combine_test.cc
+++ b/test/combine_test.cc
@@ -343,7 +343,7 @@ BOOST_AUTO_TEST_CASE (combine_two_dcps_with_shared_asset)
cpl->set_content_version (
dcp::ContentVersion("urn:uuid:75ac29aa-42ac-1234-ecae-49251abefd11","content-version-label-text")
);
- cpl->set_main_sound_configuration("51/L,C,R,LFE,-,-");
+ cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
cpl->set_main_sound_sample_rate (48000);
cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
cpl->set_main_picture_active_area (dcp::Size(1440, 1080));
@@ -388,7 +388,7 @@ BOOST_AUTO_TEST_CASE (combine_two_dcps_with_duplicated_asset)
cpl->set_content_version (
dcp::ContentVersion("urn:uuid:75ac29aa-42ac-1234-ecae-49251abefd11","content-version-label-text")
);
- cpl->set_main_sound_configuration("51/L,C,R,LFE,-,-");
+ cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
cpl->set_main_sound_sample_rate (48000);
cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
cpl->set_main_picture_active_area (dcp::Size(1440, 1080));
diff --git a/test/cpl_metadata_test.cc b/test/cpl_metadata_test.cc
index 414cdc22..0ebf9078 100644
--- a/test/cpl_metadata_test.cc
+++ b/test/cpl_metadata_test.cc
@@ -154,6 +154,26 @@ BOOST_AUTO_TEST_CASE (main_sound_configuration_test5)
}
+/* 482-12 says that implementations may use case-insensitive comparisons for the channel identifiers,
+ * and there is one DCP in the private test suite (made by Disney) that uses LS for left surround.
+ */
+BOOST_AUTO_TEST_CASE(main_sound_configuration_test_case_insensitive)
+{
+ dcp::MainSoundConfiguration msc("51/L,-,C,LFE,LS,RS,HI,VIN");
+ BOOST_CHECK_EQUAL(msc.to_string(), "51/L,-,C,LFE,Ls,Rs,HI,VIN");
+ BOOST_CHECK_EQUAL(msc.channels(), 8);
+ BOOST_CHECK_EQUAL(msc.field(), dcp::MCASoundField::FIVE_POINT_ONE);
+ BOOST_CHECK_EQUAL(msc.mapping(0).get(), dcp::Channel::LEFT);
+ BOOST_CHECK(!msc.mapping(1));
+ BOOST_CHECK_EQUAL(msc.mapping(2).get(), dcp::Channel::CENTRE);
+ BOOST_CHECK_EQUAL(msc.mapping(3).get(), dcp::Channel::LFE);
+ BOOST_CHECK_EQUAL(msc.mapping(4).get(), dcp::Channel::LS);
+ BOOST_CHECK_EQUAL(msc.mapping(5).get(), dcp::Channel::RS);
+ BOOST_CHECK_EQUAL(msc.mapping(6).get(), dcp::Channel::HI);
+ BOOST_CHECK_EQUAL(msc.mapping(7).get(), dcp::Channel::VI);
+}
+
+
BOOST_AUTO_TEST_CASE (luminance_test1)
{
BOOST_CHECK_NO_THROW (dcp::Luminance(4, dcp::Luminance::Unit::CANDELA_PER_SQUARE_METRE));
@@ -283,7 +303,7 @@ BOOST_AUTO_TEST_CASE (cpl_metadata_write_test1)
msc.set_mapping (2, dcp::Channel::CENTRE);
msc.set_mapping (3, dcp::Channel::LFE);
msc.set_mapping (13, dcp::Channel::SYNC_SIGNAL);
- cpl.set_main_sound_configuration (msc.to_string());
+ cpl.set_main_sound_configuration(msc);
cpl.set_main_sound_sample_rate (48000);
cpl.set_main_picture_stored_area (dcp::Size(1998, 1080));
@@ -354,7 +374,7 @@ BOOST_AUTO_TEST_CASE (cpl_metadata_write_test2)
msc.set_mapping (2, dcp::Channel::CENTRE);
msc.set_mapping (3, dcp::Channel::LFE);
msc.set_mapping (13, dcp::Channel::SYNC_SIGNAL);
- cpl.set_main_sound_configuration (msc.to_string());
+ cpl.set_main_sound_configuration(msc);
cpl.set_main_sound_sample_rate (48000);
cpl.set_main_picture_stored_area (dcp::Size(1998, 1080));
diff --git a/test/mca_test.cc b/test/mca_test.cc
index 308d6602..bdfc9484 100644
--- a/test/mca_test.cc
+++ b/test/mca_test.cc
@@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE (parse_mca_descriptors_from_mxf_test)
dcp::CPL cpl("", dcp::ContentKind::FEATURE, dcp::Standard::SMPTE);
cpl.add (reel);
- cpl.set_main_sound_configuration("51/L,R,C,LFE,Ls,Rs");
+ cpl.set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,R,C,LFE,Ls,Rs"));
cpl.set_main_sound_sample_rate(48000);
cpl.set_main_picture_stored_area(dcp::Size(1998, 1080));
cpl.set_main_picture_active_area(dcp::Size(1998, 1080));
@@ -122,7 +122,7 @@ BOOST_AUTO_TEST_CASE (write_mca_descriptors_to_mxf_test)
dcp::CPL cpl("", dcp::ContentKind::FEATURE, dcp::Standard::SMPTE);
cpl.add (reel);
- cpl.set_main_sound_configuration("51/L,R,C,LFE,Ls,Rs");
+ cpl.set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,R,C,LFE,Ls,Rs"));
cpl.set_main_sound_sample_rate(48000);
cpl.set_main_picture_stored_area(dcp::Size(1998, 1080));
cpl.set_main_picture_active_area(dcp::Size(1998, 1080));
@@ -197,7 +197,7 @@ check_mca_descriptors(int suffix, vector<dcp::Channel> extra_active_channels, ve
dcp::CPL cpl("", dcp::ContentKind::FEATURE, dcp::Standard::SMPTE);
cpl.add(reel);
- cpl.set_main_sound_configuration("51/L,R,C,LFE,Ls,Rs");
+ cpl.set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,R,C,LFE,Ls,Rs"));
cpl.set_main_sound_sample_rate(48000);
cpl.set_main_picture_stored_area(dcp::Size(1998, 1080));
cpl.set_main_picture_active_area(dcp::Size(1998, 1080));
diff --git a/test/test.cc b/test/test.cc
index a8efa5c3..2dac199f 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -347,7 +347,7 @@ make_simple (boost::filesystem::path path, int reels, int frames, dcp::Standard
cpl->set_content_version (
dcp::ContentVersion("urn:uuid:75ac29aa-42ac-1234-ecae-49251abefd11", "content-version-label-text")
);
- cpl->set_main_sound_configuration("51/L,R,C,LFE,Ls,Rs");
+ cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,R,C,LFE,Ls,Rs"));
cpl->set_main_sound_sample_rate(sample_rate);
cpl->set_main_picture_stored_area(dcp::Size(1998, 1080));
cpl->set_main_picture_active_area(dcp::Size(1998, 1080));
diff --git a/test/verify_test.cc b/test/verify_test.cc
index b6293a05..d853bc81 100644
--- a/test/verify_test.cc
+++ b/test/verify_test.cc
@@ -995,7 +995,7 @@ BOOST_AUTO_TEST_CASE (verify_valid_cpl_metadata)
auto cpl = make_shared<dcp::CPL>("hello", dcp::ContentKind::TRAILER, dcp::Standard::SMPTE);
cpl->add (reel);
- cpl->set_main_sound_configuration("51/L,C,R,LFE,-,-");
+ cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
cpl->set_main_sound_sample_rate (48000);
cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
cpl->set_main_picture_active_area (dcp::Size(1440, 1080));
@@ -1052,7 +1052,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_cpl_metadata_bad_tag)
reel->add (black_picture_asset(dir));
auto cpl = make_shared<dcp::CPL>("hello", dcp::ContentKind::TRAILER, dcp::Standard::SMPTE);
cpl->add (reel);
- cpl->set_main_sound_configuration("51/L,C,R,LFE,-,-");
+ cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
cpl->set_main_sound_sample_rate (48000);
cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
cpl->set_main_picture_active_area (dcp::Size(1440, 1080));
@@ -1102,7 +1102,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_cpl_metadata_missing_tag)
reel->add (black_picture_asset(dir));
auto cpl = make_shared<dcp::CPL>("hello", dcp::ContentKind::TRAILER, dcp::Standard::SMPTE);
cpl->add (reel);
- cpl->set_main_sound_configuration("51/L,C,R,LFE,-,-");
+ cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
cpl->set_main_sound_sample_rate (48000);
cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
cpl->set_main_picture_active_area (dcp::Size(1440, 1080));
@@ -1190,7 +1190,7 @@ BOOST_AUTO_TEST_CASE (verify_invalid_language3)
cpl->add (reel);
cpl->_additional_subtitle_languages.push_back("this-is-wrong");
cpl->_additional_subtitle_languages.push_back("andso-is-this");
- cpl->set_main_sound_configuration("51/L,C,R,LFE,-,-");
+ cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
cpl->set_main_sound_sample_rate (48000);
cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
cpl->set_main_picture_active_area (dcp::Size(1440, 1080));
@@ -1241,7 +1241,7 @@ check_picture_size (int width, int height, int frame_rate, bool three_d)
auto cpl = make_shared<dcp::CPL>("A Test DCP", dcp::ContentKind::TRAILER, dcp::Standard::SMPTE);
cpl->set_annotation_text ("A Test DCP");
cpl->set_issue_date ("2012-07-17T04:45:18+00:00");
- cpl->set_main_sound_configuration("51/L,C,R,LFE,-,-");
+ cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
cpl->set_main_sound_sample_rate (48000);
cpl->set_main_picture_stored_area(dcp::Size(width, height));
cpl->set_main_picture_active_area(dcp::Size(width, height));
@@ -3050,7 +3050,7 @@ BOOST_AUTO_TEST_CASE (verify_partially_encrypted)
cpl->set_issuer ("OpenDCP 0.0.25");
cpl->set_creator ("OpenDCP 0.0.25");
cpl->set_issue_date ("2012-07-17T04:45:18+00:00");
- cpl->set_main_sound_configuration("51/L,C,R,LFE,-,-");
+ cpl->set_main_sound_configuration(dcp::MainSoundConfiguration("51/L,C,R,LFE,-,-"));
cpl->set_main_sound_sample_rate (48000);
cpl->set_main_picture_stored_area (dcp::Size(1998, 1080));
cpl->set_main_picture_active_area (dcp::Size(1440, 1080));