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

Unified Diff: media/filters/chunk_demuxer.cc

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/chunk_demuxer.cc
diff --git a/media/filters/chunk_demuxer.cc b/media/filters/chunk_demuxer.cc
index 72c7ef43e5c772dab9759c09a5bee78601370f0e..13532c0f73e3a0aa98c19f3df30dfe6b15471bfb 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -165,7 +165,7 @@ class SourceState {
// Sets the memory limit on each stream of a specific type.
// |memory_limit| is the maximum number of bytes each stream of type |type|
// is allowed to hold in its buffer.
- void SetMemoryLimits(DemuxerStream::Type type, int memory_limit);
+ void SetMemoryLimits(DemuxerStream::Type type, size_t memory_limit);
bool IsSeekWaitingForData() const;
private:
@@ -513,20 +513,21 @@ void SourceState::Shutdown() {
}
}
-void SourceState::SetMemoryLimits(DemuxerStream::Type type, int memory_limit) {
+void SourceState::SetMemoryLimits(DemuxerStream::Type type,
+ size_t memory_limit) {
switch (type) {
case DemuxerStream::AUDIO:
if (audio_)
- audio_->set_memory_limit(memory_limit);
+ audio_->SetMemoryLimit(memory_limit);
break;
case DemuxerStream::VIDEO:
if (video_)
- video_->set_memory_limit(memory_limit);
+ video_->SetMemoryLimit(memory_limit);
break;
case DemuxerStream::TEXT:
for (TextStreamMap::iterator itr = text_stream_map_.begin();
itr != text_stream_map_.end(); ++itr) {
- itr->second->set_memory_limit(memory_limit);
+ itr->second->SetMemoryLimit(memory_limit);
}
break;
case DemuxerStream::UNKNOWN:
@@ -1025,6 +1026,10 @@ TextTrackConfig ChunkDemuxerStream::text_track_config() {
return stream_->GetCurrentTextTrackConfig();
}
+void ChunkDemuxerStream::SetMemoryLimit(size_t memory_limit) {
+ stream_->SetMemoryLimit(memory_limit);
+}
+
void ChunkDemuxerStream::SetLiveness(Liveness liveness) {
base::AutoLock auto_lock(lock_);
liveness_ = liveness;
@@ -1587,7 +1592,8 @@ void ChunkDemuxer::Shutdown() {
base::ResetAndReturn(&seek_cb_).Run(PIPELINE_ERROR_ABORT);
}
-void ChunkDemuxer::SetMemoryLimits(DemuxerStream::Type type, int memory_limit) {
+void ChunkDemuxer::SetMemoryLimits(DemuxerStream::Type type,
+ size_t memory_limit) {
for (SourceStateMap::iterator itr = source_state_map_.begin();
itr != source_state_map_.end(); ++itr) {
itr->second->SetMemoryLimits(type, memory_limit);

Powered by Google App Engine
This is Rietveld 408576698