#include "lib/image.h"
#include "lib/film.h"
#include "lib/dcp_video.h"
+#include "lib/player_video.h"
#include <dcp/locale_convert.h>
#include <dcp/openjpeg_image.h>
#include <wx/rawbmp.h>
#include <wx/graphics.h>
-#include <boost/bind.hpp>
+#include <boost/bind/bind.hpp>
#include <iostream>
using std::cout;
using std::min;
using std::max;
using std::string;
-using boost::weak_ptr;
-using boost::shared_ptr;
+using std::weak_ptr;
+using std::shared_ptr;
+#if BOOST_VERSION >= 106100
+using namespace boost::placeholders;
+#endif
using dcp::locale_convert;
+
int const VideoWaveformPlot::_vertical_margin = 8;
int const VideoWaveformPlot::_pixel_values = 4096;
int const VideoWaveformPlot::_x_axis_width = 52;
+
VideoWaveformPlot::VideoWaveformPlot (wxWindow* parent, weak_ptr<const Film> film, weak_ptr<FilmViewer> viewer)
: wxPanel (parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE)
, _film (film)
}
void
-VideoWaveformPlot::set_image (weak_ptr<PlayerVideo> image)
+VideoWaveformPlot::set_image (shared_ptr<PlayerVideo> image)
{
if (!_enabled) {
return;
}
- shared_ptr<PlayerVideo> pv = image.lock ();
- _image = DCPVideo::convert_to_xyz (pv, boost::bind (¬e));
+ /* We must copy the PlayerVideo here as we will call ::image() on it, potentially
+ with a different pixel_format than was used when ::prepare() was called.
+ */
+ _image = DCPVideo::convert_to_xyz (image->shallow_copy(), boost::bind(¬e));
_dirty = true;
Refresh ();
}