#include "lib/log.h"
#include "film_viewer.h"
#include "wx_util.h"
+extern "C" {
+#include <libavutil/pixfmt.h>
+}
#include <dcp/exceptions.h>
#include <wx/tglbtn.h>
#include <iostream>
, _frame_number (new wxStaticText (this, wxID_ANY, wxT("")))
, _timecode (new wxStaticText (this, wxID_ANY, wxT("")))
, _play_button (new wxToggleButton (this, wxID_ANY, _("Play")))
+ , _coalesce_player_changes (false)
+ , _pending_player_change (false)
, _last_get_accurate (true)
{
#ifndef __WXOSX__
if (!pvf.empty ()) {
try {
- _frame = pvf.front()->image (PIX_FMT_RGB24, boost::bind (&Log::dcp_log, _film->log().get(), _1, _2));
+ /* 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 = pvf.front()->image (boost::bind (&Log::dcp_log, _film->log().get(), _1, _2));
ImageChanged (pvf.front ());
dcp::YUVToRGB yuv_to_rgb = dcp::YUV_TO_RGB_REC601;
yuv_to_rgb = pvf.front()->colour_conversion().get().yuv_to_rgb();
}
- _frame = _frame->scale (_frame->size(), yuv_to_rgb, PIX_FMT_RGB24, false);
+ _frame = _frame->scale (_frame->size(), yuv_to_rgb, AV_PIX_FMT_RGB24, false);
_position = pvf.front()->time ();
_inter_position = pvf.front()->inter_position ();
_inter_size = pvf.front()->inter_size ();
return;
}
+ if (_coalesce_player_changes) {
+ _pending_player_change = true;
+ return;
+ }
+
calculate_sizes ();
refresh ();
update_position_label ();
{
get (_position, _last_get_accurate);
}
+
+void
+FilmViewer::set_position (DCPTime p)
+{
+ _position = p;
+ get (_position, true);
+ update_position_label ();
+ update_position_slider ();
+}
+
+void
+FilmViewer::set_coalesce_player_changes (bool c)
+{
+ _coalesce_player_changes = c;
+
+ if (c) {
+ _pending_player_change = false;
+ } else {
+ if (_pending_player_change) {
+ player_changed (false);
+ }
+ }
+}