diff options
Diffstat (limited to 'src/lib/video_ring_buffers.cc')
| -rw-r--r-- | src/lib/video_ring_buffers.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/video_ring_buffers.cc b/src/lib/video_ring_buffers.cc index a8688a1cd..2fc39d53c 100644 --- a/src/lib/video_ring_buffers.cc +++ b/src/lib/video_ring_buffers.cc @@ -20,6 +20,7 @@ #include "video_ring_buffers.h" #include "player_video.h" +#include "compose.hpp" #include <boost/foreach.hpp> #include <list> #include <iostream> @@ -28,6 +29,7 @@ using std::list; using std::make_pair; using std::cout; using std::pair; +using std::string; using boost::shared_ptr; using boost::optional; @@ -81,3 +83,13 @@ VideoRingBuffers::earliest () const return _data.front().second; } + +pair<size_t, string> +VideoRingBuffers::memory_used () const +{ + size_t m = 0; + for (list<pair<shared_ptr<PlayerVideo>, DCPTime> >::const_iterator i = _data.begin(); i != _data.end(); ++i) { + m += i->first->memory_used(); + } + return make_pair(m, String::compose("%1 frames", _data.size())); +} |
