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

Unified Diff: media/filters/chunk_demuxer.cc

Issue 1171263004: Allow setting memory limits on media::DemuxerStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include logging.h for NOTIMPLEMENTED definition Created 5 years, 6 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 901fd4946bbbd1a5f68ce66729f3b192011aa21d..0d8b03d39a1cdbfcb282db8d80ef4bea23696457 100644
--- a/media/filters/chunk_demuxer.cc
+++ b/media/filters/chunk_demuxer.cc
@@ -163,10 +163,6 @@ class SourceState {
void MarkEndOfStream();
void UnmarkEndOfStream();
void Shutdown();
- // 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);
bool IsSeekWaitingForData() const;
private:
@@ -514,29 +510,6 @@ void SourceState::Shutdown() {
}
}
-void SourceState::SetMemoryLimits(DemuxerStream::Type type, int memory_limit) {
- switch (type) {
- case DemuxerStream::AUDIO:
- if (audio_)
- audio_->set_memory_limit(memory_limit);
- break;
- case DemuxerStream::VIDEO:
- if (video_)
- video_->set_memory_limit(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);
- }
- break;
- case DemuxerStream::UNKNOWN:
- case DemuxerStream::NUM_TYPES:
- NOTREACHED();
- break;
- }
-}
-
bool SourceState::IsSeekWaitingForData() const {
if (audio_ && audio_->IsSeekWaitingForData())
return true;
@@ -1020,6 +993,14 @@ VideoRotation ChunkDemuxerStream::video_rotation() {
return VIDEO_ROTATION_0;
}
+int ChunkDemuxerStream::GetMemoryLimit() const {
+ return stream_->GetMemoryLimit();
+}
+
+void ChunkDemuxerStream::SetMemoryLimit(int memory_limit) {
+ stream_->SetMemoryLimit(memory_limit);
+}
+
TextTrackConfig ChunkDemuxerStream::text_track_config() {
CHECK_EQ(type_, TEXT);
base::AutoLock auto_lock(lock_);
@@ -1584,13 +1565,6 @@ void ChunkDemuxer::Shutdown() {
base::ResetAndReturn(&seek_cb_).Run(PIPELINE_ERROR_ABORT);
}
-void ChunkDemuxer::SetMemoryLimits(DemuxerStream::Type type, int memory_limit) {
- for (SourceStateMap::iterator itr = source_state_map_.begin();
- itr != source_state_map_.end(); ++itr) {
- itr->second->SetMemoryLimits(type, memory_limit);
- }
-}
-
void ChunkDemuxer::ChangeState_Locked(State new_state) {
lock_.AssertAcquired();
DVLOG(1) << "ChunkDemuxer::ChangeState_Locked() : "

Powered by Google App Engine
This is Rietveld 408576698