OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_BASE_DECODER_BUFFER_QUEUE_H_ | 5 #ifndef MEDIA_BASE_DECODER_BUFFER_QUEUE_H_ |
6 #define MEDIA_BASE_DECODER_BUFFER_QUEUE_H_ | 6 #define MEDIA_BASE_DECODER_BUFFER_QUEUE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 | 35 |
36 // Pops a DecoderBuffer from the front of the queue. | 36 // Pops a DecoderBuffer from the front of the queue. |
37 // | 37 // |
38 // It is invalid to call Pop() on an empty queue. | 38 // It is invalid to call Pop() on an empty queue. |
39 scoped_refptr<DecoderBuffer> Pop(); | 39 scoped_refptr<DecoderBuffer> Pop(); |
40 | 40 |
41 // Removes all queued buffers. | 41 // Removes all queued buffers. |
42 void Clear(); | 42 void Clear(); |
43 | 43 |
44 // Returns true if this queue is empty. | 44 // Returns true if this queue is empty. |
45 bool IsEmpty(); | 45 bool IsEmpty() const; |
46 | 46 |
47 // Returns the duration of encoded data stored in this queue as measured by | 47 // Returns the duration of encoded data stored in this queue as measured by |
48 // the timestamps of the earliest and latest buffers, ignoring out of order | 48 // the timestamps of the earliest and latest buffers, ignoring out of order |
49 // buffers. | 49 // buffers. |
50 // | 50 // |
51 // Returns zero if the queue is empty. | 51 // Returns zero if the queue is empty. |
52 base::TimeDelta Duration(); | 52 base::TimeDelta Duration(); |
53 | 53 |
54 // Returns the total size of buffers inside the queue. | 54 // Returns the total size of buffers inside the queue. |
55 size_t data_size() const { return data_size_; } | 55 size_t data_size() const { return data_size_; } |
(...skipping 11 matching lines...) Expand all Loading... |
67 | 67 |
68 // Total size in bytes of buffers in the queue. | 68 // Total size in bytes of buffers in the queue. |
69 size_t data_size_; | 69 size_t data_size_; |
70 | 70 |
71 DISALLOW_COPY_AND_ASSIGN(DecoderBufferQueue); | 71 DISALLOW_COPY_AND_ASSIGN(DecoderBufferQueue); |
72 }; | 72 }; |
73 | 73 |
74 } // namespace media | 74 } // namespace media |
75 | 75 |
76 #endif // MEDIA_BASE_DECODER_BUFFER_QUEUE_H_ | 76 #endif // MEDIA_BASE_DECODER_BUFFER_QUEUE_H_ |
OLD | NEW |