return ()
else:
return (('ffmpeg-cdist', '0d76267f36cbf01acd6a2a96ad2f7497a1843862'),
- ('libdcp', 'ee5e932cf0afa1ce24ea5eb0f298be8009cd9689'))
+ ('libdcp', '7b8313c73082cc08b4dc42dc86d0c90a578993b1'))
def build(target):
cmd = './waf configure --prefix=%s' % target.work_dir_cscript()
* @param l Log to write to.
*/
DCPVideoFrame::DCPVideoFrame (
- shared_ptr<const Image> image, int f, Eyes eyes, int dcp_fps, int bw, shared_ptr<Log> l
+ shared_ptr<const Image> image, int f, Eyes eyes, ColourConversion c, int dcp_fps, int bw, shared_ptr<Log> l
)
: _image (image)
, _frame (f)
, _eyes (eyes)
+ , _conversion (c)
, _frames_per_second (dcp_fps)
, _j2k_bandwidth (bw)
, _log (l)
shared_ptr<EncodedData>
DCPVideoFrame::encode_locally ()
{
+ shared_ptr<libdcp::LUT> in_lut;
+ if (_conversion.input_gamma_linearised) {
+ in_lut = libdcp::SRGBLinearisedGammaLUT::cache.get (12, _conversion.input_gamma);
+ } else {
+ in_lut = libdcp::GammaLUT::cache.get (12, _conversion.input_gamma);
+ }
+
+ /* XXX: libdcp should probably use boost */
+
+ double matrix[3][3];
+ for (int i = 0; i < 3; ++i) {
+ for (int j = 0; j < 3; ++j) {
+ matrix[i][j] = _conversion.matrix (i, j);
+ }
+ }
+
shared_ptr<libdcp::XYZFrame> xyz = libdcp::rgb_to_xyz (
_image,
- libdcp::SRGBLinearisedGammaLUT::cache.get (12, 2.4),
- libdcp::GammaLUT::cache.get (16, 1 / 2.6),
- libdcp::colour_matrix::srgb_to_xyz
+ in_lut,
+ libdcp::GammaLUT::cache.get (16, 1 / _conversion.output_gamma),
+ matrix
);
/* Set the max image and component sizes based on frame_rate */
socket->connect (*endpoint_iterator);
+ /* XXX: colour conversion! */
+
stringstream s;
s << "encode please\n"
<< "width " << _image->size().width << "\n"
class DCPVideoFrame : public boost::noncopyable
{
public:
- DCPVideoFrame (boost::shared_ptr<const Image>, int, Eyes, int, int, boost::shared_ptr<Log>);
+ DCPVideoFrame (boost::shared_ptr<const Image>, int, Eyes, ColourConversion, int, int, boost::shared_ptr<Log>);
boost::shared_ptr<EncodedData> encode_locally ();
boost::shared_ptr<EncodedData> encode_remotely (ServerDescription);
boost::shared_ptr<const Image> _image;
int _frame; ///< frame index within the DCP's intrinsic duration
Eyes _eyes;
+ ColourConversion _conversion;
int _frames_per_second; ///< Frames per second that we will use for the DCP
int _j2k_bandwidth; ///< J2K bandwidth to use
}
void
-Encoder::process_video (shared_ptr<const Image> image, Eyes eyes, bool same)
+Encoder::process_video (shared_ptr<const Image> image, Eyes eyes, ColourConversion conversion, bool same)
{
boost::mutex::scoped_lock lock (_mutex);
TIMING ("adding to queue of %1", _queue.size ());
_queue.push_back (shared_ptr<DCPVideoFrame> (
new DCPVideoFrame (
- image, _video_frames_out, eyes, _film->video_frame_rate(),
+ image, _video_frames_out, eyes, conversion, _film->video_frame_rate(),
_film->j2k_bandwidth(), _film->log()
)
));
* @param i Video frame image.
* @param same true if i is the same as the last time we were called.
*/
- void process_video (boost::shared_ptr<const Image> i, Eyes eyes, bool same);
+ void process_video (boost::shared_ptr<const Image> i, Eyes eyes, ColourConversion, bool same);
/** Call with some audio data */
void process_audio (boost::shared_ptr<const AudioBuffers>);
_last_video = piece->content;
#endif
- Video (work_image, eyes, same, time);
+ Video (work_image, eyes, content->colour_conversion(), same, time);
time += TIME_HZ / _film->video_frame_rate();
if (frc.repeat) {
- Video (work_image, eyes, true, time);
+ Video (work_image, eyes, content->colour_conversion(), true, time);
time += TIME_HZ / _film->video_frame_rate();
}
_last_video.reset ();
#endif
- Video (_black_frame, EYES_BOTH, _last_emit_was_black, _video_position);
+ Video (_black_frame, EYES_BOTH, ColourConversion(), _last_emit_was_black, _video_position);
_video_position += _film->video_frames_to_time (1);
_last_emit_was_black = true;
}
/** Emitted when a video frame is ready.
* First parameter is the video image.
* Second parameter is the eye(s) that should see this image.
- * Third parameter is true if the image is the same as the last one that was emitted.
- * Fourth parameter is the time.
+ * Third parameter is the colour conversion that should be used for this image.
+ * Fourth parameter is true if the image is the same as the last one that was emitted.
+ * Fifth parameter is the time.
*/
- boost::signals2::signal<void (boost::shared_ptr<const Image>, Eyes, bool, Time)> Video;
+ boost::signals2::signal<void (boost::shared_ptr<const Image>, Eyes, ColourConversion, bool, Time)> Video;
/** Emitted when some audio data is ready */
boost::signals2::signal<void (boost::shared_ptr<const AudioBuffers>, Time)> Audio;
image->read_from_socket (socket);
+ /* XXX: colour conversion... */
+
DCPVideoFrame dcp_video_frame (
- image, frame, eyes, frames_per_second, j2k_bandwidth, _log
+ image, frame, eyes, ColourConversion(), frames_per_second, j2k_bandwidth, _log
);
shared_ptr<EncodedData> encoded = dcp_video_frame.encode_locally ();
using boost::dynamic_pointer_cast;
static void
-video_proxy (weak_ptr<Encoder> encoder, shared_ptr<const Image> image, Eyes eyes, bool same)
+video_proxy (weak_ptr<Encoder> encoder, shared_ptr<const Image> image, Eyes eyes, ColourConversion conversion, bool same)
{
shared_ptr<Encoder> e = encoder.lock ();
if (e) {
- e->process_video (image, eyes, same);
+ e->process_video (image, eyes, conversion, same);
}
}
, _player (f->make_player ())
, _encoder (new Encoder (f, j))
{
- _player->Video.connect (bind (video_proxy, _encoder, _1, _2, _3));
+ _player->Video.connect (bind (video_proxy, _encoder, _1, _2, _3, _4));
_player->Audio.connect (bind (audio_proxy, _encoder, _1));
}
table->Add (_preset_choice);
overall_sizer->Add (table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
- overall_sizer->Add (new wxStaticLine (this, wxID_ANY));
+ overall_sizer->Add (new wxStaticLine (this, wxID_ANY), 0, wxEXPAND);
overall_sizer->Add (_editor);
wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
table->Add (_name);
overall_sizer->Add (table, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
- overall_sizer->Add (new wxStaticLine (this, wxID_ANY));
+ overall_sizer->Add (new wxStaticLine (this, wxID_ANY), 0, wxEXPAND);
overall_sizer->Add (_editor);
wxSizer* buttons = CreateSeparatedButtonSizer (wxOK);
image,
0,
EYES_BOTH,
+ ColourConversion (),
24,
200000000,
log