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

Unified Diff: media/filters/source_buffer_stream.h

Issue 1235403002: Change ChunkDemuxerStream/SourceBufferStream memory limit to size_t type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A few more DCHECKs Created 5 years, 5 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
Index: media/filters/source_buffer_stream.h
diff --git a/media/filters/source_buffer_stream.h b/media/filters/source_buffer_stream.h
index afef6f74202dc025ad202083a4a2dcca842c3d22..0a96a0bdb464a877be14d486c0fa226808440257 100644
--- a/media/filters/source_buffer_stream.h
+++ b/media/filters/source_buffer_stream.h
@@ -16,6 +16,7 @@
#include <utility>
#include <vector>
+#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "media/base/audio_decoder_config.h"
#include "media/base/media_export.h"
@@ -142,9 +143,7 @@ class MEDIA_EXPORT SourceBufferStream {
// yet.
base::TimeDelta GetMaxInterbufferDistance() const;
- void set_memory_limit(int memory_limit) {
- memory_limit_ = memory_limit;
- }
+ void SetMemoryLimit(size_t memory_limit);
ddorwin 2015/07/20 21:23:57 If all this does is set a member variable, then th
servolk 2015/07/22 19:02:11 Done.
private:
friend class SourceBufferStreamTest;
@@ -156,21 +155,21 @@ class MEDIA_EXPORT SourceBufferStream {
// |ranges_|, starting at the front of |ranges_| and moving linearly forward
// through the buffers. Deletes starting from the back if |reverse_direction|
// is true. Returns the number of bytes freed.
- int FreeBuffers(int total_bytes_to_free, bool reverse_direction);
+ size_t FreeBuffers(size_t total_bytes_to_free, bool reverse_direction);
// Attempts to delete approximately |total_bytes_to_free| amount of data from
// |ranges_|, starting after the last appended buffer before the current
// playback position.
- int FreeBuffersAfterLastAppended(int total_bytes_to_free);
+ size_t FreeBuffersAfterLastAppended(size_t total_bytes_to_free);
// Gets the removal range to secure |byte_to_free| from
// [|start_timestamp|, |end_timestamp|).
// Returns the size of buffers to secure if future
// Remove(|start_timestamp|, |removal_end_timestamp|, duration) is called.
// Will not update |removal_end_timestamp| if the returned size is 0.
- int GetRemovalRange(DecodeTimestamp start_timestamp,
- DecodeTimestamp end_timestamp, int byte_to_free,
- DecodeTimestamp* removal_end_timestamp);
+ size_t GetRemovalRange(DecodeTimestamp start_timestamp,
+ DecodeTimestamp end_timestamp, size_t byte_to_free,
+ DecodeTimestamp* removal_end_timestamp);
// Prepares |range_for_next_append_| so |new_buffers| can be appended.
// This involves removing buffers between the end of the previous append
@@ -396,7 +395,7 @@ class MEDIA_EXPORT SourceBufferStream {
base::TimeDelta max_interbuffer_distance_;
// The maximum amount of data in bytes the stream will keep in memory.
- int memory_limit_;
+ size_t memory_limit_;
// Indicates that a kConfigChanged status has been reported by GetNextBuffer()
// and GetCurrentXXXDecoderConfig() must be called to update the current

Powered by Google App Engine
This is Rietveld 408576698