diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-04-02 23:10:24 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-04-04 23:37:15 +0200 |
| commit | 2da55dbe6da21975612584365db17db2ae9935b8 (patch) | |
| tree | 732e00fbe2ff44a01644d0b7572c8fa346e97eba /test/cpl_metadata_test.cc | |
| parent | 5adfa769c56f9594ffe895eb89bcbfb38c90c192 (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/cpl_metadata_test.cc')
| -rw-r--r-- | test/cpl_metadata_test.cc | 24 |
1 files changed, 22 insertions, 2 deletions
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)); |
