X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fab_transcode_job.cc;h=a29e7877666fc3c18ac82812f9f7247120dda0c0;hb=a183c1776cfd020a37d028ebb0f641352f49697b;hp=d94f56d0a4c0a46538fc19d3e437273a3ff4b4bf;hpb=5d48e36440d6b4ebf4c04a413bd340b214ba8c42;p=dcpomatic.git diff --git a/src/lib/ab_transcode_job.cc b/src/lib/ab_transcode_job.cc index d94f56d0a..a29e78776 100644 --- a/src/lib/ab_transcode_job.cc +++ b/src/lib/ab_transcode_job.cc @@ -19,49 +19,50 @@ #include #include "ab_transcode_job.h" -#include "j2k_wav_encoder.h" #include "film.h" -#include "format.h" -#include "filter.h" #include "ab_transcoder.h" -#include "film_state.h" -#include "encoder_factory.h" #include "config.h" +#include "log.h" -using namespace std; -using namespace boost; +#include "i18n.h" -/** @param s FilmState to compare (with filters and/or a non-bicubic scaler). - * @param o Options. - * @Param l A log that we can write to. +using std::string; +using boost::shared_ptr; + +/** @param f Film to compare. */ -ABTranscodeJob::ABTranscodeJob (shared_ptr s, shared_ptr o, Log* l) - : Job (s, o, l) +ABTranscodeJob::ABTranscodeJob (shared_ptr f) + : Job (f) { - _fs_b.reset (new FilmState (*_fs)); - _fs_b->scaler = Config::instance()->reference_scaler (); - _fs_b->filters = Config::instance()->reference_filters (); + _film_b.reset (new Film (*_film)); + _film_b->set_scaler (Config::instance()->reference_scaler ()); + /* XXX */ +// _film_b->set_filters (Config::instance()->reference_filters ()); } string ABTranscodeJob::name () const { - return String::compose ("A/B transcode %1", _fs->name); + return String::compose (_("A/B transcode %1"), _film->name()); } void ABTranscodeJob::run () { try { - /* _fs_b is the one with no filters */ - ABTranscoder w (_fs_b, _fs, _opt, this, _log, encoder_factory (_fs, _opt, _log)); + /* _film_b is the one with reference filters */ + ABTranscoder w (_film_b, _film, shared_from_this ()); w.go (); set_progress (1); set_state (FINISHED_OK); + _film->log()->log ("A/B transcode job completed successfully"); + } catch (std::exception& e) { + set_progress (1); set_state (FINISHED_ERROR); - + _film->log()->log (String::compose ("A/B transcode job failed (%1)", e.what())); + throw; } }