summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/dcpdiff.cc51
-rw-r--r--tools/dcpinfo.cc3
2 files changed, 40 insertions, 14 deletions
diff --git a/tools/dcpdiff.cc b/tools/dcpdiff.cc
index 025308e6..b361b93a 100644
--- a/tools/dcpdiff.cc
+++ b/tools/dcpdiff.cc
@@ -8,44 +8,76 @@ using namespace std;
using namespace boost;
using namespace libdcp;
+static bool verbose = false;
+
static void
help (string n)
{
cerr << "Syntax: " << n << " [OPTION] <DCP> <DCP>\n"
- << " -v, --version show libdcp version\n"
- << " -h, --help show this help\n"
+ << " -V, --version show libdcp version\n"
+ << " -h, --help show this help\n"
+ << " -v, --verbose be verbose\n"
+ << " -n, --names allow differing MXF names\n"
+ << " -m, --mean-pixel maximum allowed mean pixel error (default 5)\n"
+ << " -s, --std-dev-pixel maximum allowed standard deviation of pixel error (default 5)\n"
<< "\n"
<< "The <DCP>s are the DCP directories to compare.\n"
<< "Comparison is of metadata and content, ignoring timestamps\n"
<< "and differing UUIDs.\n";
}
+void
+note (NoteType t, string n)
+{
+ if (t == ERROR || verbose) {
+ cout << " " << n << "\n";
+ }
+}
+
int
main (int argc, char* argv[])
{
EqualityOptions options;
+ options.max_mean_pixel_error = 5;
+ options.max_std_dev_pixel_error = 5;
int option_index = 0;
while (1) {
static struct option long_options[] = {
- { "version", no_argument, 0, 'v'},
+ { "version", no_argument, 0, 'V'},
{ "help", no_argument, 0, 'h'},
+ { "verbose", no_argument, 0, 'v'},
+ { "names", no_argument, 0, 'n'},
+ { "mean-pixel", required_argument, 0, 'm'},
+ { "std-dev-pixel", required_argument, 0, 's'},
{ 0, 0, 0, 0 }
};
- int c = getopt_long (argc, argv, "vh", long_options, &option_index);
+ int c = getopt_long (argc, argv, "Vhvnm:s:", long_options, &option_index);
if (c == -1) {
break;
}
switch (c) {
- case 'v':
+ case 'V':
cout << "dcpdiff version " << LIBDCP_VERSION << "\n";
exit (EXIT_SUCCESS);
case 'h':
help (argv[0]);
exit (EXIT_SUCCESS);
+ case 'v':
+ verbose = true;
+ break;
+ case 'n':
+ options.mxf_names_can_differ = true;
+ break;
+ case 'm':
+ options.max_mean_pixel_error = atof (optarg);
+ break;
+ case 's':
+ options.max_std_dev_pixel_error = atof (optarg);
+ break;
}
}
@@ -82,17 +114,10 @@ main (int argc, char* argv[])
exit (EXIT_FAILURE);
}
- options.max_mean_pixel_error = 5;
- options.max_std_dev_pixel_error = 5;
/* I think this is just below the LSB at 16-bits (ie the 8th most significant bit at 24-bit) */
options.max_audio_sample_error = 255;
- list<string> notes;
- bool equals = a->equals (*b, options, notes);
-
- for (list<string>::iterator i = notes.begin(); i != notes.end(); ++i) {
- cout << " " << *i << "\n";
- }
+ bool const equals = a->equals (*b, options, boost::bind (note, _1, _2));
if (equals) {
exit (EXIT_SUCCESS);
diff --git a/tools/dcpinfo.cc b/tools/dcpinfo.cc
index 0c4b9b1a..04fec82f 100644
--- a/tools/dcpinfo.cc
+++ b/tools/dcpinfo.cc
@@ -8,6 +8,7 @@
#include "sound_asset.h"
#include "picture_asset.h"
#include "subtitle_asset.h"
+#include "cpl.h"
using std::string;
using std::cerr;
@@ -91,7 +92,7 @@ main (int argc, char* argv[])
cout << " Reel " << R << "\n";
if ((*j)->main_picture()) {
- cout << " Picture: " << (*j)->main_picture()->width() << "x" << (*j)->main_picture()->height() << "\n";
+ cout << " Picture: " << (*j)->main_picture()->size().width << "x" << (*j)->main_picture()->size().height << "\n";
}
if ((*j)->main_sound()) {
cout << " Sound: " << (*j)->main_sound()->channels() << " channels at " << (*j)->main_sound()->sampling_rate() << "Hz\n";