void
VideoRingBuffers::put (shared_ptr<PlayerVideo> frame, DCPTime time)
{
- cout << "put " << to_string(time) << "\n";
boost::mutex::scoped_lock lm (_mutex);
_data.push_back (make_pair (frame, time));
}
{
boost::mutex::scoped_lock lm (_mutex);
if (_data.empty ()) {
- cout << "get: no data.\n";
return make_pair(shared_ptr<PlayerVideo>(), DCPTime());
}
pair<shared_ptr<PlayerVideo>, DCPTime> const r = _data.front ();
- cout << "get: here we go! " << to_string(r.second) << "\n";
_data.pop_front ();
return r;
}
return _data.size ();
}
+bool
+VideoRingBuffers::empty () const
+{
+ boost::mutex::scoped_lock lm (_mutex);
+ return _data.empty ();
+}
+
void
VideoRingBuffers::clear ()
{
}
optional<DCPTime>
-VideoRingBuffers::latest () const
+VideoRingBuffers::earliest () const
{
boost::mutex::scoped_lock lm (_mutex);
if (_data.empty ()) {
return optional<DCPTime> ();
}
- return _data.back().second;
+ return _data.front().second;
}