*/
/** @file src/film.cc
- * @brief A representation of some audio and video content, and details of
+ * @brief A representation of some audio, video and subtitle content, and details of
* how they should be presented in a DCP.
*/
#include "job.h"
#include "util.h"
#include "job_manager.h"
+#include "dcp_transcoder.h"
#include "transcode_job.h"
#include "upload_job.h"
#include "null_log.h"
}
LOG_GENERAL ("J2K bandwidth %1", j2k_bandwidth());
- JobManager::instance()->add (shared_ptr<Job> (new TranscodeJob (shared_from_this())));
+ shared_ptr<TranscodeJob> tj (new TranscodeJob (shared_from_this()));
+ tj->set_transcoder (shared_ptr<Transcoder> (new DCPTranscoder (shared_from_this(), tj)));
+ JobManager::instance()->add (tj);
}
/** Start a job to send our DCP to the configured TMS */
return N_("transcode");
}
+void
+TranscodeJob::set_transcoder (shared_ptr<Transcoder> t)
+{
+ _transcoder = t;
+}
+
void
TranscodeJob::run ()
{
gettimeofday (&start, 0);
LOG_GENERAL_NC (N_("Transcode job starting"));
- _transcoder.reset (new DCPTranscoder (_film, shared_from_this ()));
+ DCPOMATIC_ASSERT (_transcoder);
_transcoder->go ();
set_progress (1);
set_state (FINISHED_OK);
LOG_GENERAL (N_("Transcode job completed successfully: %1 fps"), fps);
_transcoder.reset ();
+ /* XXX: this shouldn't be here */
if (_film->upload_after_make_dcp ()) {
shared_ptr<Job> job (new UploadJob (_film));
JobManager::instance()->add (job);
TranscodeJob::remaining_time () const
{
/* _transcoder might be destroyed by the job-runner thread */
- shared_ptr<DCPTranscoder> t = _transcoder;
+ shared_ptr<Transcoder> t = _transcoder;
if (!t || t->finishing()) {
/* We aren't doing any actual encoding so just use the job's guess */
#include "job.h"
#include <boost/shared_ptr.hpp>
-class DCPTranscoder;
+class Transcoder;
/** @class TranscodeJob
* @brief A job which transcodes from one format to another.
void run ();
std::string status () const;
+ void set_transcoder (boost::shared_ptr<Transcoder> t);
+
private:
int remaining_time () const;
- boost::shared_ptr<DCPTranscoder> _transcoder;
+ boost::shared_ptr<Transcoder> _transcoder;
};
virtual float current_encoding_rate () const = 0;
virtual int video_frames_enqueued () const = 0;
+ virtual bool finishing () const = 0;
protected:
virtual void video (boost::shared_ptr<PlayerVideo>, DCPTime) = 0;