summaryrefslogtreecommitdiffstats
path: root/media/base/pipeline.cc
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-11 02:27:27 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-11 02:27:27 +0000
commit8af0be9afba854ee87f4d61ed18450d4045ea0c1 (patch)
treeb0011dad5e2fab249717a79ee737df48d4de0e55 /media/base/pipeline.cc
parent38489a3a2315df408fd4205b8124aca91e66f853 (diff)
downloadchromium_src-8af0be9afba854ee87f4d61ed18450d4045ea0c1.zip
chromium_src-8af0be9afba854ee87f4d61ed18450d4045ea0c1.tar.gz
chromium_src-8af0be9afba854ee87f4d61ed18450d4045ea0c1.tar.bz2
Delete DownloadRateMonitor since it's never worked right.
(and it complicates other things I want to do) BUG=73609 Review URL: https://chromiumcodereview.appspot.com/10382109 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/pipeline.cc')
-rw-r--r--media/base/pipeline.cc43
1 files changed, 3 insertions, 40 deletions
diff --git a/media/base/pipeline.cc b/media/base/pipeline.cc
index 29a8dd0..d465e2d 100644
--- a/media/base/pipeline.cc
+++ b/media/base/pipeline.cc
@@ -71,8 +71,7 @@ Pipeline::Pipeline(MessageLoop* message_loop, MediaLog* media_log)
waiting_for_clock_update_(false),
state_(kCreated),
current_bytes_(0),
- creation_time_(base::Time::Now()),
- is_downloading_data_(false) {
+ creation_time_(base::Time::Now()) {
media_log_->AddEvent(media_log_->CreatePipelineStateChangedEvent(kCreated));
ResetState();
media_log_->AddEvent(
@@ -117,8 +116,6 @@ void Pipeline::Seek(base::TimeDelta time,
base::AutoLock auto_lock(lock_);
CHECK(running_) << "Media pipeline isn't running";
- download_rate_monitor_.Stop();
-
message_loop_->PostTask(FROM_HERE, base::Bind(
&Pipeline::SeekTask, this, time, seek_cb));
}
@@ -228,12 +225,12 @@ void Pipeline::GetNaturalVideoSize(gfx::Size* out_size) const {
bool Pipeline::IsStreaming() const {
base::AutoLock auto_lock(lock_);
- return streaming_;
+ return !demuxer_->IsSeekable();
}
bool Pipeline::IsLocalSource() const {
base::AutoLock auto_lock(lock_);
- return local_source_;
+ return demuxer_->IsLocalSource();
}
PipelineStatistics Pipeline::GetStatistics() const {
@@ -270,8 +267,6 @@ void Pipeline::ResetState() {
playback_rate_change_pending_ = false;
buffered_bytes_ = 0;
buffered_time_ranges_.clear();
- streaming_ = false;
- local_source_ = false;
total_bytes_ = 0;
natural_size_.SetSize(0, 0);
volume_ = 1.0f;
@@ -283,7 +278,6 @@ void Pipeline::ResetState() {
waiting_for_clock_update_ = false;
audio_disabled_ = false;
clock_->Reset();
- download_rate_monitor_.Reset();
}
void Pipeline::SetState(State next_state) {
@@ -452,7 +446,6 @@ void Pipeline::SetTotalBytes(int64 total_bytes) {
base::AutoLock auto_lock(lock_);
total_bytes_ = total_bytes;
- download_rate_monitor_.set_total_bytes(total_bytes_);
}
void Pipeline::SetBufferedBytes(int64 buffered_bytes) {
@@ -462,7 +455,6 @@ void Pipeline::SetBufferedBytes(int64 buffered_bytes) {
if (buffered_bytes < current_bytes_)
current_bytes_ = buffered_bytes;
buffered_bytes_ = buffered_bytes;
- download_rate_monitor_.SetBufferedBytes(buffered_bytes, base::Time::Now());
UpdateBufferedTimeRanges_Locked();
}
@@ -504,11 +496,6 @@ void Pipeline::SetNetworkActivity(bool is_downloading_data) {
if (is_downloading_data)
type = DOWNLOAD_CONTINUED;
- {
- base::AutoLock auto_lock(lock_);
- download_rate_monitor_.SetNetworkActivity(is_downloading_data);
- }
-
message_loop_->PostTask(FROM_HERE, base::Bind(
&Pipeline::NotifyNetworkEventTask, this, type));
media_log_->AddEvent(
@@ -973,20 +960,6 @@ void Pipeline::FilterStateTransitionTask() {
StartClockIfWaitingForTimeUpdate_Locked();
}
- // Start monitoring rate of downloading.
- int bitrate = 0;
- if (demuxer_) {
- bitrate = demuxer_->GetBitrate();
- local_source_ = demuxer_->IsLocalSource();
- streaming_ = !demuxer_->IsSeekable();
- }
- // Needs to be locked because most other calls to |download_rate_monitor_|
- // occur on the renderer thread.
- download_rate_monitor_.Start(
- base::Bind(&Pipeline::OnCanPlayThrough, this),
- bitrate, streaming_, local_source_);
- download_rate_monitor_.SetBufferedBytes(buffered_bytes_, base::Time::Now());
-
if (IsPipelineStopPending()) {
// We had a pending stop request need to be honored right now.
TearDownPipeline();
@@ -1333,16 +1306,6 @@ void Pipeline::OnAudioUnderflow() {
audio_renderer_->ResumeAfterUnderflow(true);
}
-void Pipeline::OnCanPlayThrough() {
- message_loop_->PostTask(FROM_HERE, base::Bind(
- &Pipeline::NotifyCanPlayThrough, this));
-}
-
-void Pipeline::NotifyCanPlayThrough() {
- DCHECK(message_loop_->BelongsToCurrentThread());
- NotifyNetworkEventTask(CAN_PLAY_THROUGH);
-}
-
void Pipeline::StartClockIfWaitingForTimeUpdate_Locked() {
lock_.AssertAcquired();
if (!waiting_for_clock_update_)