*/
#include "transcode_job.h"
+#include "upload_job.h"
+#include "job_manager.h"
#include "film.h"
#include "transcoder.h"
#include "log.h"
#include "i18n.h"
-#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_GENERAL);
-#define LOG_ERROR_NC(...) _film->log()->log (__VA_ARGS__, Log::TYPE_ERROR);
+#define LOG_GENERAL(...) _film->log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
+#define LOG_GENERAL_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
+#define LOG_ERROR_NC(...) _film->log()->log (__VA_ARGS__, LogEntry::TYPE_ERROR);
using std::string;
using std::fixed;
TranscodeJob::run ()
{
try {
-
+ struct timeval start;
+ gettimeofday (&start, 0);
LOG_GENERAL_NC (N_("Transcode job starting"));
_transcoder.reset (new Transcoder (_film, shared_from_this ()));
set_progress (1);
set_state (FINISHED_OK);
- LOG_GENERAL_NC (N_("Transcode job completed successfully"));
+ struct timeval finish;
+ gettimeofday (&finish, 0);
+
+ float fps = 0;
+ if (finish.tv_sec != start.tv_sec) {
+ fps = _transcoder->video_frames_out() / (finish.tv_sec - start.tv_sec);
+ }
+
+ LOG_GENERAL (N_("Transcode job completed successfully: %1 fps"), fps);
_transcoder.reset ();
+ if (_film->upload_after_make_dcp ()) {
+ shared_ptr<Job> job (new UploadJob (_film));
+ JobManager::instance()->add (job);
+ }
+
} catch (...) {
_transcoder.reset ();
throw;
if (!finished () && !_transcoder->finishing ()) {
/// TRANSLATORS: fps here is an abbreviation for frames per second
- s << "; " << fixed << setprecision (1) << fps << " " << _("fps");
+ s << "; " << _transcoder->video_frames_out() << "/"
+ << _film->length().frames_round (_film->video_frame_rate ()) << " " << _("frames") << "; "
+ << fixed << setprecision (1) << fps << " " << _("fps");
}
return s.str ();