summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-08 14:25:10 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-08 14:25:10 +0100
commitf07623551706b849190c84059bac455088f8eb1e (patch)
tree81360f73c4a52702921270c605087d0c5f03e42e /test
parent5665f1503d751391768bd7ed5894f2ecd63ea8fc (diff)
Adapt for changes to libdcp API.
Diffstat (limited to 'test')
-rw-r--r--test/audio_delay_test.cc8
-rw-r--r--test/ffmpeg_audio_test.cc22
-rw-r--r--test/recover_test.cc9
-rw-r--r--test/silence_padding_test.cc22
-rw-r--r--test/test.cc1
5 files changed, 30 insertions, 32 deletions
diff --git a/test/audio_delay_test.cc b/test/audio_delay_test.cc
index 63f363114..05384873f 100644
--- a/test/audio_delay_test.cc
+++ b/test/audio_delay_test.cc
@@ -27,7 +27,7 @@
#include <dcp/sound_frame.h>
#include <dcp/cpl.h>
#include <dcp/reel.h>
-#include <dcp/sound_mxf.h>
+#include <dcp/sound_asset.h>
#include <dcp/reel_sound_asset.h>
#include "lib/sndfile_content.h"
#include "lib/dcp_content_type.h"
@@ -75,11 +75,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->mxf()->intrinsic_duration()) {
- shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->mxf()->get_frame (frame++);
+ while (n < sound_asset->asset()->intrinsic_duration()) {
+ shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->asset()->get_frame (frame++);
uint8_t const * d = sound_frame->data ();
- for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->mxf()->channels())) {
+ for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->asset()->channels())) {
/* Mono input so it will appear on centre */
int const sample = d[i + 7] | (d[i + 8] << 8);
diff --git a/test/ffmpeg_audio_test.cc b/test/ffmpeg_audio_test.cc
index 1e2bbb377..2c34c437d 100644
--- a/test/ffmpeg_audio_test.cc
+++ b/test/ffmpeg_audio_test.cc
@@ -24,7 +24,7 @@
#include <boost/test/unit_test.hpp>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
-#include <dcp/sound_mxf.h>
+#include <dcp/sound_asset.h>
#include <dcp/sound_frame.h>
#include <dcp/reel_sound_asset.h>
#include <dcp/reel.h>
@@ -66,51 +66,51 @@ BOOST_AUTO_TEST_CASE (ffmpeg_audio_test)
shared_ptr<const dcp::ReelSoundAsset> sound_asset = check.cpls().front()->reels().front()->main_sound ();
BOOST_CHECK (sound_asset);
- BOOST_CHECK_EQUAL (sound_asset->mxf()->channels (), 6);
+ BOOST_CHECK_EQUAL (sound_asset->asset()->channels (), 6);
/* Sample index in the DCP */
int n = 0;
/* DCP sound asset frame */
int frame = 0;
- while (n < sound_asset->mxf()->intrinsic_duration()) {
- shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->mxf()->get_frame (frame++);
+ while (n < sound_asset->asset()->intrinsic_duration()) {
+ shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->asset()->get_frame (frame++);
uint8_t const * d = sound_frame->data ();
- for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->mxf()->channels())) {
+ for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->asset()->channels())) {
- if (sound_asset->mxf()->channels() > 0) {
+ if (sound_asset->asset()->channels() > 0) {
/* L should be silent */
int const sample = d[i + 0] | (d[i + 1] << 8);
BOOST_CHECK_EQUAL (sample, 0);
}
- if (sound_asset->mxf()->channels() > 1) {
+ if (sound_asset->asset()->channels() > 1) {
/* R should be silent */
int const sample = d[i + 2] | (d[i + 3] << 8);
BOOST_CHECK_EQUAL (sample, 0);
}
- if (sound_asset->mxf()->channels() > 2) {
+ if (sound_asset->asset()->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->mxf()->channels() > 3) {
+ if (sound_asset->asset()->channels() > 3) {
/* Lfe should be silent */
int const sample = d[i + 9] | (d[i + 10] << 8);
BOOST_CHECK_EQUAL (sample, 0);
}
- if (sound_asset->mxf()->channels() > 4) {
+ if (sound_asset->asset()->channels() > 4) {
/* Ls should be silent */
int const sample = d[i + 11] | (d[i + 12] << 8);
BOOST_CHECK_EQUAL (sample, 0);
}
- if (sound_asset->mxf()->channels() > 5) {
+ if (sound_asset->asset()->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/recover_test.cc b/test/recover_test.cc
index d76c2f716..317b45520 100644
--- a/test/recover_test.cc
+++ b/test/recover_test.cc
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
*/
#include <boost/test/unit_test.hpp>
-#include <dcp/stereo_picture_mxf.h>
+#include <dcp/stereo_picture_asset.h>
#include "lib/film.h"
#include "lib/dcp_content_type.h"
#include "lib/image_content.h"
@@ -69,10 +69,9 @@ BOOST_AUTO_TEST_CASE (recover_test)
film->make_dcp ();
wait_for_jobs ();
- shared_ptr<dcp::StereoPictureMXF> A (new dcp::StereoPictureMXF ("build/test/recover_test/original.mxf"));
- shared_ptr<dcp::StereoPictureMXF> B (new dcp::StereoPictureMXF (video));
+ shared_ptr<dcp::StereoPictureAsset> A (new dcp::StereoPictureAsset ("build/test/recover_test/original.mxf"));
+ shared_ptr<dcp::StereoPictureAsset> B (new dcp::StereoPictureAsset (video));
dcp::EqualityOptions eq;
- eq.mxf_filenames_can_differ = true;
BOOST_CHECK (A->equals (B, eq, boost::bind (&note, _1, _2)));
}
diff --git a/test/silence_padding_test.cc b/test/silence_padding_test.cc
index d876a0228..9a797aab5 100644
--- a/test/silence_padding_test.cc
+++ b/test/silence_padding_test.cc
@@ -24,7 +24,7 @@
#include <boost/test/unit_test.hpp>
#include <dcp/cpl.h>
#include <dcp/dcp.h>
-#include <dcp/sound_mxf.h>
+#include <dcp/sound_asset.h>
#include <dcp/sound_frame.h>
#include <dcp/reel.h>
#include <dcp/reel_sound_asset.h>
@@ -63,51 +63,51 @@ test_silence_padding (int channels)
shared_ptr<const dcp::ReelSoundAsset> sound_asset = check.cpls().front()->reels().front()->main_sound ();
BOOST_CHECK (sound_asset);
- BOOST_CHECK_EQUAL (sound_asset->mxf()->channels (), channels);
+ BOOST_CHECK_EQUAL (sound_asset->asset()->channels (), channels);
/* Sample index in the DCP */
int n = 0;
/* DCP sound asset frame */
int frame = 0;
- while (n < sound_asset->mxf()->intrinsic_duration()) {
- shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->mxf()->get_frame (frame++);
+ while (n < sound_asset->asset()->intrinsic_duration()) {
+ shared_ptr<const dcp::SoundFrame> sound_frame = sound_asset->asset()->get_frame (frame++);
uint8_t const * d = sound_frame->data ();
- for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->mxf()->channels())) {
+ for (int i = 0; i < sound_frame->size(); i += (3 * sound_asset->asset()->channels())) {
- if (sound_asset->mxf()->channels() > 0) {
+ if (sound_asset->asset()->channels() > 0) {
/* L should be silent */
int const sample = d[i + 0] | (d[i + 1] << 8);
BOOST_CHECK_EQUAL (sample, 0);
}
- if (sound_asset->mxf()->channels() > 1) {
+ if (sound_asset->asset()->channels() > 1) {
/* R should be silent */
int const sample = d[i + 2] | (d[i + 3] << 8);
BOOST_CHECK_EQUAL (sample, 0);
}
- if (sound_asset->mxf()->channels() > 2) {
+ if (sound_asset->asset()->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->mxf()->channels() > 3) {
+ if (sound_asset->asset()->channels() > 3) {
/* Lfe should be silent */
int const sample = d[i + 9] | (d[i + 10] << 8);
BOOST_CHECK_EQUAL (sample, 0);
}
- if (sound_asset->mxf()->channels() > 4) {
+ if (sound_asset->asset()->channels() > 4) {
/* Ls should be silent */
int const sample = d[i + 11] | (d[i + 12] << 8);
BOOST_CHECK_EQUAL (sample, 0);
}
- if (sound_asset->mxf()->channels() > 5) {
+ if (sound_asset->asset()->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/test.cc b/test/test.cc
index b7ae1dec9..5dd591ddc 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -210,7 +210,6 @@ check_dcp (boost::filesystem::path ref, boost::filesystem::path check)
options.max_std_dev_pixel_error = 5;
options.max_audio_sample_error = 255;
options.cpl_annotation_texts_can_differ = true;
- options.mxf_filenames_can_differ = true;
options.reel_annotation_texts_can_differ = true;
options.reel_hashes_can_differ = true;