| Index: media/base/filter_host_impl.cc
|
| diff --git a/media/base/filter_host_impl.cc b/media/base/filter_host_impl.cc
|
| index 0cd348af9b6be4cf76c27fbe68da075928c44c81..96e4e93ffa9ded0182be3f578729668914c21102 100644
|
| --- a/media/base/filter_host_impl.cc
|
| +++ b/media/base/filter_host_impl.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2008-2009 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| @@ -6,56 +6,6 @@
|
|
|
| namespace media {
|
|
|
| -void FilterHostImpl::SetTimeUpdateCallback(
|
| - Callback1<base::TimeDelta>::Type* callback) {
|
| - time_update_callback_.reset(callback);
|
| -}
|
| -
|
| -void FilterHostImpl::RunTimeUpdateCallback(base::TimeDelta time) {
|
| - if (time_update_callback_.get()) {
|
| - time_update_callback_->Run(time);
|
| - }
|
| -}
|
| -
|
| -// To understand why this method takes the |caller| parameter, see the comments
|
| -// of the TimeUpdatedTask in the file filter_host_impl.h.
|
| -void FilterHostImpl::RunScheduledTimeUpdateCallback(TimeUpdateTask* caller) {
|
| - time_update_lock_.Acquire();
|
| - if (caller == scheduled_time_update_task_) {
|
| - scheduled_time_update_task_ = NULL;
|
| - }
|
| - time_update_lock_.Release();
|
| - RunTimeUpdateCallback(pipeline()->GetInterpolatedTime());
|
| -}
|
| -
|
| -void FilterHostImpl::ScheduleTimeUpdateCallback(base::TimeDelta time) {
|
| - time_update_lock_.Acquire();
|
| - if (stopped_) {
|
| - time_update_lock_.Release();
|
| - } else {
|
| - DCHECK(time_update_callback_.get());
|
| - if (scheduled_time_update_task_) {
|
| - scheduled_time_update_task_->Cancel();
|
| - }
|
| - scheduled_time_update_task_ = new TimeUpdateTask(this);
|
| - Task* task = scheduled_time_update_task_;
|
| - time_update_lock_.Release();
|
| -
|
| - // Here, we compute the delta from now & adjust it by the playback rate.
|
| - time -= pipeline()->GetInterpolatedTime();
|
| - int delay = static_cast<int>(time.InMilliseconds());
|
| - float rate = pipeline()->GetPlaybackRate();
|
| - if (rate > 0.0f) {
|
| - delay = static_cast<int>(delay / rate);
|
| - }
|
| - if (delay > 0) {
|
| - pipeline_thread_->message_loop()->PostDelayedTask(FROM_HERE, task, delay);
|
| - } else {
|
| - pipeline_thread_->message_loop()->PostTask(FROM_HERE, task);
|
| - }
|
| - }
|
| -}
|
| -
|
| void FilterHostImpl::InitializationComplete() {
|
| pipeline_thread_->InitializationComplete(this);
|
| }
|
| @@ -64,6 +14,10 @@ void FilterHostImpl::Error(PipelineError error) {
|
| pipeline_thread_->Error(error);
|
| }
|
|
|
| +base::TimeDelta FilterHostImpl::GetTime() const {
|
| + return pipeline()->GetTime();
|
| +}
|
| +
|
| void FilterHostImpl::SetTime(base::TimeDelta time) {
|
| pipeline_thread_->SetTime(time);
|
| }
|
| @@ -88,18 +42,11 @@ void FilterHostImpl::SetVideoSize(size_t width, size_t height) {
|
| pipeline()->SetVideoSize(width, height);
|
| }
|
|
|
| -const PipelineStatus* FilterHostImpl::GetPipelineStatus() const {
|
| - return pipeline();
|
| -}
|
| -
|
| void FilterHostImpl::Stop() {
|
| if (!stopped_) {
|
| filter_->Stop();
|
| AutoLock auto_lock(time_update_lock_);
|
| stopped_ = true;
|
| - if (scheduled_time_update_task_) {
|
| - scheduled_time_update_task_->Cancel();
|
| - }
|
| }
|
| }
|
|
|
|
|