- _frame = pvf.front()->image (PIX_FMT_RGB24, true);
- _frame = _frame->scale (_frame->size(), Scaler::from_id ("fastbilinear"), PIX_FMT_RGB24, false);
- _position = pvf.front()->time ();
- _inter_position = pvf.front()->inter_position ();
- _inter_size = pvf.front()->inter_size ();
+ shared_ptr<PlayerVideo> pv;
+ if (all_pv.size() == 2) {
+ /* We have 3D; choose the correct eye */
+ if (_left_eye->GetValue()) {
+ if (all_pv.front()->eyes() == EYES_LEFT) {
+ pv = all_pv.front();
+ } else {
+ pv = all_pv.back();
+ }
+ } else {
+ if (all_pv.front()->eyes() == EYES_RIGHT) {
+ pv = all_pv.front();
+ } else {
+ pv = all_pv.back();
+ }
+ }
+ } else {
+ /* 2D; no choice to make */
+ pv = all_pv.front ();
+ }
+
+ /* XXX: this could now give us a 48-bit image, which is a bit wasteful,
+ or a XYZ image, which the code below will currently rely on FFmpeg
+ to colourspace-convert.
+ */
+ _frame = pv->image (boost::bind (&Log::dcp_log, _film->log().get(), _1, _2));
+ ImageChanged (pv);
+
+ dcp::YUVToRGB yuv_to_rgb = dcp::YUV_TO_RGB_REC601;
+ if (pv->colour_conversion()) {
+ yuv_to_rgb = pv->colour_conversion().get().yuv_to_rgb();
+ }
+
+ _frame = _frame->scale (_frame->size(), yuv_to_rgb, AV_PIX_FMT_RGB24, false);
+ _position = pv->time ();
+ _inter_position = pv->inter_position ();
+ _inter_size = pv->inter_size ();