#include "audio_decoder.h"
#include "sndfile_decoder.h"
#include "analyse_audio_job.h"
+#include "cross.h"
#include "i18n.h"
using std::min;
using std::make_pair;
using std::endl;
+using std::list;
using boost::shared_ptr;
using boost::lexical_cast;
using boost::to_upper_copy;
Film::Film (string d, bool must_exist)
: _use_dci_name (true)
, _trust_content_header (true)
- , _dcp_content_type (0)
- , _format (0)
+ , _dcp_content_type (Config::instance()->default_dcp_content_type ())
+ , _format (Config::instance()->default_format ())
, _scaler (Scaler::from_id ("bicubic"))
, _trim_start (0)
, _trim_end (0)
if (must_exist) {
read_metadata ();
+ } else {
+ write_metadata ();
}
_log.reset (new FileLog (file ("log")));
Film::video_state_identifier () const
{
assert (format ());
+ LocaleGuard lg;
pair<string, string> f = Filter::ffmpeg_strings (filters());
<< "_" << j2k_bandwidth()
<< "_" << boost::lexical_cast<int> (colour_lut());
+ if (trim_type() == ENCODE) {
+ s << "_" << trim_start() << "_" << trim_end();
+ }
+
if (dcp_ab()) {
pair<string, string> fa = Filter::ffmpeg_strings (Config::instance()->reference_filters());
s << "ab_" << Config::instance()->reference_scaler()->id() << "_" << fa.first << "_" << fa.second;
#endif
pair<string, int> const c = cpu_info ();
log()->log (String::compose ("CPU: %1, %2 processors", c.first, c.second));
+ list<pair<string, string> > const m = mount_info ();
+ for (list<pair<string, string> >::const_iterator i = m.begin(); i != m.end(); ++i) {
+ log()->log (String::compose ("Mount: %1 %2", i->first, i->second));
+ }
if (format() == 0) {
throw MissingSettingError (_("format"));
Film::write_metadata () const
{
boost::mutex::scoped_lock lm (_state_mutex);
+ LocaleGuard lg;
boost::filesystem::create_directories (directory());
Film::read_metadata ()
{
boost::mutex::scoped_lock lm (_state_mutex);
+ LocaleGuard lg;
_external_audio.clear ();
_content_audio_streams.clear ();
_content = c;
}
+ /* Do this before we start using FFmpeg ourselves */
+ run_ffprobe (c, file ("ffprobe.log"), _log);
+
/* Reset streams here in case the new content doesn't have one or the other */
_content_audio_stream = shared_ptr<AudioStream> ();
_subtitle_stream = shared_ptr<SubtitleStream> ();
}
/* Default format */
- switch (content_type()) {
- case STILL:
- set_format (Format::from_id ("var-185"));
- break;
- case VIDEO:
- set_format (Format::from_id ("185"));
- break;
- }
+ set_format (Config::instance()->default_format ());
/* Still image DCPs must use external audio */
if (content_type() == STILL) {