#include "format.h"
#include "filter.h"
#include "ab_transcoder.h"
-#include "encoder_factory.h"
#include "config.h"
+#include "encoder.h"
+#include "log.h"
+
+#include "i18n.h"
using std::string;
using boost::shared_ptr;
/** @param f Film to compare.
- * @param o Options.
+ * @param o Decode options.
*/
-ABTranscodeJob::ABTranscodeJob (shared_ptr<Film> f, shared_ptr<const DecodeOptions> od, shared_ptr<const EncodeOptions> oe, shared_ptr<Job> req)
- : Job (f, req)
- , _decode_opt (od)
- , _encode_opt (oe)
+ABTranscodeJob::ABTranscodeJob (shared_ptr<Film> f, DecodeOptions o)
+ : Job (f)
+ , _decode_opt (o)
{
_film_b.reset (new Film (*_film));
_film_b->set_scaler (Config::instance()->reference_scaler ());
string
ABTranscodeJob::name () const
{
- return String::compose ("A/B transcode %1", _film->name());
+ return String::compose (_("A/B transcode %1"), _film->name());
}
void
{
try {
/* _film_b is the one with reference filters */
- ABTranscoder w (_film_b, _film, _decode_opt, this, encoder_factory (_film, _encode_opt));
+ ABTranscoder w (_film_b, _film, _decode_opt, this, shared_ptr<Encoder> (new Encoder (_film)));
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;
}
}