, _playing (false)
, _suspended (0)
, _latency_history_count (0)
- , _dropped (0)
, _closed_captions_dialog (new ClosedCaptionsDialog(p, this))
, _outline_content (false)
, _eyes (EYES_LEFT)
_audio.startStream ();
}
- _dropped = 0;
_playing = true;
_video_view->start ();
Started (position());
emit (boost::bind(boost::ref(Finished)));
}
+int
+FilmViewer::dropped () const
+{
+ return _video_view->dropped ();
+}
+
void slow_refresh ();
- int dropped () const {
- return _dropped;
- }
+ int dropped () const;
int audio_callback (void* out, unsigned int frames);
mutable boost::mutex _latency_history_mutex;
int _latency_history_count;
- int _dropped;
boost::optional<int> _dcp_decode_reduction;
ClosedCaptionsDialog* _closed_captions_dialog;
void
GLVideoView::start ()
{
+ VideoView::start ();
+
boost::mutex::scoped_lock lm (_playing_mutex);
_playing = true;
_playing_condition.notify_all ();
while (time_until_next_frame() < 5) {
get_next_frame (true);
+ add_dropped ();
}
boost::this_thread::interruption_point ();
void
SimpleVideoView::start ()
{
+ VideoView::start ();
timer ();
}
/* Too late; just drop this frame before we try to get its image (which will be the time-consuming
part if this frame is J2K).
*/
- ++_viewer->_dropped;
+ add_dropped ();
return;
}
#include "film_viewer.h"
#include "lib/butler.h"
+VideoView::VideoView (FilmViewer* viewer)
+ : _viewer (viewer)
+#ifdef DCPOMATIC_VARIANT_SWAROOP
+ , _in_watermark (false)
+#endif
+ , _video_frame_rate (0)
+ , _dropped (0)
+{
+
+}
+
void
VideoView::clear ()
{
return (next.seconds() - time.seconds()) * 1000;
}
+void
+VideoView::start ()
+{
+ boost::mutex::scoped_lock lm (_mutex);
+ _dropped = 0;
+}
class VideoView
{
public:
- VideoView (FilmViewer* viewer)
- : _viewer (viewer)
-#ifdef DCPOMATIC_VARIANT_SWAROOP
- , _in_watermark (false)
-#endif
- , _video_frame_rate (0)
- {}
-
+ VideoView (FilmViewer* viewer);
virtual ~VideoView () {}
virtual void set_image (boost::shared_ptr<const Image> image) = 0;
*/
virtual void update () = 0;
- /* XXX_b: make pure */
- virtual void start () {}
+ virtual void start ();
/* XXX_b: make pure */
virtual void stop () {}
/* XXX_b: to remove */
virtual void display_player_video () {}
+ int dropped () const {
+ boost::mutex::scoped_lock lm (_mutex);
+ return _dropped;
+ }
+
dcpomatic::DCPTime position () const {
boost::mutex::scoped_lock lm (_mutex);
return _player_video.second;
return _player_video;
}
+ void add_dropped () {
+ boost::mutex::scoped_lock lm (_mutex);
+ ++_dropped;
+ }
+
FilmViewer* _viewer;
#ifdef DCPOMATIC_VARIANT_SWAROOP
int _video_frame_rate;
/** length of the film we are playing, or 0 if there is none */
dcpomatic::DCPTime _length;
+
+ int _dropped;
};
#endif