summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/client_server_test.cc36
-rw-r--r--test/config_test.cc114
-rw-r--r--test/content_test.cc2
m---------test/data0
-rw-r--r--test/disk_writer_test.cc107
-rw-r--r--test/ffmpeg_decoder_seek_test.cc55
-rw-r--r--test/ffmpeg_encoder_test.cc4
-rw-r--r--test/ffmpeg_examiner_test.cc2
-rw-r--r--test/j2k_encode_threading_test.cc117
-rw-r--r--test/kdm_cli_test.cc41
-rw-r--r--test/kdm_naming_test.cc26
-rw-r--r--test/low_bitrate_test.cc3
-rw-r--r--test/map_cli_test.cc1
-rw-r--r--test/player_test.cc29
-rw-r--r--test/shuffler_test.cc8
-rw-r--r--test/test.cc12
-rw-r--r--test/wscript1
17 files changed, 367 insertions, 191 deletions
diff --git a/test/client_server_test.cc b/test/client_server_test.cc
index 596668aae..1bfa4c5a6 100644
--- a/test/client_server_test.cc
+++ b/test/client_server_test.cc
@@ -20,20 +20,18 @@
/** @file test/client_server_test.cc
- * @brief Test the server class.
+ * @brief Test the remote encoding code.
* @ingroup feature
- *
- * Create a test image and then encode it using the standard mechanism
- * and also using a EncodeServer object running on localhost. Compare the resulting
- * encoded data to check that they are the same.
*/
+#include "lib/content_factory.h"
#include "lib/cross.h"
#include "lib/dcp_video.h"
#include "lib/dcpomatic_log.h"
#include "lib/encode_server.h"
#include "lib/encode_server_description.h"
+#include "lib/encode_server_finder.h"
#include "lib/file_log.h"
#include "lib/image.h"
#include "lib/j2k_image_proxy.h"
@@ -51,6 +49,7 @@ using std::weak_ptr;
using boost::thread;
using boost::optional;
using dcp::ArrayData;
+using namespace dcpomatic;
void
@@ -105,7 +104,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_rgb)
ColourConversion(),
VideoRange::FULL,
weak_ptr<Content>(),
- optional<Frame>(),
+ optional<ContentTime>(),
false
);
@@ -184,7 +183,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_yuv)
ColourConversion(),
VideoRange::FULL,
weak_ptr<Content>(),
- optional<Frame>(),
+ optional<ContentTime>(),
false
);
@@ -250,7 +249,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
ColourConversion(),
VideoRange::FULL,
weak_ptr<Content>(),
- optional<Frame>(),
+ optional<ContentTime>(),
false
);
@@ -275,7 +274,7 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
PresetColourConversion::all().front().conversion,
VideoRange::FULL,
weak_ptr<Content>(),
- optional<Frame>(),
+ optional<ContentTime>(),
false
);
@@ -315,3 +314,22 @@ BOOST_AUTO_TEST_CASE (client_server_test_j2k)
}
+BOOST_AUTO_TEST_CASE(real_encode_with_server)
+{
+ auto content = content_factory(TestPaths::private_data() / "dolby_aurora.vob");
+ auto film = new_test_film2("real_encode_with_server", content);
+
+ EncodeServerFinder::instance();
+
+ EncodeServer server(true, 4);
+ thread server_thread(boost::bind(&EncodeServer::run, &server));
+
+ make_and_verify_dcp(film);
+
+ server.stop();
+ server_thread.join();
+
+ BOOST_CHECK(server.frames_encoded() > 0);
+ EncodeServerFinder::drop();
+}
+
diff --git a/test/config_test.cc b/test/config_test.cc
index 103a6a585..00adb7b09 100644
--- a/test/config_test.cc
+++ b/test/config_test.cc
@@ -38,7 +38,7 @@ rewrite_bad_config (string filename, string extra_line)
{
using namespace boost::filesystem;
- auto base = path("build/test/bad_config/2.16");
+ auto base = path("build/test/bad_config/2.18");
auto file = base / filename;
boost::system::error_code ec;
@@ -73,47 +73,49 @@ BOOST_AUTO_TEST_CASE (config_backup_test)
*/
Config::instance();
- BOOST_CHECK ( boost::filesystem::exists("build/test/bad_config/2.16/config.xml.1"));
- BOOST_CHECK (dcp::file_to_string("build/test/bad_config/2.16/config.xml.1") == first_write_xml);
- BOOST_CHECK (!boost::filesystem::exists("build/test/bad_config/2.16/config.xml.2"));
- BOOST_CHECK (!boost::filesystem::exists("build/test/bad_config/2.16/config.xml.3"));
- BOOST_CHECK (!boost::filesystem::exists("build/test/bad_config/2.16/config.xml.4"));
+ boost::filesystem::path const prefix = "build/test/bad_config/2.18";
+
+ BOOST_CHECK(boost::filesystem::exists(prefix / "config.xml.1"));
+ BOOST_CHECK(dcp::file_to_string(prefix / "config.xml.1") == first_write_xml);
+ BOOST_CHECK(!boost::filesystem::exists(prefix / "config.xml.2"));
+ BOOST_CHECK(!boost::filesystem::exists(prefix / "config.xml.3"));
+ BOOST_CHECK(!boost::filesystem::exists(prefix / "config.xml.4"));
Config::drop();
auto const second_write_xml = rewrite_bad_config("config.xml", "second write");
Config::instance();
- BOOST_CHECK ( boost::filesystem::exists("build/test/bad_config/2.16/config.xml.1"));
- BOOST_CHECK (dcp::file_to_string("build/test/bad_config/2.16/config.xml.1") == first_write_xml);
- BOOST_CHECK ( boost::filesystem::exists("build/test/bad_config/2.16/config.xml.2"));
- BOOST_CHECK (dcp::file_to_string("build/test/bad_config/2.16/config.xml.2") == second_write_xml);
- BOOST_CHECK (!boost::filesystem::exists("build/test/bad_config/2.16/config.xml.3"));
- BOOST_CHECK (!boost::filesystem::exists("build/test/bad_config/2.16/config.xml.4"));
+ BOOST_CHECK(boost::filesystem::exists(prefix / "config.xml.1"));
+ BOOST_CHECK(dcp::file_to_string(prefix / "config.xml.1") == first_write_xml);
+ BOOST_CHECK(boost::filesystem::exists(prefix / "config.xml.2"));
+ BOOST_CHECK(dcp::file_to_string(prefix / "config.xml.2") == second_write_xml);
+ BOOST_CHECK(!boost::filesystem::exists(prefix / "config.xml.3"));
+ BOOST_CHECK(!boost::filesystem::exists(prefix / "config.xml.4"));
Config::drop();
auto const third_write_xml = rewrite_bad_config("config.xml", "third write");
Config::instance();
- BOOST_CHECK ( boost::filesystem::exists("build/test/bad_config/2.16/config.xml.1"));
- BOOST_CHECK (dcp::file_to_string("build/test/bad_config/2.16/config.xml.1") == first_write_xml);
- BOOST_CHECK ( boost::filesystem::exists("build/test/bad_config/2.16/config.xml.2"));
- BOOST_CHECK (dcp::file_to_string("build/test/bad_config/2.16/config.xml.2") == second_write_xml);
- BOOST_CHECK ( boost::filesystem::exists("build/test/bad_config/2.16/config.xml.3"));
- BOOST_CHECK (dcp::file_to_string("build/test/bad_config/2.16/config.xml.3") == third_write_xml);
- BOOST_CHECK (!boost::filesystem::exists("build/test/bad_config/2.16/config.xml.4"));
+ BOOST_CHECK(boost::filesystem::exists(prefix / "config.xml.1"));
+ BOOST_CHECK(dcp::file_to_string(prefix / "config.xml.1") == first_write_xml);
+ BOOST_CHECK(boost::filesystem::exists(prefix / "config.xml.2"));
+ BOOST_CHECK(dcp::file_to_string(prefix / "config.xml.2") == second_write_xml);
+ BOOST_CHECK(boost::filesystem::exists(prefix / "config.xml.3"));
+ BOOST_CHECK(dcp::file_to_string(prefix / "config.xml.3") == third_write_xml);
+ BOOST_CHECK(!boost::filesystem::exists(prefix / "config.xml.4"));
Config::drop();
auto const fourth_write_xml = rewrite_bad_config("config.xml", "fourth write");
Config::instance();
- BOOST_CHECK (boost::filesystem::exists("build/test/bad_config/2.16/config.xml.1"));
- BOOST_CHECK (dcp::file_to_string("build/test/bad_config/2.16/config.xml.1") == first_write_xml);
- BOOST_CHECK (boost::filesystem::exists("build/test/bad_config/2.16/config.xml.2"));
- BOOST_CHECK (dcp::file_to_string("build/test/bad_config/2.16/config.xml.2") == second_write_xml);
- BOOST_CHECK (boost::filesystem::exists("build/test/bad_config/2.16/config.xml.3"));
- BOOST_CHECK (dcp::file_to_string("build/test/bad_config/2.16/config.xml.3") == third_write_xml);
- BOOST_CHECK (boost::filesystem::exists("build/test/bad_config/2.16/config.xml.4"));
- BOOST_CHECK (dcp::file_to_string("build/test/bad_config/2.16/config.xml.4") == fourth_write_xml);
+ BOOST_CHECK(boost::filesystem::exists(prefix / "config.xml.1"));
+ BOOST_CHECK(dcp::file_to_string(prefix / "config.xml.1") == first_write_xml);
+ BOOST_CHECK(boost::filesystem::exists(prefix / "config.xml.2"));
+ BOOST_CHECK(dcp::file_to_string(prefix / "config.xml.2") == second_write_xml);
+ BOOST_CHECK(boost::filesystem::exists(prefix / "config.xml.3"));
+ BOOST_CHECK(dcp::file_to_string(prefix / "config.xml.3") == third_write_xml);
+ BOOST_CHECK(boost::filesystem::exists(prefix / "config.xml.4"));
+ BOOST_CHECK(dcp::file_to_string(prefix / "config.xml.4") == fourth_write_xml);
}
@@ -124,7 +126,7 @@ BOOST_AUTO_TEST_CASE (config_backup_with_link_test)
ConfigRestorer cr;
auto base = path("build/test/bad_config");
- auto version = base / "2.16";
+ auto version = base / "2.18";
Config::override_path = base;
Config::drop();
@@ -163,7 +165,8 @@ BOOST_AUTO_TEST_CASE (config_write_utf8_test)
}
-BOOST_AUTO_TEST_CASE (config_upgrade_test)
+/* 2.14 -> 2.18 */
+BOOST_AUTO_TEST_CASE (config_upgrade_test1)
{
ConfigRestorer cr;
@@ -185,12 +188,49 @@ BOOST_AUTO_TEST_CASE (config_upgrade_test)
check_xml (dir / "cinemas.xml", "test/data/2.14.cinemas.xml", {});
#ifdef DCPOMATIC_WINDOWS
/* This file has the windows path for dkdm_recipients.xml (with backslashes) */
- check_xml (dir / "2.16" / "config.xml", "test/data/2.16.config.windows.xml", {});
+ check_xml(dir / "2.18" / "config.xml", "test/data/2.18.config.windows.xml", {});
+#else
+ check_xml(dir / "2.18" / "config.xml", "test/data/2.18.config.xml", {});
+#endif
+ /* cinemas.xml is not copied into 2.18 as its format has not changed */
+ BOOST_REQUIRE (!boost::filesystem::exists(dir / "2.18" / "cinemas.xml"));
+}
+
+
+/* 2.16 -> 2.18 */
+BOOST_AUTO_TEST_CASE (config_upgrade_test2)
+{
+ ConfigRestorer cr;
+
+ boost::filesystem::path dir = "build/test/config_upgrade_test";
+ Config::override_path = dir;
+ Config::drop ();
+ boost::filesystem::remove_all (dir);
+ boost::filesystem::create_directories (dir);
+
+#ifdef DCPOMATIC_WINDOWS
+ boost::filesystem::copy_file("test/data/2.16.config.windows.xml", dir / "config.xml");
+#else
+ boost::filesystem::copy_file("test/data/2.16.config.xml", dir / "config.xml");
+#endif
+ boost::filesystem::copy_file("test/data/2.14.cinemas.xml", dir / "cinemas.xml");
+ Config::instance();
+ try {
+ /* This will fail to write cinemas.xml since the link is to a non-existent directory */
+ Config::instance()->write();
+ } catch (...) {}
+
+ check_xml(dir / "cinemas.xml", "test/data/2.14.cinemas.xml", {});
+#ifdef DCPOMATIC_WINDOWS
+ /* This file has the windows path for dkdm_recipients.xml (with backslashes) */
+ check_xml(dir / "2.18" / "config.xml", "test/data/2.18.config.windows.xml", {});
+ check_xml(dir / "config.xml", "test/data/2.16.config.windows.xml", {});
#else
- check_xml (dir / "2.16" / "config.xml", "test/data/2.16.config.xml", {});
+ check_xml(dir / "2.18" / "config.xml", "test/data/2.18.config.xml", {});
+ check_xml(dir / "config.xml", "test/data/2.16.config.xml", {});
#endif
- /* cinemas.xml is not copied into 2.16 as its format has not changed */
- BOOST_REQUIRE (!boost::filesystem::exists(dir / "2.16" / "cinemas.xml"));
+ /* cinemas.xml is not copied into 2.18 as its format has not changed */
+ BOOST_REQUIRE (!boost::filesystem::exists(dir / "2.18" / "cinemas.xml"));
}
@@ -206,13 +246,13 @@ BOOST_AUTO_TEST_CASE (config_keep_cinemas_if_making_new_config)
Config::instance()->write();
- Config::instance()->add_cinema(make_shared<Cinema>("My Great Cinema", vector<string>(), "", 0, 0));
+ Config::instance()->add_cinema(make_shared<Cinema>("My Great Cinema", vector<string>(), ""));
Config::instance()->write();
boost::filesystem::copy_file (dir / "cinemas.xml", dir / "backup_for_test.xml");
Config::drop ();
- boost::filesystem::remove (dir / "2.16" / "config.xml");
+ boost::filesystem::remove (dir / "2.18" / "config.xml");
Config::instance();
check_text_file(dir / "backup_for_test.xml", dir / "cinemas.xml");
@@ -234,7 +274,7 @@ BOOST_AUTO_TEST_CASE(keep_config_if_cinemas_fail_to_load)
auto const cinemas = dir / "cinemas.xml";
/* Back things up */
- boost::filesystem::copy_file(dir / "2.16" / "config.xml", dir / "config_backup_for_test.xml");
+ boost::filesystem::copy_file(dir / "2.18" / "config.xml", dir / "config_backup_for_test.xml");
boost::filesystem::copy_file(cinemas, dir / "cinemas_backup_for_test.xml");
/* Corrupt the cinemas */
@@ -245,7 +285,7 @@ BOOST_AUTO_TEST_CASE(keep_config_if_cinemas_fail_to_load)
Config::instance();
/* We should have a new cinemas.xml and the old config.xml */
- check_text_file(dir / "2.16" / "config.xml", dir / "config_backup_for_test.xml");
+ check_text_file(dir / "2.18" / "config.xml", dir / "config_backup_for_test.xml");
check_text_file(cinemas, dir / "cinemas_backup_for_test.xml");
}
diff --git a/test/content_test.cc b/test/content_test.cc
index 5ab714b47..dce7643dc 100644
--- a/test/content_test.cc
+++ b/test/content_test.cc
@@ -154,7 +154,7 @@ BOOST_AUTO_TEST_CASE (content_test6)
film->set_audio_channels(16);
make_and_verify_dcp (film);
- check_dcp (TestPaths::private_data() / "fha", film);
+ check_dcp (TestPaths::private_data() / "v2.18.x" / "fha", film);
cl.run ();
}
diff --git a/test/data b/test/data
-Subproject 4cb08962ba07e99c442cb12091c0347d84d8fd8
+Subproject ddf878730354cdec8a802a59543591f6f943f5c
diff --git a/test/disk_writer_test.cc b/test/disk_writer_test.cc
index 553adcae7..ff39eaaea 100644
--- a/test/disk_writer_test.cc
+++ b/test/disk_writer_test.cc
@@ -228,110 +228,3 @@ BOOST_AUTO_TEST_CASE (disk_writer_test3)
cl.run();
}
-
-
-BOOST_AUTO_TEST_CASE (osx_drive_identification_test)
-{
- vector<OSXDisk> disks;
-
- auto disk = [&disks](string mount_point, string media_path, bool whole, std::vector<boost::filesystem::path> mount_points)
- {
- auto mp = analyse_osx_media_path (media_path);
- if (mp) {
- disks.push_back({mount_point, {}, {}, *mp, whole, mount_points, 0});
- }
- };
-
- auto find_unmounted = [](vector<OSXDisk> disks) {
- auto drives = osx_disks_to_drives (disks);
- vector<Drive> unmounted;
- std::copy_if (drives.begin(), drives.end(), std::back_inserter(unmounted), [](Drive const& drive) { return !drive.mounted(); });
- return unmounted;
- };
-
- disk("/dev/disk4s1", "IODeviceTree:/arm-io@10F00000/apcie@90000000/pci-bridge1@1/pcie-xhci@0/@7:1", false, {});
- disk("/dev/disk4", "IODeviceTree:/arm-io@10F00000/apcie@90000000/pci-bridge1@1/pcie-xhci@0/@7:0", true, {});
- disk("/dev/disk0", "IODeviceTree:/arm-io@10F00000/ans@77400000/iop-ans-nub/AppleANS3NVMeController/@1:0", true, {});
- disk("/dev/disk0s1", "IODeviceTree:/arm-io@10F00000/ans@77400000/iop-ans-nub/AppleANS3NVMeController/@1:1", false, {});
- disk("/dev/disk0s2", "IODeviceTree:/arm-io@10F00000/ans@77400000/iop-ans-nub/AppleANS3NVMeController/@1:2", false, {});
- disk("/dev/disk0s3", "IODeviceTree:/arm-io@10F00000/ans@77400000/iop-ans-nub/AppleANS3NVMeController/@1:3", false, {});
- disk("/dev/disk1", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/iBootSystemContainer@1/AppleAPFSContainerScheme/AppleAPFSMedia", true, {});
- disk("/dev/disk2", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/RecoveryOSContainer@3/AppleAPFSContainerScheme/AppleAPFSMedia", true, {});
- disk("/dev/disk3", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/Container@2/AppleAPFSContainerScheme/AppleAPFSMedia", false, {});
- disk("/dev/disk1s1", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/iBootSystemContainer@1/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/iSCPreboot@1", false, {});
- disk("/dev/disk1s2", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/iBootSystemContainer@1/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/xART@2", false, {});
- disk("/dev/disk1s3", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/iBootSystemContainer@1/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Hardware@3", false, {});
- disk("/dev/disk1s4", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/iBootSystemContainer@1/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Recovery@4", false, {});
- disk("/dev/disk2s1", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/RecoveryOSContainer@3/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Recovery@1", false, {});
- disk("/dev/disk2s2", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/RecoveryOSContainer@3/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Update@2", false, {});
- disk("/dev/disk3s1", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/Container@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Macintosh HD@1", false, {});
- disk("/dev/disk3s4", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/Container@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Update@4", false, {"/System/Volumes/Update"});
- disk("/dev/disk3s5", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/Container@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Data@5", false, {"/System/Volumes/Data"});
- disk("/dev/disk3s2", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/Container@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Preboot@2", false, {"/System/Volumes/Preboot"});
- disk("/dev/disk3s3", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/Container@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Recovery@3", false, {});
- disk("/dev/disk3s6", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/Container@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/VM@6", false, {"/System/Volumes/VM"});
- disk("/dev/disk3s1s1", "IOService:/AppleARMPE/arm-io@10F00000/AppleT810xIO/ans@77400000/AppleASCWrapV4/iop-ans-nub/RTBuddyV2/RTBuddyService/AppleANS3NVMeController/NS_01@1/IOBlockStorageDriver/APPLE SSD AP0512Q Media/IOGUIDPartitionScheme/Container@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Macintosh HD@1/com.apple.os.update-EA882DCA7A28EBA0A6E94689836BB10D77D84D1AEE2468E17775A447AA815278@1", false, {"/"});
-
- vector<Drive> writeable = find_unmounted (disks);
- BOOST_REQUIRE_EQUAL (writeable.size(), 1U);
- BOOST_CHECK_EQUAL (writeable[0].device(), "/dev/disk4");
-
- disks.clear ();
- disk("/dev/disk4s1", "IOService:/IOResources/IOHDIXController/IOHDIXHDDriveOutKernel@0/IODiskImageBlockStorageDeviceOutKernel/IOBlockStorageDriver/Apple UDIF read-only compressed (zlib) Media/IOGUIDPartitionScheme/disk image@1", false, {});
- disk("/dev/disk4", "IOService:/IOResources/IOHDIXController/IOHDIXHDDriveOutKernel@0/IODiskImageBlockStorageDeviceOutKernel/IOBlockStorageDriver/Apple UDIF read-only compressed (zlib) Media", true, {});
- disk("/dev/disk3s1", "IODeviceTree:/PCI0@0/XHC1@14/@2:1", false, {});
- disk("/dev/disk3", "IODeviceTree:/PCI0@0/XHC1@14/@2:0", true, {});
- disk("/dev/disk0", "IODeviceTree:/PCI0@0/SATA@1F,2/PRT1@1/PMP@0/@0:0", true, {});
- disk("/dev/disk0s1", "IODeviceTree:/PCI0@0/SATA@1F,2/PRT1@1/PMP@0/@0:1", false, {});
- disk("/dev/disk0s2", "IODeviceTree:/PCI0@0/SATA@1F,2/PRT1@1/PMP@0/@0:2", false, {"/Volumes/Macintosh HD"});
- disk("/dev/disk0s3", "IODeviceTree:/PCI0@0/SATA@1F,2/PRT1@1/PMP@0/@0:3", false, {});
- disk("/dev/disk0s4", "IODeviceTree:/PCI0@0/SATA@1F,2/PRT1@1/PMP@0/@0:4", false, {});
- disk("/dev/disk0s5", "IODeviceTree:/PCI0@0/SATA@1F,2/PRT1@1/PMP@0/@0:5", false, {"/Volumes/High Sierra"});
- disk("/dev/disk0s6", "IODeviceTree:/PCI0@0/SATA@1F,2/PRT1@1/PMP@0/@0:6", false, {});
- disk("/dev/disk0s7", "IODeviceTree:/PCI0@0/SATA@1F,2/PRT1@1/PMP@0/@0:7", false, {"/Volumes/Recovery HD"});
- disk("/dev/disk1", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 3@3/AppleAPFSContainerScheme/AppleAPFSMedia", true, {});
- disk("/dev/disk", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 4@4/AppleAPFSContainerScheme/AppleAPFSMedia", true, {});
- disk("/dev/disk1s1", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 3@3/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Untitled - Data@1", false, {"/Volumes/Untitled - Data"});
- disk("/dev/disk1s2", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 3@3/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Preboot@2", false, {});
- disk("/dev/disk1s3", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 3@3/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Recovery@3", false, {});
- disk("/dev/disk1s4", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 3@3/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/VM@4", false, {});
- disk("/dev/disk1s5", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 3@3/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Untitled@5", false, {"/Volumes/Untitled"});
- disk("/dev/disk2s1", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 4@4/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Catalina - Data@1", false, {});
- disk("/dev/disk2s2", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 4@4/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Preboot@2", false, {});
- disk("/dev/disk2s3", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 4@4/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Recovery@3", false, {});
- disk("/dev/disk2s4", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 4@4/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/VM@4", false, {"/private/var/vm"});
- disk("/dev/disk2s5", "IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/SATA@1F,2/AppleIntelPchSeriesAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/APPLE HDD ST500LM012 Media/IOGUIDPartitionScheme/Untitled 4@4/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Catalina@5", false, {"/"});
-
- writeable = find_unmounted (disks);
- BOOST_REQUIRE_EQUAL (writeable.size(), 1U);
- BOOST_CHECK_EQUAL (writeable[0].device(), "/dev/disk3");
-
- disks.clear ();
- disk("/dev/disk7", "IOService:/IOResources/IOHDIXController/IOHDIXHDDriveOutKernel@3/IODiskImageBlockStorageDeviceOutKernel/IOBlockStorageDriver/Apple UDIF read-only compressed (zlib) Media", true, {});
- disk("/dev/disk7s1", "IOService:/IOResources/IOHDIXController/IOHDIXHDDriveOutKernel@3/IODiskImageBlockStorageDeviceOutKernel/IOBlockStorageDriver/Apple UDIF read-only compressed (zlib) Media/IOGUIDPartitionScheme/disk image@1", false, {});
- disk("/dev/disk6s1", "MediaPathKey is IOService:/IOResources/IOHDIXController/IOHDIXHDDriveOutKernel@2/IODiskImageBlockStorageDeviceOutKernel/IOBlockStorageDriver/Apple UDIF read-only compressed (zlib) Media/IOGUIDPartitionScheme/disk image@1", false, {});
- disk("/dev/disk6", "IOService:/IOResources/IOHDIXController/IOHDIXHDDriveOutKernel@2/IODiskImageBlockStorageDeviceOutKernel/IOBlockStorageDriver/Apple UDIF read-only compressed (zlib) Media", true, {});
- disk("/dev/disk5s1", "IOService:/IOResources/IOHDIXController/IOHDIXHDDriveOutKernel@1/IODiskImageBlockStorageDeviceOutKernel/IOBlockStorageDriver/Apple UDIF read-only compressed (zlib) Media/IOGUIDPartitionScheme/disk image@1", false, {});
- disk("/dev/disk5", "IOService:/IOResources/IOHDIXController/IOHDIXHDDriveOutKernel@1/IODiskImageBlockStorageDeviceOutKernel/IOBlockStorageDriver/Apple UDIF read-only compressed (zlib) Media", true, {});
- disk("/dev/disk4s1", "IOService:/IOResources/IOHDIXController/IOHDIXHDDriveOutKernel@0/IODiskImageBlockStorageDeviceOutKernel/IOBlockStorageDriver/Apple UDIF read-only compressed (zlib) Media/IOGUIDPartitionScheme/disk image@1", false, {});
- disk("/dev/disk4", "IOService:/IOResources/IOHDIXController/IOHDIXHDDriveOutKernel@0/IODiskImageBlockStorageDeviceOutKernel/IOBlockStorageDriver/Apple UDIF read-only compressed (zlib) Media", true, {});
- disk("/dev/disk0", "IODeviceTree:/PCI0@1e0000/pci8086,2829@1F,2/PRT3@3/PMP@0/@0:0", true, {});
- disk("/dev/disk2", "IODeviceTree:/PCI0@1e0000/pci8086,2829@1F,2/PRT1@1/PMP@0/@0:0", true, {});
- disk("/dev/disk1", "IODeviceTree:/PCI0@1e0000/pci8086,2829@1F,2/PRT0@0/PMP@0/@0:0", true, {});
- disk("/dev/disk1s1", "IODeviceTree:/PCI0@1e0000/pci8086,2829@1F,2/PRT0@0/PMP@0/@0:1", false, {"/Volumes/EFI"});
- disk("/dev/disk2s1", "IODeviceTree:/PCI0@1e0000/pci8086,2829@1F,2/PRT1@1/PMP@0/@0:1", false, {});
- disk("/dev/disk2s2", "IODeviceTree:/PCI0@1e0000/pci8086,2829@1F,2/PRT1@1/PMP@0/@0:2", false, {});
- disk("/dev/disk3", "IOService:/AppleACPIPlatformExpert/PCI0@1e0000/AppleACPIPCI/pci8086,2829@1F,2/AppleAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/VBOX HARDDISK Media/IOGUIDPartitionScheme/disk image@2/AppleAPFSContainerScheme/AppleAPFSMedia", false, {});
- disk("/dev/disk3s1", "IOService:/AppleACPIPlatformExpert/PCI0@1e0000/AppleACPIPCI/pci8086,2829@1F,2/AppleAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/VBOX HARDDISK Media/IOGUIDPartitionScheme/disk image@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/macOS - Data@1", false, {"/System/Volumes/Data"});
- disk("/dev/disk3s2", "IOService:/AppleACPIPlatformExpert/PCI0@1e0000/AppleACPIPCI/pci8086,2829@1F,2/AppleAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/VBOX HARDDISK Media/IOGUIDPartitionScheme/disk image@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Preboot@2", false, {"/System/Volumes/Preboot"});
- disk("/dev/disk3s3", "IOService:/AppleACPIPlatformExpert/PCI0@1e0000/AppleACPIPCI/pci8086,2829@1F,2/AppleAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/VBOX HARDDISK Media/IOGUIDPartitionScheme/disk image@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Recovery@3", false, {});
- disk("/dev/disk3s4", "IOService:/AppleACPIPlatformExpert/PCI0@1e0000/AppleACPIPCI/pci8086,2829@1F,2/AppleAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/VBOX HARDDISK Media/IOGUIDPartitionScheme/disk image@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/VM@4", false, {"/System/Volumes/VM"});
- disk("/dev/disk3s5", "IOService:/AppleACPIPlatformExpert/PCI0@1e0000/AppleACPIPCI/pci8086,2829@1F,2/AppleAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/VBOX HARDDISK Media/IOGUIDPartitionScheme/disk image@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/macOS@5", false, {});
- disk("/dev/disk3s6", "IOService:/AppleACPIPlatformExpert/PCI0@1e0000/AppleACPIPCI/pci8086,2829@1F,2/AppleAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/VBOX HARDDISK Media/IOGUIDPartitionScheme/disk image@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/Update@6", false, {"/System/Volumes/Update"});
- disk("/dev/disk3s5s1", "IOService:/AppleACPIPlatformExpert/PCI0@1e0000/AppleACPIPCI/pci8086,2829@1F,2/AppleAHCI/PRT1@1/IOAHCIDevice@0/AppleAHCIDiskDriver/IOAHCIBlockStorageDevice/IOBlockStorageDriver/VBOX HARDDISK Media/IOGUIDPartitionScheme/disk image@2/AppleAPFSContainerScheme/AppleAPFSMedia/AppleAPFSContainer/macOS@5/com.apple.os.update-5523D8E63431315F9F949CCDD0274BF797F5CEE4EAF616D4C66A01B8D6A83C7B@1", false, {"/"});
-
- writeable = find_unmounted (disks);
- BOOST_REQUIRE_EQUAL (writeable.size(), 1U);
- BOOST_CHECK_EQUAL (writeable[0].device(), "/dev/disk0");
-}
-
diff --git a/test/ffmpeg_decoder_seek_test.cc b/test/ffmpeg_decoder_seek_test.cc
index 4dceae86b..f38ef3564 100644
--- a/test/ffmpeg_decoder_seek_test.cc
+++ b/test/ffmpeg_decoder_seek_test.cc
@@ -64,18 +64,18 @@ store (ContentVideo v)
static void
-check (shared_ptr<FFmpegDecoder> decoder, int frame)
+check (shared_ptr<FFmpegDecoder> decoder, ContentTime time)
{
BOOST_REQUIRE (decoder->ffmpeg_content()->video_frame_rate ());
- decoder->seek (ContentTime::from_frames (frame, decoder->ffmpeg_content()->video_frame_rate().get()), true);
+ decoder->seek(time, true);
stored = optional<ContentVideo> ();
while (!decoder->pass() && !stored) {}
- BOOST_CHECK (stored->frame <= frame);
+ BOOST_CHECK(stored->time <= time);
}
static void
-test (boost::filesystem::path file, vector<int> frames)
+test (boost::filesystem::path file, vector<ContentTime> times)
{
auto path = TestPaths::private_data() / file;
BOOST_REQUIRE (boost::filesystem::exists (path));
@@ -87,7 +87,7 @@ test (boost::filesystem::path file, vector<int> frames)
auto decoder = make_shared<FFmpegDecoder>(film, content, false);
decoder->video->Data.connect (bind (&store, _1));
- for (auto i: frames) {
+ for (auto i: times) {
check (decoder, i);
}
}
@@ -95,10 +95,43 @@ test (boost::filesystem::path file, vector<int> frames)
BOOST_AUTO_TEST_CASE (ffmpeg_decoder_seek_test)
{
- vector<int> frames = { 0, 42, 999, 0 };
-
- test ("boon_telly.mkv", frames);
- test ("Sintel_Trailer1.480p.DivX_Plus_HD.mkv", frames);
- test ("prophet_long_clip.mkv", { 15, 42, 999, 15 });
- test ("dolby_aurora.vob", { 0, 125, 250, 41 });
+ test(
+ "boon_telly.mkv",
+ {
+ ContentTime::from_frames(0, 29.97),
+ ContentTime::from_frames(42, 29.97),
+ ContentTime::from_frames(999, 29.97),
+ ContentTime::from_frames(0, 29.97),
+ }
+ );
+
+ test(
+ "Sintel_Trailer1.480p.DivX_Plus_HD.mkv",
+ {
+ ContentTime::from_frames(0, 24),
+ ContentTime::from_frames(42, 24),
+ ContentTime::from_frames(999, 24),
+ ContentTime::from_frames(0, 24),
+ }
+ );
+
+ test(
+ "prophet_long_clip.mkv",
+ {
+ ContentTime::from_frames(15, 23.976),
+ ContentTime::from_frames(42, 23.976),
+ ContentTime::from_frames(999, 23.976),
+ ContentTime::from_frames(15, 23.976)
+ }
+ );
+
+ test(
+ "dolby_aurora.vob",
+ {
+ ContentTime::from_frames(0, 25),
+ ContentTime::from_frames(125, 25),
+ ContentTime::from_frames(250, 25),
+ ContentTime::from_frames(41, 25)
+ }
+ );
}
diff --git a/test/ffmpeg_encoder_test.cc b/test/ffmpeg_encoder_test.cc
index dc57b473b..f0133ff66 100644
--- a/test/ffmpeg_encoder_test.cc
+++ b/test/ffmpeg_encoder_test.cc
@@ -259,8 +259,8 @@ BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test4)
/** Test mixdown from 5.1 to stereo */
BOOST_AUTO_TEST_CASE (ffmpeg_encoder_h264_test5)
{
- auto film = new_test_film ("ffmpeg_transcoder_h264_test5");
- film->set_name ("ffmpeg_transcoder_h264_test5");
+ auto film = new_test_film("ffmpeg_encoder_h264_test5");
+ film->set_name("ffmpeg_encoder_h264_test5");
film->set_container (Ratio::from_id ("185"));
film->set_audio_channels (6);
diff --git a/test/ffmpeg_examiner_test.cc b/test/ffmpeg_examiner_test.cc
index c745335ae..231bd16e0 100644
--- a/test/ffmpeg_examiner_test.cc
+++ b/test/ffmpeg_examiner_test.cc
@@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE (ffmpeg_examiner_probesize_test)
BOOST_CHECK_EQUAL (examiner->audio_streams()[0]->frame_rate(), 48000);
BOOST_CHECK_EQUAL (examiner->audio_streams()[0]->channels(), 2);
BOOST_CHECK_EQUAL (examiner->audio_streams()[1]->frame_rate(), 48000);
- BOOST_CHECK_EQUAL (examiner->audio_streams()[1]->channels(), 5);
+ BOOST_CHECK_EQUAL (examiner->audio_streams()[1]->channels(), 6);
}
diff --git a/test/j2k_encode_threading_test.cc b/test/j2k_encode_threading_test.cc
new file mode 100644
index 000000000..ff2e7b0dc
--- /dev/null
+++ b/test/j2k_encode_threading_test.cc
@@ -0,0 +1,117 @@
+/*
+ Copyright (C) 2023 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ DCP-o-matic is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+
+#include "lib/config.h"
+#include "lib/content_factory.h"
+#include "lib/dcp_encoder.h"
+#include "lib/dcp_transcode_job.h"
+#include "lib/encode_server_description.h"
+#include "lib/film.h"
+#include "lib/j2k_encoder.h"
+#include "lib/job_manager.h"
+#include "lib/make_dcp.h"
+#include "lib/transcode_job.h"
+#include "test.h"
+#include <dcp/cpl.h>
+#include <dcp/dcp.h>
+#include <dcp/reel.h>
+#include <dcp/reel_picture_asset.h>
+#include <boost/test/unit_test.hpp>
+
+
+using std::dynamic_pointer_cast;
+using std::list;
+
+
+BOOST_AUTO_TEST_CASE(local_threads_created_and_destroyed)
+{
+ auto film = new_test_film2("local_threads_created_and_destroyed", {});
+ Writer writer(film, {});
+ J2KEncoder encoder(film, writer);
+
+ encoder.remake_threads(32, 0, {});
+ BOOST_CHECK_EQUAL(encoder._threads.size(), 32U);
+
+ encoder.remake_threads(9, 0, {});
+ BOOST_CHECK_EQUAL(encoder._threads.size(), 9U);
+
+ encoder.end();
+ BOOST_CHECK_EQUAL(encoder._threads.size(), 0U);
+}
+
+
+BOOST_AUTO_TEST_CASE(remote_threads_created_and_destroyed)
+{
+ auto film = new_test_film2("remote_threads_created_and_destroyed", {});
+ Writer writer(film, {});
+ J2KEncoder encoder(film, writer);
+
+ list<EncodeServerDescription> servers = {
+ { "fred", 7, SERVER_LINK_VERSION },
+ { "jim", 2, SERVER_LINK_VERSION },
+ { "sheila", 14, SERVER_LINK_VERSION },
+ };
+
+ encoder.remake_threads(0, 0, servers);
+ BOOST_CHECK_EQUAL(encoder._threads.size(), 7U + 2U + 14U);
+
+ servers = {
+ { "fred", 7, SERVER_LINK_VERSION },
+ { "jim", 5, SERVER_LINK_VERSION },
+ { "sheila", 14, SERVER_LINK_VERSION },
+ };
+
+ encoder.remake_threads(0, 0, servers);
+ BOOST_CHECK_EQUAL(encoder._threads.size(), 7U + 5U + 14U);
+
+ servers = {
+ { "fred", 0, SERVER_LINK_VERSION },
+ { "jim", 0, SERVER_LINK_VERSION },
+ { "sheila", 11, SERVER_LINK_VERSION },
+ };
+
+ encoder.remake_threads(0, 0, servers);
+ BOOST_CHECK_EQUAL(encoder._threads.size(), 11U);
+}
+
+
+BOOST_AUTO_TEST_CASE(frames_not_lost_when_threads_disappear)
+{
+ auto content = content_factory(TestPaths::private_data() / "clapperboard.mp4");
+ auto film = new_test_film2("frames_not_lost", content);
+ film->write_metadata();
+ auto job = make_dcp(film, TranscodeJob::ChangedBehaviour::IGNORE);
+ auto& encoder = dynamic_pointer_cast<DCPEncoder>(job->_encoder)->_j2k_encoder;
+
+ while (JobManager::instance()->work_to_do()) {
+ encoder.remake_threads(rand() % 8, 0, {});
+ dcpomatic_sleep_seconds(1);
+ }
+
+ BOOST_CHECK(!JobManager::instance()->errors());
+
+ dcp::DCP dcp(film->dir(film->dcp_name()));
+ dcp.read();
+ BOOST_REQUIRE_EQUAL(dcp.cpls().size(), 1U);
+ BOOST_REQUIRE_EQUAL(dcp.cpls()[0]->reels().size(), 1U);
+ BOOST_REQUIRE_EQUAL(dcp.cpls()[0]->reels()[0]->main_picture()->intrinsic_duration(), 423U);
+}
+
diff --git a/test/kdm_cli_test.cc b/test/kdm_cli_test.cc
index e79e37b2d..2e5e4760c 100644
--- a/test/kdm_cli_test.cc
+++ b/test/kdm_cli_test.cc
@@ -87,13 +87,13 @@ setup_test_config()
auto config = Config::instance();
auto const cert = dcp::Certificate(dcp::file_to_string("test/data/cert.pem"));
- auto cinema_a = std::make_shared<Cinema>("Dean's Screens", vector<string>(), "", 0, 0);
+ auto cinema_a = std::make_shared<Cinema>("Dean's Screens", vector<string>(), "");
cinema_a->add_screen(std::make_shared<dcpomatic::Screen>("Screen 1", "", cert, boost::none, std::vector<TrustedDevice>()));
cinema_a->add_screen(std::make_shared<dcpomatic::Screen>("Screen 2", "", cert, boost::none, std::vector<TrustedDevice>()));
cinema_a->add_screen(std::make_shared<dcpomatic::Screen>("Screen 3", "", cert, boost::none, std::vector<TrustedDevice>()));
config->add_cinema(cinema_a);
- auto cinema_b = std::make_shared<Cinema>("Floyd's Celluloid", vector<string>(), "", 0, 0);
+ auto cinema_b = std::make_shared<Cinema>("Floyd's Celluloid", vector<string>(), "");
cinema_b->add_screen(std::make_shared<dcpomatic::Screen>("Foo", "", cert, boost::none, std::vector<TrustedDevice>()));
cinema_b->add_screen(std::make_shared<dcpomatic::Screen>("Bar", "", cert, boost::none, std::vector<TrustedDevice>()));
config->add_cinema(cinema_b);
@@ -228,3 +228,40 @@ BOOST_AUTO_TEST_CASE(kdm_cli_specify_cert)
BOOST_CHECK(boost::filesystem::exists(kdm_filename));
}
+
+BOOST_AUTO_TEST_CASE(kdm_cli_time)
+{
+ ConfigRestorer cr;
+
+ setup_test_config();
+
+ boost::filesystem::path kdm_filename = "build/test/KDM_Test_FTR-1_F-133_XX-XX_MOS_2K_20220109_SMPTE_OV_Deans_Screens_Screen_2.xml";
+
+ boost::system::error_code ec;
+ boost::filesystem::remove(kdm_filename, ec);
+
+ dcp::LocalTime now;
+ now.add_days(2);
+
+ vector<string> args = {
+ "kdm_cli",
+ "--verbose",
+ "--valid-from", now.as_string(),
+ "--valid-duration", "2 weeks",
+ "-c", "Dean's Screens",
+ "-S", "Screen 2",
+ "-o", "build/test",
+ "test/data/dkdm.xml"
+ };
+
+ vector<string> output;
+ auto error = run(args, output);
+ BOOST_CHECK(!error);
+
+ BOOST_REQUIRE_EQUAL(output.size(), 2U);
+ BOOST_CHECK(boost::algorithm::starts_with(output[0], "Making KDMs valid from"));
+ BOOST_CHECK_EQUAL(output[1], "Wrote 1 KDM files to build/test");
+
+ BOOST_CHECK(boost::filesystem::exists(kdm_filename));
+}
+
diff --git a/test/kdm_naming_test.cc b/test/kdm_naming_test.cc
index 32500553e..0f44fe2ea 100644
--- a/test/kdm_naming_test.cc
+++ b/test/kdm_naming_test.cc
@@ -59,16 +59,14 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test)
auto crypt_cert = c->decryption_chain()->leaf();
- /* Cinema A: UTC +4:30 */
- auto cinema_a = make_shared<Cinema>("Cinema A", vector<string>(), "", 4, 30);
+ auto cinema_a = make_shared<Cinema>("Cinema A", vector<string>(), "");
cinema_a_screen_1 = std::make_shared<dcpomatic::Screen>("Screen 1", "", crypt_cert, boost::none, vector<TrustedDevice>());
cinema_a->add_screen (cinema_a_screen_1);
cinema_a_screen_2 = std::make_shared<dcpomatic::Screen>("Screen 2", "", crypt_cert, boost::none, vector<TrustedDevice>());
cinema_a->add_screen (cinema_a_screen_2);
c->add_cinema (cinema_a);
- /* Cinema B: UTC -1:00 */
- auto cinema_b = make_shared<Cinema>("Cinema B", vector<string>(), "", -1, 0);
+ auto cinema_b = make_shared<Cinema>("Cinema B", vector<string>(), "");
cinema_b_screen_x = std::make_shared<dcpomatic::Screen>("Screen X", "", crypt_cert, boost::none, vector<TrustedDevice>());
cinema_b->add_screen (cinema_b_screen_x);
cinema_b_screen_y = std::make_shared<dcpomatic::Screen>("Screen Y", "", crypt_cert, boost::none, vector<TrustedDevice>());
@@ -90,14 +88,13 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test)
auto sign_cert = c->signer_chain()->leaf();
- dcp::LocalTime from (sign_cert.not_before());
+ dcp::LocalTime from = sign_cert.not_before();
+ from.set_offset({ 4, 30 });
from.add_months (2);
- dcp::LocalTime until (sign_cert.not_after());
+ dcp::LocalTime until = sign_cert.not_after();
+ until.set_offset({ 4, 30 });
until.add_months (-2);
- auto const from_string = from.date() + " " + from.time_of_day(true, false);
- auto const until_string = until.date() + " " + until.time_of_day(true, false);
-
std::vector<KDMCertificatePeriod> period_checks;
auto cpl = cpls.front().cpl_file;
@@ -107,8 +104,8 @@ BOOST_AUTO_TEST_CASE (single_kdm_naming_test)
auto kdm = kdm_for_screen (
make_kdm,
cinema_a_screen_1,
- boost::posix_time::time_from_string(from_string),
- boost::posix_time::time_from_string(until_string),
+ from,
+ until,
dcp::Formulation::MODIFIED_TRANSITIONAL_1,
false,
optional<int>(),
@@ -157,9 +154,6 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on(
dcp::LocalTime until (sign_cert.not_after());
until.add_months (-2);
- string const from_string = from.date() + " " + from.time_of_day(true, false);
- string const until_string = until.date() + " " + until.time_of_day(true, false);
-
vector<shared_ptr<dcpomatic::Screen>> screens = {
cinema_a_screen_2, cinema_b_screen_x, cinema_a_screen_1, (cinema_b_screen_z)
};
@@ -178,8 +172,8 @@ BOOST_AUTO_TEST_CASE (directory_kdm_naming_test, * boost::unit_test::depends_on(
auto kdm = kdm_for_screen (
make_kdm,
i,
- boost::posix_time::time_from_string(from_string),
- boost::posix_time::time_from_string(until_string),
+ from,
+ until,
dcp::Formulation::MODIFIED_TRANSITIONAL_1,
false,
optional<int>(),
diff --git a/test/low_bitrate_test.cc b/test/low_bitrate_test.cc
index 7050dd771..52b8d54be 100644
--- a/test/low_bitrate_test.cc
+++ b/test/low_bitrate_test.cc
@@ -31,6 +31,7 @@ extern "C" {
using std::make_shared;
+using namespace dcpomatic;
BOOST_AUTO_TEST_CASE (low_bitrate_test)
@@ -51,7 +52,7 @@ BOOST_AUTO_TEST_CASE (low_bitrate_test)
boost::optional<ColourConversion>(),
VideoRange::FULL,
std::weak_ptr<Content>(),
- boost::optional<Frame>(),
+ boost::optional<ContentTime>(),
false
);
diff --git a/test/map_cli_test.cc b/test/map_cli_test.cc
index ed2a7e5ec..0600de31e 100644
--- a/test/map_cli_test.cc
+++ b/test/map_cli_test.cc
@@ -466,6 +466,7 @@ BOOST_AUTO_TEST_CASE(map_with_given_config)
};
boost::filesystem::remove_all(out);
+ boost::filesystem::remove_all("test/data/map_with_given_config/2.18");
Config::instance()->drop();
vector<string> output_messages;
diff --git a/test/player_test.cc b/test/player_test.cc
index 5120c0180..530dfc770 100644
--- a/test/player_test.cc
+++ b/test/player_test.cc
@@ -54,6 +54,7 @@ using std::cout;
using std::list;
using std::shared_ptr;
using std::make_shared;
+using std::vector;
using boost::bind;
using boost::optional;
#if BOOST_VERSION >= 106100
@@ -710,3 +711,31 @@ BOOST_AUTO_TEST_CASE(three_d_in_two_d_chooses_left)
while (!player->pass()) {}
}
+
+BOOST_AUTO_TEST_CASE(check_seek_with_no_video)
+{
+ auto content = content_factory(TestPaths::private_data() / "Fight.Club.1999.720p.BRRip.x264-x0r.srt")[0];
+ auto film = new_test_film2("check_seek_with_no_video", { content });
+ auto player = std::make_shared<Player>(film, film->playlist());
+
+ boost::signals2::signal<void (std::shared_ptr<PlayerVideo>, dcpomatic::DCPTime)> Video;
+
+ optional<dcpomatic::DCPTime> earliest;
+
+ player->Video.connect(
+ [&earliest](shared_ptr<PlayerVideo>, dcpomatic::DCPTime time) {
+ if (!earliest || time < *earliest) {
+ earliest = time;
+ }
+ });
+
+ player->seek(dcpomatic::DCPTime::from_seconds(60 * 60), false);
+
+ for (int i = 0; i < 10; ++i) {
+ player->pass();
+ }
+
+ BOOST_REQUIRE(earliest);
+ BOOST_CHECK(*earliest >= dcpomatic::DCPTime(60 * 60));
+}
+
diff --git a/test/shuffler_test.cc b/test/shuffler_test.cc
index 2099a0923..37d6749c3 100644
--- a/test/shuffler_test.cc
+++ b/test/shuffler_test.cc
@@ -33,14 +33,15 @@ using boost::optional;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
+using namespace dcpomatic;
static void
-push (Shuffler& s, int frame, Eyes eyes)
+push(Shuffler& s, int frame, Eyes eyes)
{
auto piece = make_shared<Piece>(shared_ptr<Content>(), shared_ptr<Decoder>(), FrameRateChange(24, 24));
ContentVideo cv;
- cv.frame = frame;
+ cv.time = ContentTime::from_frames(frame, 24);
cv.eyes = eyes;
s.video (piece, cv);
}
@@ -56,8 +57,9 @@ receive (weak_ptr<Piece>, ContentVideo cv)
static void
check (int frame, Eyes eyes, int line)
{
+ auto const time = ContentTime::from_frames(frame, 24);
BOOST_REQUIRE_MESSAGE (!pending_cv.empty(), "Check at " << line << " failed.");
- BOOST_CHECK_MESSAGE (pending_cv.front().frame == frame, "Check at " << line << " failed.");
+ BOOST_CHECK_MESSAGE (pending_cv.front().time == time, "Check at " << line << " failed.");
BOOST_CHECK_MESSAGE (pending_cv.front().eyes == eyes, "Check at " << line << " failed.");
pending_cv.pop_front();
}
diff --git a/test/test.cc b/test/test.cc
index fc5d9dc83..bf008998a 100644
--- a/test/test.cc
+++ b/test/test.cc
@@ -163,11 +163,21 @@ struct TestConfig
setup_test_config ();
capture_ffmpeg_logs();
- EncodeServerFinder::instance()->stop ();
+ EncodeServerFinder::drop();
signal_manager = new TestSignalManager ();
dcpomatic_log.reset (new FileLog("build/test/log"));
+
+ auto const& suite = boost::unit_test::framework::master_test_suite();
+ int types = LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR;
+ for (int i = 1; i < suite.argc; ++i) {
+ if (string(suite.argv[i]) == "--log=debug-player") {
+ types |= LogEntry::TYPE_DEBUG_PLAYER;
+ }
+ }
+
+ dcpomatic_log->set_types(types);
}
~TestConfig ()
diff --git a/test/wscript b/test/wscript
index bb66d1a5f..400d8ea74 100644
--- a/test/wscript
+++ b/test/wscript
@@ -112,6 +112,7 @@ def build(bld):
interrupt_encoder_test.cc
isdcf_name_test.cc
j2k_bandwidth_test.cc
+ j2k_encode_threading_test.cc
job_manager_test.cc
kdm_cli_test.cc
kdm_naming_test.cc