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

Unified Diff: media/base/pipeline_impl.cc

Issue 8661002: Fire CanPlayThrough immediately for local and streaming media files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix media/event-attributes.html Created 9 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 side-by-side diff with in-line comments
Download patch
Index: media/base/pipeline_impl.cc
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index 386b064a96221aa8d344c5ad5e9dd74a7d9d92d1..7de0ee752d642e300dd1ffd5461ff47c45304324 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -251,7 +251,7 @@ base::TimeDelta PipelineImpl::GetBufferedTime() {
base::AutoLock auto_lock(lock_);
// If media is fully loaded, then return duration.
- if (loaded_ || total_bytes_ == buffered_bytes_) {
+ if (local_source_ || total_bytes_ == buffered_bytes_) {
max_buffered_time_ = duration_;
return duration_;
}
@@ -312,9 +312,9 @@ bool PipelineImpl::IsStreaming() const {
return streaming_;
}
-bool PipelineImpl::IsLoaded() const {
+bool PipelineImpl::IsLocalSource() const {
base::AutoLock auto_lock(lock_);
- return loaded_;
+ return local_source_;
}
PipelineStatistics PipelineImpl::GetStatistics() const {
@@ -358,7 +358,7 @@ void PipelineImpl::ResetState() {
buffered_time_ = kZero;
buffered_bytes_ = 0;
streaming_ = false;
- loaded_ = false;
+ local_source_ = false;
total_bytes_ = 0;
natural_size_.SetSize(0, 0);
volume_ = 1.0f;
@@ -555,6 +555,7 @@ void PipelineImpl::SetStreaming(bool streaming) {
base::AutoLock auto_lock(lock_);
streaming_ = streaming;
+ download_rate_monitor_.set_streaming(streaming_);
}
void PipelineImpl::NotifyEnded() {
@@ -564,17 +565,6 @@ void PipelineImpl::NotifyEnded() {
media_log_->AddEvent(media_log_->CreateEvent(MediaLogEvent::ENDED));
}
-void PipelineImpl::SetLoaded(bool loaded) {
- DCHECK(IsRunning());
- media_log_->AddEvent(
- media_log_->CreateBooleanEvent(
- MediaLogEvent::LOADED_SET, "loaded", loaded));
-
- base::AutoLock auto_lock(lock_);
- loaded_ = loaded;
- download_rate_monitor_.set_loaded(loaded_);
-}
-
void PipelineImpl::SetNetworkActivity(bool is_downloading_data) {
DCHECK(IsRunning());
@@ -1044,8 +1034,11 @@ void PipelineImpl::FilterStateTransitionTask() {
// Start monitoring rate of downloading.
int bitrate = 0;
- if (demuxer_.get())
+ if (demuxer_.get()) {
bitrate = demuxer_->GetBitrate();
+ local_source_ = demuxer_->IsLocalSource();
+ download_rate_monitor_.set_local_source(local_source_);
acolwell GONE FROM CHROMIUM 2011/11/30 19:26:11 Consider making local_source a parameter of the St
vrk (LEFT CHROMIUM) 2011/12/01 02:11:35 Done.
+ }
// Needs to be locked because most other calls to |download_rate_monitor_|
// occur on the renderer thread.
download_rate_monitor_.Start(

Powered by Google App Engine
This is Rietveld 408576698