summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2016-05-12 00:18:18 +0100
committerCarl Hetherington <cth@carlh.net>2016-05-12 00:18:18 +0100
commit631f905234537d2b0a24e9b3ff40f08a17c0fd8b (patch)
treedc60d31714e5201028d679b41bef6c5658681a02 /src/wx
parent396cddb7c112aedc80a106a785083aea05b8b741 (diff)
Optimise image scaling for the preview.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/film_viewer.cc16
-rw-r--r--src/wx/video_waveform_plot.cc2
2 files changed, 6 insertions, 12 deletions
diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc
index 9564c0fc9..2ae9bc1dd 100644
--- a/src/wx/film_viewer.cc
+++ b/src/wx/film_viewer.cc
@@ -153,6 +153,7 @@ FilmViewer::set_film (shared_ptr<Film> film)
try {
_player.reset (new Player (_film, _film->playlist ()));
+ _player->set_fast ();
} catch (bad_alloc) {
error_dialog (this, _("There is not enough free memory to do that."));
_film.reset ();
@@ -220,19 +221,12 @@ FilmViewer::get (DCPTime p, bool accurate)
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);
+ _frame = pv->image (
+ bind (&Log::dcp_log, _film->log().get(), _1, _2), bind (&PlayerVideo::always_rgb, _1), false, true
+ );
- dcp::YUVToRGB yuv_to_rgb = dcp::YUV_TO_RGB_REC601;
- if (pv->colour_conversion()) {
- yuv_to_rgb = pv->colour_conversion().get().yuv_to_rgb();
- }
+ ImageChanged (pv);
- _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 ();
diff --git a/src/wx/video_waveform_plot.cc b/src/wx/video_waveform_plot.cc
index 0dedd9bb1..357b2ca0c 100644
--- a/src/wx/video_waveform_plot.cc
+++ b/src/wx/video_waveform_plot.cc
@@ -166,7 +166,7 @@ VideoWaveformPlot::create_waveform ()
_waveform = _waveform->scale (
dcp::Size (GetSize().GetWidth() - 32, GetSize().GetHeight() - _vertical_margin * 2),
- dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, false
+ dcp::YUV_TO_RGB_REC709, AV_PIX_FMT_RGB24, false, true
);
}