diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-02-12 23:26:07 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-02-12 23:26:07 +0000 |
| commit | b1f84f5635e4ebbd98882b39e5c5b19f62fe006e (patch) | |
| tree | c98b3a917f0487235848cfc73e73074fbfcc9d25 /test | |
| parent | c28b3d6f168607aca9995282b96647eb64a26dc9 (diff) | |
It builds again.
Diffstat (limited to 'test')
| -rw-r--r-- | test/audio_delay_test.cc | 13 | ||||
| -rw-r--r-- | test/audio_mapping_test.cc | 6 | ||||
| -rw-r--r-- | test/client_server_test.cc | 4 | ||||
| -rw-r--r-- | test/colour_conversion_test.cc | 4 | ||||
| -rw-r--r-- | test/ffmpeg_audio_test.cc | 27 | ||||
| -rw-r--r-- | test/image_test.cc | 32 | ||||
| -rw-r--r-- | test/make_black_test.cc | 4 | ||||
| -rw-r--r-- | test/ratio_test.cc | 20 | ||||
| -rw-r--r-- | test/recover_test.cc | 10 | ||||
| -rw-r--r-- | test/silence_padding_test.cc | 27 | ||||
| -rw-r--r-- | test/stream_test.cc | 12 | ||||
| -rw-r--r-- | test/subrip_test.cc | 4 | ||||
| -rw-r--r-- | test/test.cc | 12 |
13 files changed, 89 insertions, 86 deletions
diff --git a/test/audio_delay_test.cc b/test/audio_delay_test.cc index 77243ea6d..e8112613c 100644 --- a/test/audio_delay_test.cc +++ b/test/audio_delay_test.cc @@ -21,7 +21,8 @@ #include <libdcp/sound_frame.h> #include <libdcp/cpl.h> #include <libdcp/reel.h> -#include <libdcp/sound_asset.h> +#include <libdcp/sound_mxf.h> +#include <libdcp/reel_sound_asset.h> #include "lib/sndfile_content.h" #include "lib/dcp_content_type.h" #include "lib/ratio.h" @@ -53,10 +54,10 @@ void test_audio_delay (int delay_in_ms) boost::filesystem::path path = "build/test"; path /= film_name; path /= film->dcp_name (); - libdcp::DCP check (path.string ()); + dcp::DCP check (path.string ()); check.read (); - shared_ptr<const libdcp::SoundAsset> sound_asset = check.cpls().front()->reels().front()->main_sound (); + shared_ptr<const dcp::ReelSoundAsset> sound_asset = check.cpls().front()->reels().front()->main_sound (); BOOST_CHECK (sound_asset); /* Sample index in the DCP */ @@ -66,11 +67,11 @@ void test_audio_delay (int delay_in_ms) /* Delay in frames */ int const delay_in_frames = delay_in_ms * 48000 / 1000; - while (n < sound_asset->intrinsic_duration()) { - shared_ptr<const libdcp::SoundFrame> sound_frame = sound_asset->get_frame (frame++); + while (n < sound_asset->mxf()->intrinsic_duration()) { + shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->mxf()->get_frame (frame++); uint8_t const * d = sound_frame->data (); - for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->channels())) { + for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->mxf()->channels())) { /* Mono input so it will appear on centre */ int const sample = d[i + 7] | (d[i + 8] << 8); diff --git a/test/audio_mapping_test.cc b/test/audio_mapping_test.cc index a2a74104b..1fc20dcaf 100644 --- a/test/audio_mapping_test.cc +++ b/test/audio_mapping_test.cc @@ -35,10 +35,10 @@ BOOST_AUTO_TEST_CASE (audio_mapping_test) for (int i = 0; i < 4; ++i) { for (int j = 0; j < MAX_AUDIO_CHANNELS; ++j) { - BOOST_CHECK_EQUAL (four.get (i, static_cast<libdcp::Channel> (j)), i == j ? 1 : 0); + BOOST_CHECK_EQUAL (four.get (i, static_cast<dcp::Channel> (j)), i == j ? 1 : 0); } } - four.set (0, libdcp::RIGHT, 1); - BOOST_CHECK_EQUAL (four.get (0, libdcp::RIGHT), 1); + four.set (0, dcp::RIGHT, 1); + BOOST_CHECK_EQUAL (four.get (0, dcp::RIGHT), 1); } diff --git a/test/client_server_test.cc b/test/client_server_test.cc index 1ad156ae3..a80297ec6 100644 --- a/test/client_server_test.cc +++ b/test/client_server_test.cc @@ -41,7 +41,7 @@ do_remote_encode (shared_ptr<DCPVideoFrame> frame, ServerDescription description BOOST_AUTO_TEST_CASE (client_server_test) { - shared_ptr<Image> image (new Image (PIX_FMT_RGB24, libdcp::Size (1998, 1080), true)); + shared_ptr<Image> image (new Image (PIX_FMT_RGB24, dcp::Size (1998, 1080), true)); uint8_t* p = image->data()[0]; for (int y = 0; y < 1080; ++y) { @@ -54,7 +54,7 @@ BOOST_AUTO_TEST_CASE (client_server_test) p += image->stride()[0]; } - shared_ptr<Image> sub_image (new Image (PIX_FMT_RGBA, libdcp::Size (100, 200), true)); + shared_ptr<Image> sub_image (new Image (PIX_FMT_RGBA, dcp::Size (100, 200), true)); p = sub_image->data()[0]; for (int y = 0; y < 200; ++y) { uint8_t* q = p; diff --git a/test/colour_conversion_test.cc b/test/colour_conversion_test.cc index 3e90d542a..96c4d08a4 100644 --- a/test/colour_conversion_test.cc +++ b/test/colour_conversion_test.cc @@ -26,8 +26,8 @@ using std::cout; /* Basic test of identifier() for ColourConversion (i.e. a hash of the numbers) */ BOOST_AUTO_TEST_CASE (colour_conversion_test) { - ColourConversion A (2.4, true, libdcp::colour_matrix::srgb_to_xyz, 2.6); - ColourConversion B (2.4, false, libdcp::colour_matrix::srgb_to_xyz, 2.6); + ColourConversion A (2.4, true, dcp::colour_matrix::srgb_to_xyz, 2.6); + ColourConversion B (2.4, false, dcp::colour_matrix::srgb_to_xyz, 2.6); BOOST_CHECK_EQUAL (A.identifier(), "246ff9b7dc32c0488948a32a713924b3"); BOOST_CHECK_EQUAL (B.identifier(), "a8d1da30f96a121d8db06a03409758b3"); diff --git a/test/ffmpeg_audio_test.cc b/test/ffmpeg_audio_test.cc index bba05ae9b..f4954f517 100644 --- a/test/ffmpeg_audio_test.cc +++ b/test/ffmpeg_audio_test.cc @@ -24,8 +24,9 @@ #include <boost/test/unit_test.hpp> #include <libdcp/cpl.h> #include <libdcp/dcp.h> -#include <libdcp/sound_asset.h> +#include <libdcp/sound_mxf.h> #include <libdcp/sound_frame.h> +#include <libdcp/reel_sound_asset.h> #include <libdcp/reel.h> #include "lib/sndfile_content.h" #include "lib/film.h" @@ -59,56 +60,56 @@ BOOST_AUTO_TEST_CASE (ffmpeg_audio_test) boost::filesystem::path path = "build/test"; path /= "ffmpeg_audio_test"; path /= film->dcp_name (); - libdcp::DCP check (path.string ()); + dcp::DCP check (path.string ()); check.read (); - shared_ptr<const libdcp::SoundAsset> sound_asset = check.cpls().front()->reels().front()->main_sound (); + shared_ptr<const dcp::ReelSoundAsset> sound_asset = check.cpls().front()->reels().front()->main_sound (); BOOST_CHECK (sound_asset); - BOOST_CHECK (sound_asset->channels () == 6); + BOOST_CHECK (sound_asset->mxf()->channels () == 6); /* Sample index in the DCP */ int n = 0; /* DCP sound asset frame */ int frame = 0; - while (n < sound_asset->intrinsic_duration()) { - shared_ptr<const libdcp::SoundFrame> sound_frame = sound_asset->get_frame (frame++); + while (n < sound_asset->mxf()->intrinsic_duration()) { + shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->mxf()->get_frame (frame++); uint8_t const * d = sound_frame->data (); - for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->channels())) { + for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->mxf()->channels())) { - if (sound_asset->channels() > 0) { + if (sound_asset->mxf()->channels() > 0) { /* L should be silent */ int const sample = d[i + 0] | (d[i + 1] << 8); BOOST_CHECK_EQUAL (sample, 0); } - if (sound_asset->channels() > 1) { + if (sound_asset->mxf()->channels() > 1) { /* R should be silent */ int const sample = d[i + 2] | (d[i + 3] << 8); BOOST_CHECK_EQUAL (sample, 0); } - if (sound_asset->channels() > 2) { + if (sound_asset->mxf()->channels() > 2) { /* Mono input so it will appear on centre */ int const sample = d[i + 7] | (d[i + 8] << 8); BOOST_CHECK_EQUAL (sample, n); } - if (sound_asset->channels() > 3) { + if (sound_asset->mxf()->channels() > 3) { /* Lfe should be silent */ int const sample = d[i + 9] | (d[i + 10] << 8); BOOST_CHECK_EQUAL (sample, 0); } - if (sound_asset->channels() > 4) { + if (sound_asset->mxf()->channels() > 4) { /* Ls should be silent */ int const sample = d[i + 11] | (d[i + 12] << 8); BOOST_CHECK_EQUAL (sample, 0); } - if (sound_asset->channels() > 5) { + if (sound_asset->mxf()->channels() > 5) { /* Rs should be silent */ int const sample = d[i + 13] | (d[i + 14] << 8); BOOST_CHECK_EQUAL (sample, 0); diff --git a/test/image_test.cc b/test/image_test.cc index 51ad49ebf..622a9e4db 100644 --- a/test/image_test.cc +++ b/test/image_test.cc @@ -28,7 +28,7 @@ using boost::shared_ptr; BOOST_AUTO_TEST_CASE (aligned_image_test) { - Image* s = new Image (PIX_FMT_RGB24, libdcp::Size (50, 50), true); + Image* s = new Image (PIX_FMT_RGB24, dcp::Size (50, 50), true); BOOST_CHECK_EQUAL (s->components(), 1); /* 160 is 150 aligned to the nearest 32 bytes */ BOOST_CHECK_EQUAL (s->stride()[0], 160); @@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE (aligned_image_test) BOOST_CHECK (t->stride()[0] == s->stride()[0]); /* assignment operator */ - Image* u = new Image (PIX_FMT_YUV422P, libdcp::Size (150, 150), false); + Image* u = new Image (PIX_FMT_YUV422P, dcp::Size (150, 150), false); *u = *s; BOOST_CHECK_EQUAL (u->components(), 1); BOOST_CHECK_EQUAL (u->stride()[0], 160); @@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE (aligned_image_test) BOOST_AUTO_TEST_CASE (compact_image_test) { - Image* s = new Image (PIX_FMT_RGB24, libdcp::Size (50, 50), false); + Image* s = new Image (PIX_FMT_RGB24, dcp::Size (50, 50), false); BOOST_CHECK_EQUAL (s->components(), 1); BOOST_CHECK_EQUAL (s->stride()[0], 50 * 3); BOOST_CHECK_EQUAL (s->line_size()[0], 50 * 3); @@ -104,7 +104,7 @@ BOOST_AUTO_TEST_CASE (compact_image_test) BOOST_CHECK (t->stride()[0] == s->stride()[0]); /* assignment operator */ - Image* u = new Image (PIX_FMT_YUV422P, libdcp::Size (150, 150), true); + Image* u = new Image (PIX_FMT_YUV422P, dcp::Size (150, 150), true); *u = *s; BOOST_CHECK_EQUAL (u->components(), 1); BOOST_CHECK_EQUAL (u->stride()[0], 50 * 3); @@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE (compact_image_test) BOOST_AUTO_TEST_CASE (crop_image_test) { /* This was to check out a bug with valgrind, and is probably not very useful */ - shared_ptr<Image> image (new Image (PIX_FMT_YUV420P, libdcp::Size (16, 16), true)); + shared_ptr<Image> image (new Image (PIX_FMT_YUV420P, dcp::Size (16, 16), true)); image->make_black (); Crop crop; crop.top = 3; @@ -141,7 +141,7 @@ BOOST_AUTO_TEST_CASE (crop_image_test) BOOST_AUTO_TEST_CASE (crop_image_test2) { /* Here's a 1998 x 1080 image which is black */ - shared_ptr<Image> image (new Image (PIX_FMT_YUV420P, libdcp::Size (1998, 1080), true)); + shared_ptr<Image> image (new Image (PIX_FMT_YUV420P, dcp::Size (1998, 1080), true)); image->make_black (); /* Crop it by 1 pixel */ @@ -170,7 +170,7 @@ boost::shared_ptr<Image> read_file (string file) { Magick::Image magick_image (file.c_str ()); - libdcp::Size size (magick_image.columns(), magick_image.rows()); + dcp::Size size (magick_image.columns(), magick_image.rows()); boost::shared_ptr<Image> image (new Image (PIX_FMT_RGB24, size, true)); @@ -214,7 +214,7 @@ write_file (shared_ptr<Image> image, string file) static void -crop_scale_window_single (AVPixelFormat in_format, libdcp::Size in_size, Crop crop, libdcp::Size inter_size, libdcp::Size out_size) +crop_scale_window_single (AVPixelFormat in_format, dcp::Size in_size, Crop crop, dcp::Size inter_size, dcp::Size out_size) { /* Set up our test image */ shared_ptr<Image> test (new Image (in_format, in_size, true)); @@ -262,12 +262,12 @@ crop_scale_window_single (AVPixelFormat in_format, libdcp::Size in_size, Crop cr /** Test Image::crop_scale_window against separate calls to crop/scale/copy */ BOOST_AUTO_TEST_CASE (crop_scale_window_test) { - crop_scale_window_single (AV_PIX_FMT_YUV422P, libdcp::Size (640, 480), Crop (), libdcp::Size (640, 480), libdcp::Size (640, 480)); - crop_scale_window_single (AV_PIX_FMT_YUV422P, libdcp::Size (640, 480), Crop (2, 4, 6, 8), libdcp::Size (640, 480), libdcp::Size (640, 480)); - crop_scale_window_single (AV_PIX_FMT_YUV422P, libdcp::Size (640, 480), Crop (2, 4, 6, 8), libdcp::Size (1920, 1080), libdcp::Size (1998, 1080)); - crop_scale_window_single (AV_PIX_FMT_YUV422P, libdcp::Size (640, 480), Crop (1, 4, 6, 8), libdcp::Size (1920, 1080), libdcp::Size (1998, 1080)); - crop_scale_window_single (AV_PIX_FMT_YUV420P, libdcp::Size (640, 480), Crop (16, 16, 0, 0), libdcp::Size (1920, 1080), libdcp::Size (1998, 1080)); - crop_scale_window_single (AV_PIX_FMT_YUV420P, libdcp::Size (640, 480), Crop (16, 3, 3, 0), libdcp::Size (1920, 1080), libdcp::Size (1998, 1080)); - crop_scale_window_single (AV_PIX_FMT_RGB24, libdcp::Size (1000, 800), Crop (0, 0, 0, 0), libdcp::Size (1920, 1080), libdcp::Size (1998, 1080)); - crop_scale_window_single (AV_PIX_FMT_RGB24, libdcp::Size (1000, 800), Crop (55, 0, 1, 9), libdcp::Size (1920, 1080), libdcp::Size (1998, 1080)); + crop_scale_window_single (AV_PIX_FMT_YUV422P, dcp::Size (640, 480), Crop (), dcp::Size (640, 480), dcp::Size (640, 480)); + crop_scale_window_single (AV_PIX_FMT_YUV422P, dcp::Size (640, 480), Crop (2, 4, 6, 8), dcp::Size (640, 480), dcp::Size (640, 480)); + crop_scale_window_single (AV_PIX_FMT_YUV422P, dcp::Size (640, 480), Crop (2, 4, 6, 8), dcp::Size (1920, 1080), dcp::Size (1998, 1080)); + crop_scale_window_single (AV_PIX_FMT_YUV422P, dcp::Size (640, 480), Crop (1, 4, 6, 8), dcp::Size (1920, 1080), dcp::Size (1998, 1080)); + crop_scale_window_single (AV_PIX_FMT_YUV420P, dcp::Size (640, 480), Crop (16, 16, 0, 0), dcp::Size (1920, 1080), dcp::Size (1998, 1080)); + crop_scale_window_single (AV_PIX_FMT_YUV420P, dcp::Size (640, 480), Crop (16, 3, 3, 0), dcp::Size (1920, 1080), dcp::Size (1998, 1080)); + crop_scale_window_single (AV_PIX_FMT_RGB24, dcp::Size (1000, 800), Crop (0, 0, 0, 0), dcp::Size (1920, 1080), dcp::Size (1998, 1080)); + crop_scale_window_single (AV_PIX_FMT_RGB24, dcp::Size (1000, 800), Crop (55, 0, 1, 9), dcp::Size (1920, 1080), dcp::Size (1998, 1080)); } diff --git a/test/make_black_test.cc b/test/make_black_test.cc index 7c0f92142..8507f5891 100644 --- a/test/make_black_test.cc +++ b/test/make_black_test.cc @@ -32,8 +32,8 @@ using std::list; */ BOOST_AUTO_TEST_CASE (make_black_test) { - libdcp::Size in_size (512, 512); - libdcp::Size out_size (1024, 1024); + dcp::Size in_size (512, 512); + dcp::Size out_size (1024, 1024); list<AVPixelFormat> pix_fmts; pix_fmts.push_back (AV_PIX_FMT_RGB24); diff --git a/test/ratio_test.cc b/test/ratio_test.cc index f3cbb504f..946eac164 100644 --- a/test/ratio_test.cc +++ b/test/ratio_test.cc @@ -28,7 +28,7 @@ using std::ostream; namespace libdcp { ostream& -operator<< (ostream& s, libdcp::Size const & t) +operator<< (ostream& s, dcp::Size const & t) { s << t.width << "x" << t.height; return s; @@ -42,38 +42,38 @@ BOOST_AUTO_TEST_CASE (ratio_test) Ratio const * r = Ratio::from_id ("119"); BOOST_CHECK (r); - BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), libdcp::Size (2048, 1080)), libdcp::Size (1290, 1080)); + BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), dcp::Size (2048, 1080)), dcp::Size (1290, 1080)); r = Ratio::from_id ("133"); BOOST_CHECK (r); - BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), libdcp::Size (2048, 1080)), libdcp::Size (1440, 1080)); + BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), dcp::Size (2048, 1080)), dcp::Size (1440, 1080)); r = Ratio::from_id ("137"); BOOST_CHECK (r); - BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), libdcp::Size (2048, 1080)), libdcp::Size (1480, 1080)); + BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), dcp::Size (2048, 1080)), dcp::Size (1480, 1080)); r = Ratio::from_id ("138"); BOOST_CHECK (r); - BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), libdcp::Size (2048, 1080)), libdcp::Size (1485, 1080)); + BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), dcp::Size (2048, 1080)), dcp::Size (1485, 1080)); r = Ratio::from_id ("166"); BOOST_CHECK (r); - BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), libdcp::Size (2048, 1080)), libdcp::Size (1800, 1080)); + BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), dcp::Size (2048, 1080)), dcp::Size (1800, 1080)); r = Ratio::from_id ("178"); BOOST_CHECK (r); - BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), libdcp::Size (2048, 1080)), libdcp::Size (1920, 1080)); + BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), dcp::Size (2048, 1080)), dcp::Size (1920, 1080)); r = Ratio::from_id ("185"); BOOST_CHECK (r); - BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), libdcp::Size (2048, 1080)), libdcp::Size (1998, 1080)); + BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), dcp::Size (2048, 1080)), dcp::Size (1998, 1080)); r = Ratio::from_id ("239"); BOOST_CHECK (r); - BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), libdcp::Size (2048, 1080)), libdcp::Size (2048, 858)); + BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), dcp::Size (2048, 1080)), dcp::Size (2048, 858)); r = Ratio::from_id ("full-frame"); BOOST_CHECK (r); - BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), libdcp::Size (2048, 1080)), libdcp::Size (2048, 1080)); + BOOST_CHECK_EQUAL (fit_ratio_within (r->ratio(), dcp::Size (2048, 1080)), dcp::Size (2048, 1080)); } diff --git a/test/recover_test.cc b/test/recover_test.cc index d8caf17fa..b36130395 100644 --- a/test/recover_test.cc +++ b/test/recover_test.cc @@ -18,7 +18,7 @@ */ #include <boost/test/unit_test.hpp> -#include <libdcp/stereo_picture_asset.h> +#include <libdcp/stereo_picture_mxf.h> #include "lib/film.h" #include "lib/dcp_content_type.h" #include "lib/image_content.h" @@ -30,7 +30,7 @@ using std::string; using boost::shared_ptr; static void -note (libdcp::NoteType, string n) +note (dcp::NoteType, string n) { cout << n << "\n"; } @@ -62,10 +62,10 @@ BOOST_AUTO_TEST_CASE (recover_test) film->make_dcp (); wait_for_jobs (); - shared_ptr<libdcp::StereoPictureAsset> A (new libdcp::StereoPictureAsset ("build/test/recover_test", "original.mxf")); - shared_ptr<libdcp::StereoPictureAsset> B (new libdcp::StereoPictureAsset ("build/test/recover_test/video", "185_2K_58a090f8d70a2b410c534120d35e5256_24_bicubic_200000000_P_S_3D.mxf")); + shared_ptr<dcp::StereoPictureMXF> A (new dcp::StereoPictureMXF ("build/test/recover_test/original.mxf")); + shared_ptr<dcp::StereoPictureMXF> B (new dcp::StereoPictureMXF ("build/test/recover_test/video/185_2K_58a090f8d70a2b410c534120d35e5256_24_bicubic_200000000_P_S_3D.mxf")); - libdcp::EqualityOptions eq; + dcp::EqualityOptions eq; eq.mxf_names_can_differ = true; BOOST_CHECK (A->equals (B, eq, boost::bind (¬e, _1, _2))); } diff --git a/test/silence_padding_test.cc b/test/silence_padding_test.cc index 82cbad080..0e0695c03 100644 --- a/test/silence_padding_test.cc +++ b/test/silence_padding_test.cc @@ -20,9 +20,10 @@ #include <boost/test/unit_test.hpp> #include <libdcp/cpl.h> #include <libdcp/dcp.h> -#include <libdcp/sound_asset.h> +#include <libdcp/sound_mxf.h> #include <libdcp/sound_frame.h> #include <libdcp/reel.h> +#include <libdcp/reel_sound_asset.h> #include "lib/sndfile_content.h" #include "lib/film.h" #include "lib/dcp_content_type.h" @@ -52,56 +53,56 @@ static void test_silence_padding (int channels) boost::filesystem::path path = "build/test"; path /= film_name; path /= film->dcp_name (); - libdcp::DCP check (path.string ()); + dcp::DCP check (path.string ()); check.read (); - shared_ptr<const libdcp::SoundAsset> sound_asset = check.cpls().front()->reels().front()->main_sound (); + shared_ptr<const dcp::ReelSoundAsset> sound_asset = check.cpls().front()->reels().front()->main_sound (); BOOST_CHECK (sound_asset); - BOOST_CHECK (sound_asset->channels () == channels); + BOOST_CHECK (sound_asset->mxf()->channels () == channels); /* Sample index in the DCP */ int n = 0; /* DCP sound asset frame */ int frame = 0; - while (n < sound_asset->intrinsic_duration()) { - shared_ptr<const libdcp::SoundFrame> sound_frame = sound_asset->get_frame (frame++); + while (n < sound_asset->mxf()->intrinsic_duration()) { + shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->mxf()->get_frame (frame++); uint8_t const * d = sound_frame->data (); - for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->channels())) { + for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->mxf()->channels())) { - if (sound_asset->channels() > 0) { + if (sound_asset->mxf()->channels() > 0) { /* L should be silent */ int const sample = d[i + 0] | (d[i + 1] << 8); BOOST_CHECK_EQUAL (sample, 0); } - if (sound_asset->channels() > 1) { + if (sound_asset->mxf()->channels() > 1) { /* R should be silent */ int const sample = d[i + 2] | (d[i + 3] << 8); BOOST_CHECK_EQUAL (sample, 0); } - if (sound_asset->channels() > 2) { + if (sound_asset->mxf()->channels() > 2) { /* Mono input so it will appear on centre */ int const sample = d[i + 7] | (d[i + 8] << 8); BOOST_CHECK_EQUAL (sample, n); } - if (sound_asset->channels() > 3) { + if (sound_asset->mxf()->channels() > 3) { /* Lfe should be silent */ int const sample = d[i + 9] | (d[i + 10] << 8); BOOST_CHECK_EQUAL (sample, 0); } - if (sound_asset->channels() > 4) { + if (sound_asset->mxf()->channels() > 4) { /* Ls should be silent */ int const sample = d[i + 11] | (d[i + 12] << 8); BOOST_CHECK_EQUAL (sample, 0); } - if (sound_asset->channels() > 5) { + if (sound_asset->mxf()->channels() > 5) { /* Rs should be silent */ int const sample = d[i + 13] | (d[i + 14] << 8); BOOST_CHECK_EQUAL (sample, 0); diff --git a/test/stream_test.cc b/test/stream_test.cc index 6abcf6e22..c8073c1c8 100644 --- a/test/stream_test.cc +++ b/test/stream_test.cc @@ -73,11 +73,11 @@ BOOST_AUTO_TEST_CASE (stream_test) BOOST_CHECK_EQUAL (a.name, "hello there world"); BOOST_CHECK_EQUAL (a.mapping.content_channels(), 2); - BOOST_CHECK_EQUAL (a.mapping.get (0, libdcp::LEFT), 1); - BOOST_CHECK_EQUAL (a.mapping.get (0, libdcp::RIGHT), 0); - BOOST_CHECK_EQUAL (a.mapping.get (0, libdcp::CENTRE), 1); - BOOST_CHECK_EQUAL (a.mapping.get (1, libdcp::LEFT), 0); - BOOST_CHECK_EQUAL (a.mapping.get (1, libdcp::RIGHT), 1); - BOOST_CHECK_EQUAL (a.mapping.get (1, libdcp::CENTRE), 1); + BOOST_CHECK_EQUAL (a.mapping.get (0, dcp::LEFT), 1); + BOOST_CHECK_EQUAL (a.mapping.get (0, dcp::RIGHT), 0); + BOOST_CHECK_EQUAL (a.mapping.get (0, dcp::CENTRE), 1); + BOOST_CHECK_EQUAL (a.mapping.get (1, dcp::LEFT), 0); + BOOST_CHECK_EQUAL (a.mapping.get (1, dcp::RIGHT), 1); + BOOST_CHECK_EQUAL (a.mapping.get (1, dcp::CENTRE), 1); } diff --git a/test/subrip_test.cc b/test/subrip_test.cc index 12a77c1e1..09416b0cb 100644 --- a/test/subrip_test.cc +++ b/test/subrip_test.cc @@ -18,7 +18,7 @@ */ #include <boost/test/unit_test.hpp> -#include <libdcp/subtitle_asset.h> +#include <libdcp/subtitle_content.h> #include "lib/subrip.h" #include "lib/subrip_content.h" #include "lib/subrip_decoder.h" @@ -190,7 +190,7 @@ BOOST_AUTO_TEST_CASE (subrip_render_test) shared_ptr<Image> image; Position<int> position; - render_subtitles (dts->subs, libdcp::Size (1998, 1080), image, position); + render_subtitles (dts->subs, dcp::Size (1998, 1080), image, position); write_image (image, "build/test/subrip_render_test.png"); check_file ("build/test/subrip_render_test.png", "test/data/subrip_render_test.png"); } diff --git a/test/test.cc b/test/test.cc index e43db71ef..1498cd8fe 100644 --- a/test/test.cc +++ b/test/test.cc @@ -130,9 +130,9 @@ check_file (boost::filesystem::path ref, boost::filesystem::path check) } static void -note (libdcp::NoteType t, string n) +note (dcp::NoteType t, string n) { - if (t == libdcp::ERROR) { + if (t == dcp::ERROR) { cerr << n << "\n"; } } @@ -140,16 +140,16 @@ note (libdcp::NoteType t, string n) void check_dcp (boost::filesystem::path ref, boost::filesystem::path check) { - libdcp::DCP ref_dcp (ref); + dcp::DCP ref_dcp (ref); ref_dcp.read (); - libdcp::DCP check_dcp (check); + dcp::DCP check_dcp (check); check_dcp.read (); - libdcp::EqualityOptions options; + dcp::EqualityOptions options; options.max_mean_pixel_error = 5; options.max_std_dev_pixel_error = 5; options.max_audio_sample_error = 255; - options.cpl_names_can_differ = true; + options.cpl_annotation_texts_can_differ = true; options.mxf_names_can_differ = true; BOOST_CHECK (ref_dcp.equals (check_dcp, options, boost::bind (note, _1, _2))); |
