/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#include <boost/foreach.hpp>
#include <iostream>
+#include "i18n.h"
+
using std::string;
using std::cout;
using std::list;
*/
Transcoder::Transcoder (shared_ptr<const Film> film, shared_ptr<Job> j)
: _film (film)
+ , _job (j)
, _player (new Player (film, film->playlist ()))
, _writer (new Writer (film, j))
, _encoder (new Encoder (film, _writer))
_writer->start ();
_encoder->begin ();
+ _job->sub (_("Encoding picture and sound"));
+
DCPTime const frame = DCPTime::from_frames (1, _film->video_frame_rate ());
DCPTime const length = _film->length ();
if (non_burnt_subtitles) {
_writer->write (_player->get_subtitles (t, frame, true, false, true));
}
+
+ _job->set_progress (float(t.get()) / length.get());
}
BOOST_FOREACH (ReferencedReelAsset i, _player->get_reel_assets ()) {
private:
boost::shared_ptr<const Film> _film;
+ boost::shared_ptr<Job> _job;
boost::shared_ptr<Player> _player;
boost::shared_ptr<Writer> _writer;
boost::shared_ptr<Encoder> _encoder;
/*
- Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
if (_film->is_signed() && !Config::instance()->signer_chain()->valid ()) {
throw InvalidSignerError ();
}
-
- job->sub (_("Encoding image data"));
}
void
}
lock.lock ();
-
- shared_ptr<Job> job = _job.lock ();
- DCPOMATIC_ASSERT (job);
- int64_t total = _film->length().frames_round (_film->video_frame_rate ());
- if (_film->three_d ()) {
- /* _full_written and so on are incremented for each eye, so we need to double the total
- frames to get the correct progress.
- */
- total *= 2;
- }
- if (total) {
- job->set_progress (float (_full_written + _fake_written + _repeat_written) / total);
- }
}
while (_queued_full_in_memory > _maximum_frames_in_memory) {