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

Side by Side Diff: media/filters/chunk_demuxer.cc

Issue 1409123005: Add methods for telling V8 how much memory audio/video is using. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/ffmpeg_demuxer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "media/filters/chunk_demuxer.h" 5 #include "media/filters/chunk_demuxer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <list> 9 #include <list>
10 10
(...skipping 1292 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 if (type == DemuxerStream::AUDIO) 1303 if (type == DemuxerStream::AUDIO)
1304 return audio_.get(); 1304 return audio_.get();
1305 1305
1306 return NULL; 1306 return NULL;
1307 } 1307 }
1308 1308
1309 TimeDelta ChunkDemuxer::GetStartTime() const { 1309 TimeDelta ChunkDemuxer::GetStartTime() const {
1310 return TimeDelta(); 1310 return TimeDelta();
1311 } 1311 }
1312 1312
1313 int64_t ChunkDemuxer::GetMemoryUsage() const {
wolenetz 2015/10/24 00:51:34 While it would be interesting to see a machine tha
DaleCurtis 2015/10/24 00:55:55 I used int64_t since that's what v8 uses: https:/
1314 base::AutoLock auto_lock(lock_);
1315 return (audio_ ? audio_->GetBufferedSize() : 0) +
1316 (video_ ? video_->GetBufferedSize() : 0);
1317 }
1318
1313 void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) { 1319 void ChunkDemuxer::StartWaitingForSeek(TimeDelta seek_time) {
1314 DVLOG(1) << "StartWaitingForSeek()"; 1320 DVLOG(1) << "StartWaitingForSeek()";
1315 base::AutoLock auto_lock(lock_); 1321 base::AutoLock auto_lock(lock_);
1316 DCHECK(state_ == INITIALIZED || state_ == ENDED || state_ == SHUTDOWN || 1322 DCHECK(state_ == INITIALIZED || state_ == ENDED || state_ == SHUTDOWN ||
1317 state_ == PARSE_ERROR) << state_; 1323 state_ == PARSE_ERROR) << state_;
1318 DCHECK(seek_cb_.is_null()); 1324 DCHECK(seek_cb_.is_null());
1319 1325
1320 if (state_ == SHUTDOWN || state_ == PARSE_ERROR) 1326 if (state_ == SHUTDOWN || state_ == PARSE_ERROR)
1321 return; 1327 return;
1322 1328
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1958 } 1964 }
1959 1965
1960 void ChunkDemuxer::ShutdownAllStreams() { 1966 void ChunkDemuxer::ShutdownAllStreams() {
1961 for (SourceStateMap::iterator itr = source_state_map_.begin(); 1967 for (SourceStateMap::iterator itr = source_state_map_.begin();
1962 itr != source_state_map_.end(); ++itr) { 1968 itr != source_state_map_.end(); ++itr) {
1963 itr->second->Shutdown(); 1969 itr->second->Shutdown();
1964 } 1970 }
1965 } 1971 }
1966 1972
1967 } // namespace media 1973 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer.h ('k') | media/filters/ffmpeg_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698