projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6b36818
)
Pass options only to jobs that need them.
author
Carl Hetherington
<cth@carlh.net>
Sun, 21 Oct 2012 12:17:04 +0000
(13:17 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 21 Oct 2012 12:17:04 +0000
(13:17 +0100)
14 files changed:
src/lib/ab_transcode_job.cc
patch
|
blob
|
history
src/lib/ab_transcode_job.h
patch
|
blob
|
history
src/lib/check_hashes_job.cc
patch
|
blob
|
history
src/lib/check_hashes_job.h
patch
|
blob
|
history
src/lib/copy_from_dvd_job.cc
patch
|
blob
|
history
src/lib/examine_content_job.cc
patch
|
blob
|
history
src/lib/job.cc
patch
|
blob
|
history
src/lib/job.h
patch
|
blob
|
history
src/lib/make_dcp_job.cc
patch
|
blob
|
history
src/lib/make_dcp_job.h
patch
|
blob
|
history
src/lib/scp_dcp_job.cc
patch
|
blob
|
history
src/lib/transcode_job.cc
patch
|
blob
|
history
src/lib/transcode_job.h
patch
|
blob
|
history
test/test.cc
patch
|
blob
|
history
diff --git
a/src/lib/ab_transcode_job.cc
b/src/lib/ab_transcode_job.cc
index 89967bfcac42e7b47d33868fb4bef1a048e7954a..cffb2cef178d3472a36eec66f34798bdb5388e8a 100644
(file)
--- a/
src/lib/ab_transcode_job.cc
+++ b/
src/lib/ab_transcode_job.cc
@@
-36,7
+36,8
@@
using namespace boost;
* @Param l A log that we can write to.
*/
ABTranscodeJob::ABTranscodeJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
* @Param l A log that we can write to.
*/
ABTranscodeJob::ABTranscodeJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
- : Job (s, o, l, req)
+ : Job (s, l, req)
+ , _opt (o)
{
_fs_b.reset (new FilmState (*_fs));
_fs_b->set_scaler (Config::instance()->reference_scaler ());
{
_fs_b.reset (new FilmState (*_fs));
_fs_b->set_scaler (Config::instance()->reference_scaler ());
diff --git
a/src/lib/ab_transcode_job.h
b/src/lib/ab_transcode_job.h
index 4b80593f4de8c6bbdff4bee6104109226a58a8ca..2485608e6aee43fa7d34069e7398145ff8e7daa9 100644
(file)
--- a/
src/lib/ab_transcode_job.h
+++ b/
src/lib/ab_transcode_job.h
@@
-40,6
+40,8
@@
public:
void run ();
private:
void run ();
private:
+ boost::shared_ptr<const Options> _opt;
+
/** Copy of our FilmState with filters removed and scaler set back to bicubic;
* this is the `reference' (left-half-frame) state.
*/
/** Copy of our FilmState with filters removed and scaler set back to bicubic;
* this is the `reference' (left-half-frame) state.
*/
diff --git
a/src/lib/check_hashes_job.cc
b/src/lib/check_hashes_job.cc
index eff9153d958ca6dbba7b0080dfd86312cf372b6f..478e4c91afc4649b995fcb5c74ba3686564ba8d5 100644
(file)
--- a/
src/lib/check_hashes_job.cc
+++ b/
src/lib/check_hashes_job.cc
@@
-32,7
+32,8
@@
using namespace std;
using namespace boost;
CheckHashesJob::CheckHashesJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
using namespace boost;
CheckHashesJob::CheckHashesJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
- : Job (s, o, l, req)
+ : Job (s, l, req)
+ , _opt (o)
, _bad (0)
{
, _bad (0)
{
diff --git
a/src/lib/check_hashes_job.h
b/src/lib/check_hashes_job.h
index 6a68e936c5a746cd10699f90d7f74863f2a18804..7cf1789f69ae4b50433c4919483409c27d80313b 100644
(file)
--- a/
src/lib/check_hashes_job.h
+++ b/
src/lib/check_hashes_job.h
@@
-29,5
+29,6
@@
public:
std::string status () const;
private:
std::string status () const;
private:
+ boost::shared_ptr<const Options> _opt;
int _bad;
};
int _bad;
};
diff --git
a/src/lib/copy_from_dvd_job.cc
b/src/lib/copy_from_dvd_job.cc
index f7281fc10e303479c2a0bcfdaef6e26121df059f..e087180728bd8767b39ddc299c8b51c55f102f09 100644
(file)
--- a/
src/lib/copy_from_dvd_job.cc
+++ b/
src/lib/copy_from_dvd_job.cc
@@
-36,7
+36,7
@@
using namespace boost;
* @param l Log that we can write to.
*/
CopyFromDVDJob::CopyFromDVDJob (shared_ptr<const FilmState> fs, Log* l, shared_ptr<Job> req)
* @param l Log that we can write to.
*/
CopyFromDVDJob::CopyFromDVDJob (shared_ptr<const FilmState> fs, Log* l, shared_ptr<Job> req)
- : Job (fs,
shared_ptr<Options> (),
l, req)
+ : Job (fs, l, req)
{
}
{
}
diff --git
a/src/lib/examine_content_job.cc
b/src/lib/examine_content_job.cc
index 5800c6f24dd643e40d2bf4db26f426be08681e04..44a9f4ce9c9a13148f24c8459cc76aecb12c06f7 100644
(file)
--- a/
src/lib/examine_content_job.cc
+++ b/
src/lib/examine_content_job.cc
@@
-33,7
+33,7
@@
using namespace std;
using namespace boost;
ExamineContentJob::ExamineContentJob (shared_ptr<const FilmState> fs, Log* l, shared_ptr<Job> req)
using namespace boost;
ExamineContentJob::ExamineContentJob (shared_ptr<const FilmState> fs, Log* l, shared_ptr<Job> req)
- : Job (fs,
shared_ptr<Options> (),
l, req)
+ : Job (fs, l, req)
{
}
{
}
diff --git
a/src/lib/job.cc
b/src/lib/job.cc
index d3871bf7225da22ed1911416c1b2ee4df4cffd5d..2049e69b0093d2c0d94609c33aa09326b0fa1d7d 100644
(file)
--- a/
src/lib/job.cc
+++ b/
src/lib/job.cc
@@
-31,12
+31,10
@@
using namespace std;
using namespace boost;
/** @param s FilmState for the film that we are operating on.
using namespace boost;
/** @param s FilmState for the film that we are operating on.
- * @param o Options.
* @param l A log that we can write to.
*/
* @param l A log that we can write to.
*/
-Job::Job (shared_ptr<const FilmState> s,
shared_ptr<const Options> o,
Log* l, shared_ptr<Job> req)
+Job::Job (shared_ptr<const FilmState> s, Log* l, shared_ptr<Job> req)
: _fs (s)
: _fs (s)
- , _opt (o)
, _log (l)
, _required (req)
, _state (NEW)
, _log (l)
, _required (req)
, _state (NEW)
diff --git
a/src/lib/job.h
b/src/lib/job.h
index f50ed078434efb6cd3661de2802a4c528fb18c7d..6b2b69b9dc52b6bdb68ed808a5d327290d2d5c83 100644
(file)
--- a/
src/lib/job.h
+++ b/
src/lib/job.h
@@
-39,7
+39,7
@@
class Options;
class Job : public boost::enable_shared_from_this<Job>
{
public:
class Job : public boost::enable_shared_from_this<Job>
{
public:
- Job (boost::shared_ptr<const FilmState> s,
boost::shared_ptr<const Options> o,
Log* l, boost::shared_ptr<Job> req);
+ Job (boost::shared_ptr<const FilmState> s, Log* l, boost::shared_ptr<Job> req);
/** @return user-readable name of this job */
virtual std::string name () const = 0;
/** @return user-readable name of this job */
virtual std::string name () const = 0;
@@
-91,8
+91,6
@@
protected:
/** FilmState for this job */
boost::shared_ptr<const FilmState> _fs;
/** FilmState for this job */
boost::shared_ptr<const FilmState> _fs;
- /** options in use for this job */
- boost::shared_ptr<const Options> _opt;
/** a log that this job can write to */
Log* _log;
/** a log that this job can write to */
Log* _log;
diff --git
a/src/lib/make_dcp_job.cc
b/src/lib/make_dcp_job.cc
index 83904fd60d2ce2d971132c8335e3e4acb06aad8a..fcfce4b07bccc6ada73799e79e2f68e8dc6064db 100644
(file)
--- a/
src/lib/make_dcp_job.cc
+++ b/
src/lib/make_dcp_job.cc
@@
-44,7
+44,8
@@
using namespace boost;
* @param l Log.
*/
MakeDCPJob::MakeDCPJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
* @param l Log.
*/
MakeDCPJob::MakeDCPJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
- : Job (s, o, l, req)
+ : Job (s, l, req)
+ , _opt (o)
{
}
{
}
diff --git
a/src/lib/make_dcp_job.h
b/src/lib/make_dcp_job.h
index c350a819c3288214ad295136debd8c87f384d69c..d430ac3ce311f2ae232ca4eab38f4f1900e1f76f 100644
(file)
--- a/
src/lib/make_dcp_job.h
+++ b/
src/lib/make_dcp_job.h
@@
-38,5
+38,7
@@
private:
void dcp_progress (float);
std::string j2c_path (int) const;
std::string wav_path (libdcp::Channel) const;
void dcp_progress (float);
std::string j2c_path (int) const;
std::string wav_path (libdcp::Channel) const;
+
+ boost::shared_ptr<const Options> _opt;
};
};
diff --git
a/src/lib/scp_dcp_job.cc
b/src/lib/scp_dcp_job.cc
index 300a8fe33c0dbec65140ea53f1b3160a30656873..3f400fca4de97099c04db9d1c4eba62e672bce7c 100644
(file)
--- a/
src/lib/scp_dcp_job.cc
+++ b/
src/lib/scp_dcp_job.cc
@@
-92,7
+92,7
@@
public:
SCPDCPJob::SCPDCPJob (shared_ptr<const FilmState> s, Log* l, shared_ptr<Job> req)
SCPDCPJob::SCPDCPJob (shared_ptr<const FilmState> s, Log* l, shared_ptr<Job> req)
- : Job (s,
shared_ptr<const Options> (),
l, req)
+ : Job (s, l, req)
, _status ("Waiting")
{
, _status ("Waiting")
{
diff --git
a/src/lib/transcode_job.cc
b/src/lib/transcode_job.cc
index 3776ea4c1d6404e11f5842daaea9baffc41f10ff..fe34867b250123a8722f5fe83c15ac74f403c2ab 100644
(file)
--- a/
src/lib/transcode_job.cc
+++ b/
src/lib/transcode_job.cc
@@
-40,7
+40,8
@@
using namespace boost;
* @param l A log that we can write to.
*/
TranscodeJob::TranscodeJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
* @param l A log that we can write to.
*/
TranscodeJob::TranscodeJob (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
- : Job (s, o, l, req)
+ : Job (s, l, req)
+ , _opt (o)
{
}
{
}
diff --git
a/src/lib/transcode_job.h
b/src/lib/transcode_job.h
index fe68a49100630dac9b9cad0bfc72cf284f016b44..d185cb65dfa6a73721865d39d2247032a8c9f6bb 100644
(file)
--- a/
src/lib/transcode_job.h
+++ b/
src/lib/transcode_job.h
@@
-42,5
+42,6
@@
protected:
int remaining_time () const;
private:
int remaining_time () const;
private:
+ boost::shared_ptr<const Options> _opt;
boost::shared_ptr<Encoder> _encoder;
};
boost::shared_ptr<Encoder> _encoder;
};
diff --git
a/test/test.cc
b/test/test.cc
index 468e6c1fddcfd37da4920f7bf3085ee88e65c47c..5aed18c523043512729a14533c85fbb9ccc56350 100644
(file)
--- a/
test/test.cc
+++ b/
test/test.cc
@@
-426,8
+426,8
@@
BOOST_AUTO_TEST_CASE (audio_sampling_rate_test)
class TestJob : public Job
{
public:
class TestJob : public Job
{
public:
- TestJob (shared_ptr<const FilmState> s,
shared_ptr<const Options> o,
Log* l, shared_ptr<Job> req)
- : Job (s,
o,
l, req)
+ TestJob (shared_ptr<const FilmState> s, Log* l, shared_ptr<Job> req)
+ : Job (s, l, req)
{
}
{
}
@@
-457,11
+457,10
@@
public:
BOOST_AUTO_TEST_CASE (job_manager_test)
{
shared_ptr<const FilmState> s;
BOOST_AUTO_TEST_CASE (job_manager_test)
{
shared_ptr<const FilmState> s;
- shared_ptr<const Options> o;
FileLog log ("build/test/job_manager_test.log");
/* Single job, no dependency */
FileLog log ("build/test/job_manager_test.log");
/* Single job, no dependency */
- shared_ptr<TestJob> a (new TestJob (s,
o,
&log, shared_ptr<Job> ()));
+ shared_ptr<TestJob> a (new TestJob (s, &log, shared_ptr<Job> ()));
JobManager::instance()->add (a);
dvdomatic_sleep (1);
JobManager::instance()->add (a);
dvdomatic_sleep (1);
@@
-471,8
+470,8
@@
BOOST_AUTO_TEST_CASE (job_manager_test)
BOOST_CHECK_EQUAL (a->finished_ok(), true);
/* Two jobs, dependency */
BOOST_CHECK_EQUAL (a->finished_ok(), true);
/* Two jobs, dependency */
- a.reset (new TestJob (s,
o,
&log, shared_ptr<Job> ()));
- shared_ptr<TestJob> b (new TestJob (s,
o,
&log, a));
+ a.reset (new TestJob (s, &log, shared_ptr<Job> ()));
+ shared_ptr<TestJob> b (new TestJob (s, &log, a));
JobManager::instance()->add (a);
JobManager::instance()->add (b);
JobManager::instance()->add (a);
JobManager::instance()->add (b);
@@
-488,8
+487,8
@@
BOOST_AUTO_TEST_CASE (job_manager_test)
BOOST_CHECK_EQUAL (b->finished_ok(), true);
/* Two jobs, dependency, first fails */
BOOST_CHECK_EQUAL (b->finished_ok(), true);
/* Two jobs, dependency, first fails */
- a.reset (new TestJob (s,
o,
&log, shared_ptr<Job> ()));
- b.reset (new TestJob (s,
o,
&log, a));
+ a.reset (new TestJob (s, &log, shared_ptr<Job> ()));
+ b.reset (new TestJob (s, &log, a));
JobManager::instance()->add (a);
JobManager::instance()->add (b);
JobManager::instance()->add (a);
JobManager::instance()->add (b);