Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(735)

Unified Diff: media/base/decoder_buffer_queue.h

Issue 164233005: Cap the memory usage in FFMpegDemuxer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert to IsMaxMemoryUsage api style in FFMpegDemuxer. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/decoder_buffer_queue.cc » ('j') | media/base/decoder_buffer_queue.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/decoder_buffer_queue.h
diff --git a/media/base/decoder_buffer_queue.h b/media/base/decoder_buffer_queue.h
index 938db63123e5523135bfcd529907114a3799c908..ebc5ab7c7f1ef9894c1af04018f2bf6d5e3ce7de 100644
--- a/media/base/decoder_buffer_queue.h
+++ b/media/base/decoder_buffer_queue.h
@@ -51,6 +51,9 @@ class MEDIA_EXPORT DecoderBufferQueue {
// Returns zero if the queue is empty.
base::TimeDelta Duration();
+ // Returns the total size of buffers inside the queue.
+ int data_size() const { return data_size_; }
DaleCurtis 2014/02/19 18:59:25 I'd just make this a size_t to minimize the CHECKs
damienv1 2014/02/19 19:21:10 I agree that size_t should have been used in a fir
+
private:
typedef std::deque<scoped_refptr<DecoderBuffer> > Queue;
Queue queue_;
@@ -62,6 +65,9 @@ class MEDIA_EXPORT DecoderBufferQueue {
base::TimeDelta earliest_valid_timestamp_;
+ // Total size in bytes of buffers in the queue.
+ int data_size_;
+
DISALLOW_COPY_AND_ASSIGN(DecoderBufferQueue);
};
« no previous file with comments | « no previous file | media/base/decoder_buffer_queue.cc » ('j') | media/base/decoder_buffer_queue.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698