#include "upload_job.h"
#include "null_log.h"
#include "file_log.h"
+#include "dcpomatic_log.h"
#include "exceptions.h"
#include "examine_content_job.h"
#include "config.h"
using boost::is_any_of;
using dcp::raw_convert;
-#define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), LogEntry::TYPE_GENERAL);
-#define LOG_GENERAL_NC(...) log()->log (__VA_ARGS__, LogEntry::TYPE_GENERAL);
-
string const Film::metadata_file = "metadata.xml";
/* 5 -> 6
, _reel_type (REELTYPE_SINGLE)
, _reel_length (2000000000)
, _upload_after_make_dcp (Config::instance()->default_upload_after_make_dcp())
+ , _reencode_j2k (false)
, _state_version (current_state_version)
, _dirty (false)
{
root->add_child("ReelType")->add_child_text (raw_convert<string> (static_cast<int> (_reel_type)));
root->add_child("ReelLength")->add_child_text (raw_convert<string> (_reel_length));
root->add_child("UploadAfterMakeDCP")->add_child_text (_upload_after_make_dcp ? "1" : "0");
+ root->add_child("ReencodeJ2K")->add_child_text (_reencode_j2k ? "1" : "0");
_playlist->as_xml (root->add_child ("Playlist"), with_content_paths);
return doc;
_reel_type = static_cast<ReelType> (f.optional_number_child<int>("ReelType").get_value_or (static_cast<int>(REELTYPE_SINGLE)));
_reel_length = f.optional_number_child<int64_t>("ReelLength").get_value_or (2000000000);
_upload_after_make_dcp = f.optional_bool_child("UploadAfterMakeDCP").get_value_or (false);
+ _reencode_j2k = f.optional_bool_child("ReencodeJ2K").get_value_or(false);
list<string> notes;
/* This method is the only one that can return notes (so far) */
_upload_after_make_dcp = u;
}
+void
+Film::set_reencode_j2k (bool r)
+{
+ ChangeSignaller<Film> ch (this, REENCODE_J2K);
+ _reencode_j2k = r;
+}
+
void
Film::signal_change (ChangeType type, int p)
{
/* We want to call Playlist::maybe_sequence but this must happen after the
main signal emission (since the butler will see that emission and un-suspend itself).
*/
- emit (boost::bind(&Playlist::maybe_sequence, _playlist.get()));
+ emit (boost::bind(&Playlist::maybe_sequence, _playlist.get(), shared_from_this()));
}
} else {
Change (type, p);
Film::examine_and_add_content (shared_ptr<Content> content, bool disable_audio_analysis)
{
if (dynamic_pointer_cast<FFmpegContent> (content) && _directory) {
- run_ffprobe (content->path(0), file ("ffprobe.log"), _log);
+ run_ffprobe (content->path(0), file("ffprobe.log"));
}
shared_ptr<Job> j (new ExamineContentJob (shared_from_this(), content));
if (Config::instance()->automatic_audio_analysis() && content->audio && !disable_audio_analysis) {
shared_ptr<Playlist> playlist (new Playlist);
- playlist->add (content);
+ playlist->add (shared_from_this(), content);
boost::signals2::connection c;
JobManager::instance()->analyse_audio (
shared_from_this(), playlist, false, c, bind (&Film::audio_analysis_finished, this)
{
/* Add {video,subtitle} content after any existing {video,subtitle} content */
if (c->video) {
- c->set_position (_playlist->video_end());
+ c->set_position (shared_from_this(), _playlist->video_end(shared_from_this()));
} else if (!c->text.empty()) {
- c->set_position (_playlist->text_end());
+ c->set_position (shared_from_this(), _playlist->text_end(shared_from_this()));
}
if (_template_film) {
}
}
- _playlist->add (c);
+ _playlist->add (shared_from_this(), c);
}
void
void
Film::move_content_earlier (shared_ptr<Content> c)
{
- _playlist->move_earlier (c);
+ _playlist->move_earlier (shared_from_this(), c);
}
void
Film::move_content_later (shared_ptr<Content> c)
{
- _playlist->move_later (c);
+ _playlist->move_later (shared_from_this(), c);
}
/** @return length of the film from time 0 to the last thing on the playlist */
DCPTime
Film::length () const
{
- return _playlist->length().ceil(video_frame_rate());
+ return _playlist->length(shared_from_this()).ceil(video_frame_rate());
}
int
}
/** @param recipient KDM recipient certificate.
- * @param trusted_devices Certificates of other trusted devices (can be empty).
+ * @param trusted_devices Certificate thumbprints of other trusted devices (can be empty).
* @param cpl_file CPL filename.
* @param from KDM from time expressed as a local time with an offset from UTC.
* @param until KDM to time expressed as a local time with an offset from UTC.
dcp::EncryptedKDM
Film::make_kdm (
dcp::Certificate recipient,
- vector<dcp::Certificate> trusted_devices,
+ vector<string> trusted_devices,
boost::filesystem::path cpl_file,
dcp::LocalTime from,
dcp::LocalTime until,
if (i->recipient) {
dcp::EncryptedKDM const kdm = make_kdm (
i->recipient.get(),
- i->trusted_devices,
+ i->trusted_device_thumbprints(),
cpl_file,
dcp::LocalTime (from, i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()),
dcp::LocalTime (until, i->cinema->utc_offset_hour(), i->cinema->utc_offset_minute()),
uint64_t
Film::required_disk_space () const
{
- return _playlist->required_disk_space (j2k_bandwidth(), audio_channels(), audio_frame_rate());
+ return _playlist->required_disk_space (shared_from_this(), j2k_bandwidth(), audio_channels(), audio_frame_rate());
}
/** This method checks the disk that the Film is on and tries to decide whether or not
void
Film::repeat_content (ContentList c, int n)
{
- _playlist->repeat (c, n);
+ _playlist->repeat (shared_from_this(), c, n);
}
void
}
}
- DCPTime video_end = last_video ? last_video->end() : DCPTime(0);
+ DCPTime video_end = last_video ? last_video->end(shared_from_this()) : DCPTime(0);
if (last_split) {
/* Definitely go from the last split to the end of the video content */
p.push_back (DCPTimePeriod (last_split.get(), video_end));
string
Film::content_summary (DCPTimePeriod period) const
{
- return _playlist->content_summary (period);
+ return _playlist->content_summary (shared_from_this(), period);
}
void