if [ ! -f build/test/dcpomatic2_openssl ]; then
ln -s ../../../openssl/apps/openssl build/test/dcpomatic2_openssl
fi
+ export DCPOMATIC_TEST_TOOLS_PATH=/opt/asdcplib/bin
+ if [ -f /src/backports/dcp_inspect ]; then
+ export DCPOMATIC_DCP_INSPECT=/src/backports/dcp_inspect
+ fi
fi
if [ "$(uname)" == "Darwin" ]; then
auto vf = new_test_film2("atmos_merge_test_vf", { ov_content, atmos_1.front() });
ov_content->set_reference_video(true);
atmos_1.front()->set_position(vf, dcpomatic::DCPTime());
- make_and_verify_dcp(vf, { dcp::VerificationNote::Code::MISSING_CPL_METADATA, dcp::VerificationNote::Code::EXTERNAL_ASSET });
+ make_and_verify_dcp(vf, { dcp::VerificationNote::Code::MISSING_CPL_METADATA, dcp::VerificationNote::Code::EXTERNAL_ASSET }, false);
// atmos_1.mxf should contain all ones for its data, and it should have replaced atmos_0 in this DCP
check(vf, 1);
}
);
ov_content->set_reference_video (true);
- make_and_verify_dcp (vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
+ make_and_verify_dcp(vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET}, false);
/* Check for Hash tags in the VF DCP */
int hashes = 0;
auto ov_content = make_shared<DCPContent>(ov->dir(ov->dcp_name(false)));
auto vf = new_test_film2 ("check_reuse_old_data_vf", {ov_content, content_factory("test/data/L.wav")[0]});
ov_content->set_reference_video (true);
- make_and_verify_dcp (vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
+ make_and_verify_dcp(vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET}, false);
auto encrypted = new_test_film2 ("check_reuse_old_data_decrypted");
encrypted->examine_and_add_content (content_factory("test/data/flat_red.png")[0]);
ov_dcp->set_reference_audio (true);
auto vf = new_test_film2 ("dcp_digest_file_test2_vf", { ov_dcp });
vf->set_encrypted (true);
- make_and_verify_dcp (vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
+ make_and_verify_dcp(vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET}, false);
auto vf_key_check = get_key_from_digest ("build/test/dcp_digest_file_test2_vf/" + vf->dcp_name() + ".dcpdig");
BOOST_REQUIRE (static_cast<bool>(vf_key_check));
dcp::VerificationNote::Code::NEARLY_INVALID_PICTURE_FRAME_SIZE_IN_BYTES,
dcp::VerificationNote::Code::INVALID_PICTURE_FRAME_SIZE_IN_BYTES,
dcp::VerificationNote::Code::INVALID_JPEG2000_TILE_PART_SIZE,
- });
+ },
+ target_bits_per_second <= 250000000
+ );
boost::filesystem::directory_iterator i (boost::filesystem::path("build") / "test" / name / "video");
boost::filesystem::path test = *i++;
make_and_verify_dcp(ov_film);
auto const ov_dir = ov_film->dir(ov_film->dcp_name());
-
auto vf_ov = make_shared<DCPContent>(ov_dir);
auto vf_sound = content_factory("test/data/sine_440.wav").front();
auto vf_film = new_test_film2(name + "_vf", { vf_ov, vf_sound });
vf_ov->set_reference_video(true);
- make_and_verify_dcp(vf_film, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
+ make_and_verify_dcp(vf_film, {dcp::VerificationNote::Code::EXTERNAL_ASSET}, false);
auto const vf_dir = vf_film->dir(vf_film->dcp_name());
vf_ov2->set_position(vf_film, vf_ov1->end(vf_film));
vf_ov1->set_reference_video(true);
vf_ov2->set_reference_video(true);
- make_and_verify_dcp(vf_film, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
+ make_and_verify_dcp(vf_film, {dcp::VerificationNote::Code::EXTERNAL_ASSET}, false);
auto const vf_dir = vf_film->dir(vf_film->dcp_name());
A->set_reference_audio (true);
B->set_reference_video (true);
- make_and_verify_dcp (vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
+ make_and_verify_dcp(vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET}, false);
dcp::DCP ov_a_check (ov_a->dir(ov_a->dcp_name()));
ov_a_check.read ();
c->set_reference_video (true);
c->set_reference_audio (true);
- make_and_verify_dcp (film2, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
+ make_and_verify_dcp(film2, {dcp::VerificationNote::Code::EXTERNAL_ASSET}, false);
}
film->set_reel_type (ReelType::BY_LENGTH);
/* This is just over 2.5s at 100Mbit/s; should correspond to 60 frames */
film->set_reel_length (31253154);
+ /* dcp_inspect gives error about reel <1s in length */
make_and_verify_dcp (
film,
{
dcp::VerificationNote::Code::INVALID_INTRINSIC_DURATION,
dcp::VerificationNote::Code::INVALID_DURATION,
- });
+ },
+ false);
}
dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE,
dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME,
dcp::VerificationNote::Code::INVALID_SUBTITLE_DURATION,
- });
+ },
+ false);
}
original_dcp[i]->set_reference_audio(true);
}
- make_and_verify_dcp(film2, { dcp::VerificationNote::Code::EXTERNAL_ASSET });
+ make_and_verify_dcp(film2, { dcp::VerificationNote::Code::EXTERNAL_ASSET }, false);
dcp::DCP check1(film1->dir(film1->dcp_name()));
check1.read();
if (standard == dcp::Standard::INTEROP) {
codes.push_back(dcp::VerificationNote::Code::INVALID_STANDARD);
}
- make_and_verify_dcp(film, codes);
+ make_and_verify_dcp(film, codes, channels == 2 || channels == 6 || channels >= 8);
boost::filesystem::path path = "build/test";
path /= film_name;
#include <dcp/openjpeg_image.h>
#include <dcp/reel.h>
#include <dcp/reel_picture_asset.h>
+#include <dcp/scope_guard.h>
#include <dcp/warnings.h>
#include <asdcp/AS_DCP.h>
#include <png.h>
using std::shared_ptr;
using std::string;
using std::vector;
+using boost::optional;
using boost::scoped_array;
using std::dynamic_pointer_cast;
#if BOOST_VERSION >= 106100
void
-make_and_verify_dcp (shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore)
+#ifdef DCPOMATIC_LINUX
+make_and_verify_dcp(shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore, bool dcp_inspect)
+#else
+make_and_verify_dcp(shared_ptr<Film> film, vector<dcp::VerificationNote::Code> ignore, bool)
+#endif
{
film->write_metadata ();
make_dcp (film, TranscodeJob::ChangedBehaviour::IGNORE);
BOOST_REQUIRE (!wait_for_jobs());
verify_dcp({film->dir(film->dcp_name())}, ignore);
+
+#ifdef DCPOMATIC_LINUX
+ auto test_tools_path_env = getenv("DCPOMATIC_TEST_TOOLS_PATH");
+ string test_tools_path;
+ if (test_tools_path_env) {
+ test_tools_path = test_tools_path_env;
+ }
+
+ auto old_path_env = getenv("PATH");
+ string old_path;
+ if (old_path_env) {
+ old_path = old_path_env;
+ }
+
+ dcp::ScopeGuard sg = [old_path]() { setenv("PATH", old_path.c_str(), 1); };
+ string new_path = old_path;
+ if (!new_path.empty()) {
+ new_path += ":";
+ }
+ new_path += test_tools_path;
+ setenv("PATH", new_path.c_str(), 1);
+
+ auto dcp_inspect_env = getenv("DCPOMATIC_DCP_INSPECT");
+ if (dcp_inspect && dcp_inspect_env) {
+ boost::filesystem::path dcp_inspect(dcp_inspect_env);
+ auto cmd = String::compose("%1 %2 > %3 2>&1", dcp_inspect, film->dir(film->dcp_name()), film->file("dcp_inspect.log"));
+ auto result = system(cmd.c_str());
+ BOOST_CHECK_EQUAL(WEXITSTATUS(result), 0);
+ }
+#endif
}
extern boost::filesystem::path subtitle_file (std::shared_ptr<Film> film);
extern void make_random_file (boost::filesystem::path path, size_t size);
extern void verify_dcp(boost::filesystem::path dir, std::vector<dcp::VerificationNote::Code> ignore);
-extern void make_and_verify_dcp (std::shared_ptr<Film> film, std::vector<dcp::VerificationNote::Code> ignore = {});
+extern void make_and_verify_dcp(std::shared_ptr<Film> film, std::vector<dcp::VerificationNote::Code> ignore = {}, bool dcp_inspect = true);
extern void check_int_close (int a, int b, int d);
extern void check_int_close (std::pair<int, int>, std::pair<int, int>, int d);
extern boost::filesystem::path find_file (boost::filesystem::path dir, std::string filename_part);
dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE,
dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME,
dcp::VerificationNote::Code::INVALID_SUBTITLE_DURATION
- });
+ },
+ false
+ );
dcp::DCP ov_c (ov->dir(ov->dcp_name()));
ov_c.read ();
BOOST_REQUIRE (!wait_for_jobs());
dcp->set_reference_video (true);
dcp->set_reference_audio (true);
- make_and_verify_dcp (vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
+ make_and_verify_dcp(vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET}, false);
dcp::DCP vf_c (vf->dir(vf->dcp_name()));
vf_c.read ();
BOOST_REQUIRE (!wait_for_jobs());
more_video->set_position (vf, DCPTime());
vf->write_metadata ();
- make_and_verify_dcp (vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
+ make_and_verify_dcp(vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET}, false);
dcp::DCP ov_c (ov->dir(ov->dcp_name()));
ov_c.read ();
dcp->set_reference_video (true);
dcp->set_reference_audio (true);
dcp->set_trim_end (ContentTime::from_seconds(15));
- make_and_verify_dcp (vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
+ make_and_verify_dcp(vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET}, false);
/* Check that the selected reel assets are right */
auto a = get_referenced_reel_assets(vf, vf->playlist());
dcp::VerificationNote::Code::EXTERNAL_ASSET,
dcp::VerificationNote::Code::MISSING_SUBTITLE_LANGUAGE,
dcp::VerificationNote::Code::INVALID_SUBTITLE_FIRST_TEXT_TIME
- });
+ },
+ false
+ );
}
vf_dcp->set_reference_audio(true);
vf_dcp->set_trim_start(vf, ContentTime::from_seconds(10));
vf_dcp->set_position(vf, DCPTime::from_seconds(10));
- make_and_verify_dcp (vf, { dcp::VerificationNote::Code::EXTERNAL_ASSET });
+ make_and_verify_dcp(vf, { dcp::VerificationNote::Code::EXTERNAL_ASSET }, false);
}