-3cee9121d9cda951e3fb15a53a792b682a27a01b
-e48f13a1fc46fb469417d602acfe4b3fa57d5aa2
a0b2c57943ddc55ff2b5b04aba829427a66f41e6
87521fff39a85b532f462a667bd2fb00adeb1185
}
boost::filesystem::path p = film->audio_analysis_dir ();
- p /= digest().get_value_or ("X") + "_" + audio_mapping().digest();
+ p /= digest() + "_" + audio_mapping().digest();
return p;
}
for (list<cxml::NodePtr>::const_iterator i = path_children.begin(); i != path_children.end(); ++i) {
_paths.push_back ((*i)->content ());
}
- _digest = node->optional_string_child ("Digest");
+ _digest = node->optional_string_child ("Digest").get_value_or ("X");
_position = DCPTime (node->number_child<double> ("Position"));
_trim_start = DCPTime (node->number_child<double> ("TrimStart"));
_trim_end = DCPTime (node->number_child<double> ("TrimEnd"));
for (vector<boost::filesystem::path>::const_iterator i = _paths.begin(); i != _paths.end(); ++i) {
node->add_child("Path")->add_child_text (i->string ());
}
- if (_digest) {
- node->add_child("Digest")->add_child_text (_digest.get ());
- }
+ node->add_child("Digest")->add_child_text (_digest);
node->add_child("Position")->add_child_text (raw_convert<string> (_position.get ()));
node->add_child("TrimStart")->add_child_text (raw_convert<string> (_trim_start.get ()));
node->add_child("TrimEnd")->add_child_text (raw_convert<string> (_trim_end.get ()));
}
void
-Content::examine (shared_ptr<Job> job, bool calculate_digest)
+Content::examine (shared_ptr<Job> job)
{
- if (!calculate_digest) {
- return;
- }
-
if (job) {
job->sub (_("Computing digest"));
}
boost::mutex::scoped_lock lm (_mutex);
vector<boost::filesystem::path> p = _paths;
lm.unlock ();
-
- string const d = md5_digest (p, job);
+
+ /* Some content files are very big, so we use a poor's
+ digest here: a MD5 of the first and last 1e6 bytes with the
+ size of the first file tacked on the end as a string.
+ */
+ string const d = md5_digest_head_tail (p, 1000000) + dcp::raw_convert<string> (boost::filesystem::file_size (p.front ()));
lm.lock ();
_digest = d;
string
Content::technical_summary () const
{
- return String::compose ("%1 %2 %3", path_summary(), digest().get_value_or("X"), position().seconds());
+ return String::compose ("%1 %2 %3", path_summary(), digest(), position().seconds());
}
DCPTime
{
SafeStringStream s;
- s << Content::digest().get_value_or("X")
+ s << Content::digest()
<< "_" << position().get()
<< "_" << trim_start().get()
<< "_" << trim_end().get();
/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-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
/** Examine the content to establish digest, frame rates and any other
* useful metadata.
* @param job Job to use to report progress, or 0.
- * @param calculate_digest True to calculate a digest for the content's file(s).
*/
- virtual void examine (boost::shared_ptr<Job> job, bool calculate_digest);
+ virtual void examine (boost::shared_ptr<Job> job);
/** @return Quick one-line summary of the content, as will be presented in the
* film editor.
bool paths_valid () const;
- /** @return MD5 digest of the content's file(s) */
- boost::optional<std::string> digest () const {
+ /** @return Digest of the content's file(s). Note: this is
+ * not a complete MD5-or-whatever hash, but a sort of poor
+ * man' version (see comments in ::examine).
+ */
+ std::string digest () const {
boost::mutex::scoped_lock lm (_mutex);
return _digest;
}
std::vector<boost::filesystem::path> _paths;
private:
- boost::optional<std::string> _digest;
+ std::string _digest;
DCPTime _position;
DCPTime _trim_start;
DCPTime _trim_end;
}
void
-DCPContent::examine (shared_ptr<Job> job, bool calculate_digest)
+DCPContent::examine (shared_ptr<Job> job)
{
bool const could_be_played = can_be_played ();
job->set_progress_unknown ();
- Content::examine (job, calculate_digest);
+ Content::examine (job);
shared_ptr<DCPExaminer> examiner (new DCPExaminer (shared_from_this ()));
take_from_video_examiner (examiner);
DCPTime full_length () const;
- void examine (boost::shared_ptr<Job>, bool calculate_digest);
+ void examine (boost::shared_ptr<Job>);
std::string summary () const;
std::string technical_summary () const;
void as_xml (xmlpp::Node *) const;
}
void
-DCPSubtitleContent::examine (shared_ptr<Job> job, bool calculate_digest)
+DCPSubtitleContent::examine (shared_ptr<Job> job)
{
- Content::examine (job, calculate_digest);
+ Content::examine (job);
shared_ptr<dcp::SubtitleContent> sc = load (path (0));
/*
- 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
DCPSubtitleContent (boost::shared_ptr<const Film>, cxml::ConstNodePtr, int);
/* Content */
- void examine (boost::shared_ptr<Job>, bool calculate_digest);
+ void examine (boost::shared_ptr<Job>);
std::string summary () const;
std::string technical_summary () const;
void as_xml (xmlpp::Node *) const;
/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-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
using std::cout;
using boost::shared_ptr;
-ExamineContentJob::ExamineContentJob (shared_ptr<const Film> f, shared_ptr<Content> c, bool calculate_digest)
+ExamineContentJob::ExamineContentJob (shared_ptr<const Film> f, shared_ptr<Content> c)
: Job (f)
, _content (c)
- , _calculate_digest (calculate_digest)
{
}
void
ExamineContentJob::run ()
{
- _content->examine (shared_from_this (), _calculate_digest);
+ _content->examine (shared_from_this ());
set_progress (1);
set_state (FINISHED_OK);
}
class ExamineContentJob : public Job
{
public:
- ExamineContentJob (boost::shared_ptr<const Film>, boost::shared_ptr<Content>, bool calculate_digest);
+ ExamineContentJob (boost::shared_ptr<const Film>, boost::shared_ptr<Content>);
~ExamineContentJob ();
std::string name () const;
private:
boost::shared_ptr<Content> _content;
- bool _calculate_digest;
};
}
void
-FFmpegContent::examine (shared_ptr<Job> job, bool calculate_digest)
+FFmpegContent::examine (shared_ptr<Job> job)
{
job->set_progress_unknown ();
- Content::examine (job, calculate_digest);
+ Content::examine (job);
shared_ptr<FFmpegExaminer> examiner (new FFmpegExaminer (shared_from_this (), job));
take_from_video_examiner (examiner);
*/
boost::filesystem::path p = film->audio_analysis_dir ();
- string name = digest().get_value_or ("X");
+ string name = digest();
if (audio_stream ()) {
name += "_" + audio_stream()->identifier ();
}
return boost::dynamic_pointer_cast<FFmpegContent> (Content::shared_from_this ());
}
- void examine (boost::shared_ptr<Job>, bool calculate_digest);
+ void examine (boost::shared_ptr<Job>);
std::string summary () const;
std::string technical_summary () const;
void as_xml (xmlpp::Node *) const;
}
void
-Film::examine_content (shared_ptr<Content> c, bool calculate_digest)
+Film::examine_content (shared_ptr<Content> c)
{
- shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c, calculate_digest));
+ shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c));
JobManager::instance()->add (j);
}
void
-Film::examine_and_add_content (shared_ptr<Content> c, bool calculate_digest)
+Film::examine_and_add_content (shared_ptr<Content> c)
{
if (dynamic_pointer_cast<FFmpegContent> (c)) {
run_ffprobe (c->path(0), file ("ffprobe.log"), _log);
}
- shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c, calculate_digest));
+ shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), c));
j->Finished.connect (bind (&Film::maybe_add_content, this, boost::weak_ptr<Job> (j), boost::weak_ptr<Content> (c)));
JobManager::instance()->add (j);
}
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-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
void set_directory (boost::filesystem::path);
void set_name (std::string);
void set_use_isdcf_name (bool);
- void examine_content (boost::shared_ptr<Content>, bool calculate_digest);
- void examine_and_add_content (boost::shared_ptr<Content>, bool calculate_digest);
+ void examine_content (boost::shared_ptr<Content>);
+ void examine_and_add_content (boost::shared_ptr<Content>);
void add_content (boost::shared_ptr<Content>);
void remove_content (boost::shared_ptr<Content>);
void move_content_earlier (boost::shared_ptr<Content>);
}
void
-ImageContent::examine (shared_ptr<Job> job, bool calculate_digest)
+ImageContent::examine (shared_ptr<Job> job)
{
- Content::examine (job, calculate_digest);
+ Content::examine (job);
shared_ptr<const Film> film = _film.lock ();
DCPOMATIC_ASSERT (film);
return boost::dynamic_pointer_cast<ImageContent> (Content::shared_from_this ());
};
- void examine (boost::shared_ptr<Job>, bool calculate_digest);
+ void examine (boost::shared_ptr<Job>);
std::string summary () const;
std::string technical_summary () const;
void as_xml (xmlpp::Node *) const;
/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-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
}
void
-SndfileContent::examine (shared_ptr<Job> job, bool calculate_digest)
+SndfileContent::examine (shared_ptr<Job> job)
{
job->set_progress_unknown ();
- Content::examine (job, calculate_digest);
+ Content::examine (job);
shared_ptr<AudioExaminer> dec (new SndfileDecoder (shared_from_this()));
take_from_audio_examiner (dec);
}
DCPTime full_length () const;
- void examine (boost::shared_ptr<Job>, bool calculate_digest);
+ void examine (boost::shared_ptr<Job>);
std::string summary () const;
std::string technical_summary () const;
std::string information () const;
/*
- 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
}
void
-SubRipContent::examine (boost::shared_ptr<Job> job, bool calculate_digest)
+SubRipContent::examine (boost::shared_ptr<Job> job)
{
- Content::examine (job, calculate_digest);
+ Content::examine (job);
SubRip s (shared_from_this ());
shared_ptr<const Film> film = _film.lock ();
/*
- 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
}
/* Content */
- void examine (boost::shared_ptr<Job>, bool calculate_digest);
+ void examine (boost::shared_ptr<Job>);
std::string summary () const;
std::string technical_summary () const;
void as_xml (xmlpp::Node *) const;
#endif
}
-/** @param job Optional job for which to report progress */
+/** Compute a digest of the first and last `size' bytes of a set of files. */
string
-md5_digest (vector<boost::filesystem::path> files, shared_ptr<Job> job)
+md5_digest_head_tail (vector<boost::filesystem::path> files, boost::uintmax_t size)
{
- boost::uintmax_t const buffer_size = 64 * 1024;
- char buffer[buffer_size];
-
+ boost::scoped_array<char> buffer (new char[size]);
MD5Digester digester;
- vector<int64_t> sizes;
- for (size_t i = 0; i < files.size(); ++i) {
- sizes.push_back (boost::filesystem::file_size (files[i]));
- }
-
- for (size_t i = 0; i < files.size(); ++i) {
+ /* Head */
+ boost::uintmax_t to_do = size;
+ char* p = buffer.get ();
+ int i = 0;
+ while (i < int64_t (files.size()) && to_do > 0) {
FILE* f = fopen_boost (files[i], "rb");
if (!f) {
throw OpenFileError (files[i].string());
}
- boost::uintmax_t const bytes = boost::filesystem::file_size (files[i]);
- boost::uintmax_t remaining = bytes;
-
- while (remaining > 0) {
- int const t = min (remaining, buffer_size);
- int const r = fread (buffer, 1, t, f);
- if (r != t) {
- throw ReadFileError (files[i], errno);
- }
- digester.add (buffer, t);
- remaining -= t;
-
- if (job) {
- job->set_progress ((float (i) + 1 - float(remaining) / bytes) / files.size ());
- }
+ boost::uintmax_t this_time = min (to_do, boost::filesystem::file_size (files[i]));
+ fread (p, 1, this_time, f);
+ p += this_time;
+ to_do -= this_time;
+ fclose (f);
+
+ ++i;
+ }
+ digester.add (buffer.get(), size - to_do);
+
+ /* Tail */
+ to_do = size;
+ p = buffer.get ();
+ i = files.size() - 1;
+ while (i >= 0 && to_do > 0) {
+ FILE* f = fopen_boost (files[i], "rb");
+ if (!f) {
+ throw OpenFileError (files[i].string());
}
+ boost::uintmax_t this_time = min (to_do, boost::filesystem::file_size (files[i]));
+ fseek (f, -this_time, SEEK_END);
+ fread (p, 1, this_time, f);
+ p += this_time;
+ to_do -= this_time;
fclose (f);
- }
+
+ --i;
+ }
+ digester.add (buffer.get(), size - to_do);
return digester.get ();
}
extern double seconds (struct timeval);
extern void dcpomatic_setup ();
extern void dcpomatic_setup_gettext_i18n (std::string);
-extern std::string md5_digest (std::vector<boost::filesystem::path>, boost::shared_ptr<Job>);
+extern std::string md5_digest_head_tail (std::vector<boost::filesystem::path>, boost::uintmax_t size);
extern void ensure_ui_thread ();
extern std::string audio_channel_name (int);
extern bool valid_image_file (boost::filesystem::path);
/*
- Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-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
if (!_film_to_create.empty ()) {
_frame->new_film (_film_to_create);
if (!_content_to_add.empty ()) {
- _frame->film()->examine_and_add_content (content_factory (_frame->film(), _content_to_add), true);
+ _frame->film()->examine_and_add_content (content_factory (_frame->film(), _content_to_add));
}
}
dialog->Destroy ();
} else if (uc->state() == UpdateChecker::FAILED) {
if (!UpdateChecker::instance()->last_emit_was_first ()) {
- error_dialog (_frame, _("The DCP-o-matic download server could not be contaced."));
+ error_dialog (_frame, _("The DCP-o-matic download server could not be contacted."));
}
} else {
if (!UpdateChecker::instance()->last_emit_was_first ()) {
if (vc) {
vc->set_scale (VideoContentScale (content_ratio));
}
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
}
JobManager* jm = JobManager::instance ();
return;
}
- shared_ptr<Job> j (new ExamineContentJob (film, content, true));
+ shared_ptr<Job> j (new ExamineContentJob (film, content));
j->Finished.connect (
bind (
}
for (ContentList::iterator i = _content.begin(); i != _content.end(); ++i) {
- film->examine_content (*i, true);
+ film->examine_content (*i);
}
}
dcp->add_kdm (dcp::EncryptedKDM (dcp::file_to_string (wx_to_std (d->GetPath ()))));
shared_ptr<Film> film = _film.lock ();
DCPOMATIC_ASSERT (film);
- film->examine_content (dcp, true);
+ film->examine_content (dcp);
}
d->Destroy ();
/* XXX: check for lots of files here and do something */
for (unsigned int i = 0; i < paths.GetCount(); ++i) {
- _film->examine_and_add_content (content_factory (_film, wx_to_std (paths[i])), true);
+ _film->examine_and_add_content (content_factory (_film, wx_to_std (paths[i])));
}
d->Destroy ();
if (is_dcp) {
try {
shared_ptr<DCPContent> content (new DCPContent (_film, path));
- _film->examine_and_add_content (content, true);
+ _film->examine_and_add_content (content);
} catch (...) {
error_dialog (_panel, _("Could not find a DCP in that folder."));
}
ImageSequenceDialog* e = new ImageSequenceDialog (_panel);
r = e->ShowModal ();
float const frame_rate = e->frame_rate ();
- bool const digest = e->digest ();
e->Destroy ();
if (r != wxID_OK) {
try {
shared_ptr<ImageContent> content (new ImageContent (_film, path));
content->set_video_frame_rate (frame_rate);
- _film->examine_and_add_content (content, digest);
+ _film->examine_and_add_content (content);
} catch (...) {
error_dialog (_panel, _("Could not find any images in that folder"));
return;
wxString* paths = event.GetFiles ();
for (int i = 0; i < event.GetNumberOfFiles(); i++) {
- _film->examine_and_add_content (content_factory (_film, wx_to_std (paths[i])), true);
+ _film->examine_and_add_content (content_factory (_film, wx_to_std (paths[i])));
}
}
/*
- 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
{
add (_("Frame rate"), true);
_frame_rate = add (new wxTextCtrl (this, wxID_ANY, N_("24")));
- _digest = new wxCheckBox (this, wxID_ANY, _("Calculate digests"));
- _digest->SetValue (true);
- _digest->SetToolTip (_("By default DCP-o-matic will calculate digests (hashes) of your image files so that it knows if they change. Turning this off will speed up import but you must not alter the image files after import or strange things may happen."));
- add (_digest);
-
layout ();
}
return 0;
}
-
-bool
-ImageSequenceDialog::digest () const
-{
- return _digest->GetValue ();
-}
/*
- 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
ImageSequenceDialog (wxWindow* parent);
float frame_rate () const;
- bool digest () const;
private:
wxTextCtrl* _frame_rate;
- wxCheckBox* _digest;
};
/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-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
film->set_resolution (RESOLUTION_4K);
film->set_dcp_content_type (DCPContentType::from_isdcf_name ("FTR"));
film->set_container (Ratio::from_id ("185"));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
film->make_dcp ();
boost::filesystem::path p = private_data / "betty_L.wav";
shared_ptr<SndfileContent> c (new SndfileContent (film, p));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
c->analyse_audio (boost::bind (&finished));
shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/staircase.wav"));
content->set_audio_delay (delay_in_ms);
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
film->make_dcp ();
shared_ptr<ImageContent> contentA (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
shared_ptr<ImageContent> contentB (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
- film->examine_and_add_content (contentA, true);
- film->examine_and_add_content (contentB, true);
+ film->examine_and_add_content (contentA);
+ film->examine_and_add_content (contentB);
wait_for_jobs ();
contentA->set_scale (VideoContentScale (Ratio::from_id ("185")));
film->set_name ("frobozz");
film->set_burn_subtitles (false);
shared_ptr<DCPSubtitleContent> content (new DCPSubtitleContent (film, "test/data/dcp_sub.xml"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
BOOST_CHECK_EQUAL (content->full_length(), DCPTime::from_seconds (2));
shared_ptr<Film> film = new_test_film ("ffmpeg_audio_test");
film->set_name ("ffmpeg_audio_test");
shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/staircase.mov"));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
shared_ptr<Film> film = new_test_film ("ffmpeg_dcp_test");
film->set_name ("test_film2");
shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
/*
- 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
shared_ptr<Film> film = new_test_film ("ffmpeg_decoder_seek_test_" + file.string());
shared_ptr<FFmpegContent> content (new FFmpegContent (film, path));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
shared_ptr<Log> log (new NullLog);
FFmpegDecoder decoder (content, log);
shared_ptr<Film> film = new_test_film ("ffmpeg_decoder_seek_test_" + file.string());
shared_ptr<FFmpegContent> content (new FFmpegContent (film, path));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
shared_ptr<Log> log (new NullLog);
FFmpegDecoder decoder (content, log);
shared_ptr<Film> film = new_test_film ("audio_sampling_rate_test");
/* Get any piece of content, it doesn't matter what */
shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/test.mp4"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
std::list<int> afr;
A->set_name ("frobozz");
shared_ptr<FFmpegContent> c (new FFmpegContent (A, "test/data/test.mp4"));
- A->examine_and_add_content (c, true);
+ A->examine_and_add_content (c);
A->set_encrypted (true);
wait_for_jobs ();
shared_ptr<DCPContent> d (new DCPContent (B, "build/test/import_dcp_test/" + A->dcp_name()));
d->add_kdm (kdm);
- B->examine_and_add_content (d, true);
+ B->examine_and_add_content (d);
wait_for_jobs ();
B->make_dcp ();
/* Test interior aspect ratio: shouldn't be shown with trailers */
shared_ptr<ImageContent> content (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
content->set_scale (VideoContentScale (Ratio::from_id ("133")));
film->set_container (Ratio::from_id ("185"));
film->set_name ("play_test");
shared_ptr<FFmpegContent> A (new FFmpegContent (film, "test/data/red_24.mp4"));
- film->examine_and_add_content (A, true);
+ film->examine_and_add_content (A);
wait_for_jobs ();
BOOST_CHECK_EQUAL (A->video_length_after_3d_combine(), 16);
shared_ptr<FFmpegContent> B (new FFmpegContent (film, "test/data/red_30.mp4"));
- film->examine_and_add_content (B, true);
+ film->examine_and_add_content (B);
wait_for_jobs ();
BOOST_CHECK_EQUAL (B->video_length_after_3d_combine(), 16);
shared_ptr<FFmpegContent> B (new FFmpegContent (film, "test/data/test.mp4"));
shared_ptr<FFmpegContent> C (new FFmpegContent (film, "test/data/test.mp4"));
- film->examine_and_add_content (A, true);
- film->examine_and_add_content (B, true);
- film->examine_and_add_content (C, true);
+ film->examine_and_add_content (A);
+ film->examine_and_add_content (B);
+ film->examine_and_add_content (C);
wait_for_jobs ();
BOOST_CHECK_EQUAL (A->full_length(), DCPTime (288000));
film->set_container (Ratio::from_id ("185"));
film->set_audio_channels (6);
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
shared_ptr<Player> player = film->make_player ();
shared_ptr<ImageContent> content (new ImageContent (film, "test/data/3d_test"));
content->set_video_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
film->make_dcp ();
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/red_24.mp4"));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
film->set_name ("scaling_test");
shared_ptr<ImageContent> imc (new ImageContent (film, "test/data/simple_testcard_640x480.png"));
- film->examine_and_add_content (imc, true);
+ film->examine_and_add_content (imc);
wait_for_jobs ();
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
shared_ptr<FFmpegContent> content (new FFmpegContent (film, "test/data/count300bd48.m2ts"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
content->set_scale (VideoContentScale (Ratio::from_id ("185")));
film->set_name (film_name);
shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/staircase.wav"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
film->set_audio_channels (channels);
/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-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
film->set_container (Ratio::from_id ("185"));
film->set_dcp_content_type (DCPContentType::from_pretty_name ("Test"));
shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/count300bd48.m2ts"));
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
/*
- Copyright (C) 2013-2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-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
film->set_name ("test_film2");
shared_ptr<FFmpegContent> c (new FFmpegContent (film, "test/data/test.mp4"));
c->set_video_frame_type (VIDEO_FRAME_TYPE_3D_LEFT_RIGHT);
- film->examine_and_add_content (c, true);
+ film->examine_and_add_content (c);
wait_for_jobs ();
/*
- 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
film->set_name ("frobozz");
shared_ptr<SndfileContent> content (new SndfileContent (film, "test/data/white.wav"));
content->set_audio_processor (AudioProcessor::from_id ("stereo-5.1-upmix-a"));
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
{
vector<boost::filesystem::path> p;
p.push_back ("test/data/md5.test");
- string const t = md5_digest (p, shared_ptr<Job> ());
- BOOST_CHECK_EQUAL (t, "15058685ba99decdc4398c7634796eb0");
+ BOOST_CHECK_EQUAL (md5_digest_head_tail (p, 1024), "57497ef84a0487f2bb0939a1f5703912");
+ p.push_back ("test/data/md5.test2");
+ BOOST_CHECK_EQUAL (md5_digest_head_tail (p, 1024), "5a3a89857b931755ae728a518224a05c");
+
+ p.clear ();
+ p.push_back ("test/data/md5.test3");
+ p.push_back ("test/data/md5.test");
+ p.push_back ("test/data/md5.test2");
+ p.push_back ("test/data/md5.test4");
+ BOOST_CHECK_EQUAL (md5_digest_head_tail (p, 1024), "52ccf111e4e72b58bb7b2aaa6bd45ea5");
+
p.clear ();
p.push_back ("foobar");
- BOOST_CHECK_THROW (md5_digest (p, shared_ptr<Job> ()), std::runtime_error);
+ BOOST_CHECK_THROW (md5_digest_head_tail (p, 1024), OpenFileError);
}
/* Straightforward test of DCPTime::round_up */
/*
- 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
film->set_burn_subtitles (false);
shared_ptr<SubRipContent> content (new SubRipContent (film, "test/data/subrip2.srt"));
content->set_use_subtitles (true);
- film->examine_and_add_content (content, true);
+ film->examine_and_add_content (content);
wait_for_jobs ();
film->make_dcp ();
wait_for_jobs ();