ffmpeg_options = {}
return (('ffmpeg-cdist', '1d4a1a4', ffmpeg_options),
- ('libdcp', '7e9ad08'),
+ ('libdcp', 'f3fb557'),
('libsub', '067c21c'))
def configure_options(target):
/*
- 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.
int const ReelWriter::_info_size = 48;
-ReelWriter::ReelWriter (shared_ptr<const Film> film, DCPTimePeriod period, shared_ptr<Job> job)
+ReelWriter::ReelWriter (shared_ptr<const Film> film, DCPTimePeriod period, shared_ptr<Job> job, int reel_index, int reel_count)
: _film (film)
, _period (period)
, _first_nonexistant_frame (0)
, _last_written_video_frame (-1)
, _last_written_eyes (EYES_RIGHT)
, _total_written_audio_frames (0)
+ , _reel_index (reel_index)
+ , _reel_count (reel_count)
{
/* Create our picture asset in a subdirectory, named according to those
film's parameters which affect the video output. We will hard-link
of the DCP directory until the last minute.
*/
_sound_asset_writer = _sound_asset->start_write (
- _film->directory() / audio_asset_filename (_sound_asset),
+ _film->directory() / audio_asset_filename (_sound_asset, _reel_index, _reel_count),
_film->interop() ? dcp::INTEROP : dcp::SMPTE
);
}
boost::filesystem::path video_from = _picture_asset->file ();
boost::filesystem::path video_to;
video_to /= _film->dir (_film->dcp_name());
- video_to /= video_asset_filename (_picture_asset);
+ video_to /= video_asset_filename (_picture_asset, _reel_index, _reel_count);
boost::system::error_code ec;
boost::filesystem::create_hard_link (video_from, video_to, ec);
if (_sound_asset) {
boost::filesystem::path audio_to;
audio_to /= _film->dir (_film->dcp_name ());
- audio_to /= audio_asset_filename (_sound_asset);
+ string const aaf = audio_asset_filename (_sound_asset, _reel_index, _reel_count);
+ audio_to /= aaf;
boost::system::error_code ec;
- boost::filesystem::rename (_film->file (audio_asset_filename (_sound_asset)), audio_to, ec);
+ boost::filesystem::rename (_film->file (aaf), audio_to, ec);
if (ec) {
throw FileError (
- String::compose (_("could not move audio asset into the DCP (%1)"), ec.value ()), audio_asset_filename (_sound_asset)
+ String::compose (_("could not move audio asset into the DCP (%1)"), ec.value ()), aaf
);
}
class ReelWriter
{
public:
- ReelWriter (boost::shared_ptr<const Film> film, DCPTimePeriod period, boost::shared_ptr<Job> job);
+ ReelWriter (boost::shared_ptr<const Film> film, DCPTimePeriod period, boost::shared_ptr<Job> job, int reel_index, int reel_count);
void write (boost::optional<dcp::Data> encoded, Frame frame, Eyes eyes);
void fake_write (Frame frame, Eyes eyes, int size);
Eyes _last_written_eyes;
/** the number of audio frames that have been written to the reel */
int _total_written_audio_frames;
+ /** index of this reel within the DCP (starting from 0) */
+ int _reel_index;
+ /** number of reels in the DCP */
+ int _reel_count;
boost::shared_ptr<dcp::PictureAsset> _picture_asset;
boost::shared_ptr<dcp::PictureAssetWriter> _picture_asset_writer;
}
string
-video_asset_filename (shared_ptr<dcp::PictureAsset> asset)
+video_asset_filename (shared_ptr<dcp::PictureAsset> asset, int reel_index, int reel_count)
{
dcp::NameFormat::Map values;
values['t'] = "j2c";
values['i'] = asset->id();
+ values['r'] = raw_convert<string> (reel_index + 1);
+ values['n'] = raw_convert<string> (reel_count);
return Config::instance()->dcp_filename_format().get(values) + ".mxf";
}
string
-audio_asset_filename (shared_ptr<dcp::SoundAsset> asset)
+audio_asset_filename (shared_ptr<dcp::SoundAsset> asset, int reel_index, int reel_count)
{
dcp::NameFormat::Map values;
values['t'] = "pcm";
values['i'] = asset->id();
+ values['r'] = raw_convert<string> (reel_index + 1);
+ values['n'] = raw_convert<string> (reel_count);
return Config::instance()->dcp_filename_format().get(values) + ".mxf";
}
extern void* wrapped_av_malloc (size_t);
extern void set_backtrace_file (boost::filesystem::path);
extern std::map<std::string, std::string> split_get_request (std::string url);
-extern std::string video_asset_filename (boost::shared_ptr<dcp::PictureAsset> asset);
-extern std::string audio_asset_filename (boost::shared_ptr<dcp::SoundAsset> asset);
+extern std::string video_asset_filename (boost::shared_ptr<dcp::PictureAsset> asset, int reel_index, int reel_count);
+extern std::string audio_asset_filename (boost::shared_ptr<dcp::SoundAsset> asset, int reel_index, int reel_count);
extern float relaxed_string_to_float (std::string);
extern bool string_not_empty (std::string);
shared_ptr<Job> job = _job.lock ();
DCPOMATIC_ASSERT (job);
- BOOST_FOREACH (DCPTimePeriod p, _film->reels ()) {
- _reels.push_back (ReelWriter (film, p, job));
+ int reel_index = 0;
+ list<DCPTimePeriod> const reels = _film->reels ();
+ BOOST_FOREACH (DCPTimePeriod p, reels) {
+ _reels.push_back (ReelWriter (film, p, job, reel_index++, reels.size()));
}
/* We can keep track of the current audio and subtitle reels easily because audio
dcp::NameFormat::Map titles;
titles['t'] = "type (j2c/pcm/sub/cpl/pkl)";
titles['i'] = "unique ID";
+ titles['r'] = "reel number";
+ titles['n'] = "number of reels";
dcp::NameFormat::Map examples;
examples['t'] = "j2c";
examples['i'] = "eb1c112c-ca3c-4ae6-9263-c6714ff05d64";
+ examples['r'] = "1";
+ examples['n'] = "4";
_dcp_filename_format = new NameFormatEditor<dcp::FilenameFormat> (_panel, Config::instance()->dcp_filename_format(), titles, examples);
table->Add (_dcp_filename_format->panel(), 1, wxEXPAND | wxALL);
wxString example = wxString::Format (_("e.g. %s"), _name.get (_examples));
wxString wrapped;
for (size_t i = 0; i < example.Length(); ++i) {
- if (i > 0 && (i % 30) == 0) {
+ if (i > 0 && (i % 40) == 0) {
wrapped += "\n";
}
wrapped += example[i];