#include "options.h"
#include "imagemagick_decoder.h"
#include "film.h"
-#include "format.h"
using std::string;
using std::cout;
/** @param f Film we are making the DCP for.
* @param o Options.
*/
-MakeDCPJob::MakeDCPJob (shared_ptr<Film> f, shared_ptr<Job> req)
+MakeDCPJob::MakeDCPJob (shared_ptr<Film> f, shared_ptr<const EncodeOptions> o, shared_ptr<Job> req)
: Job (f, req)
+ , _opt (o)
{
}
string
MakeDCPJob::j2c_path (int f, int offset) const
{
- DCPFrameRate dfr (_film->frames_per_second());
- int const mult = dfr.skip ? 2 : 1;
- SourceFrame const s = ((f + offset) * mult) + _film->trim_start();
- return _film->frame_out_path (s, false);
+ SourceFrame const s = ((f + offset) * dcp_frame_rate(_film->frames_per_second()).skip) + _film->dcp_trim_start();
+ return _opt->frame_out_path (s, false);
}
string
MakeDCPJob::wav_path (libdcp::Channel c) const
{
- return _film->multichannel_audio_out_path (int (c), false);
+ return _opt->multichannel_audio_out_path (int (c), false);
}
void
/* Remove any old DCP */
boost::filesystem::remove_all (dcp_path);
- DCPFrameRate const dfr (_film->frames_per_second ());
+ DCPFrameRate const dfr = dcp_frame_rate (_film->frames_per_second ());
int frames = 0;
switch (_film->content_type ()) {
case VIDEO:
/* Source frames -> DCP frames */
- frames = _film->dcp_length().get();
- if (dfr.skip) {
- frames /= 2;
- }
+ frames = _film->dcp_length().get() / dfr.skip;
break;
case STILL:
frames = _film->still_duration() * 24;
&dcp.Progress,
dfr.frames_per_second,
this_time,
- _film->format()->dcp_size().width,
- _film->format()->dcp_size().height
+ _opt->out_size.width,
+ _opt->out_size.height,
+ _film->encrypted()
)
);
dfr.frames_per_second,
this_time,
frames_done,
- dcp_audio_channels (_film->audio_channels())
+ dcp_audio_channels (_film->audio_channels()),
+ _film->encrypted()
)
);
ascend ();