| Index: webkit/glue/webmediaplayer_impl.cc
|
| ===================================================================
|
| --- webkit/glue/webmediaplayer_impl.cc (revision 23335)
|
| +++ webkit/glue/webmediaplayer_impl.cc (working copy)
|
| @@ -93,6 +93,11 @@
|
| &WebMediaPlayerImpl::Proxy::PipelineSeekTask));
|
| }
|
|
|
| +void WebMediaPlayerImpl::Proxy::PipelineEndedCallback() {
|
| + render_loop_->PostTask(FROM_HERE, NewRunnableMethod(this,
|
| + &WebMediaPlayerImpl::Proxy::PipelineEndedTask));
|
| +}
|
| +
|
| void WebMediaPlayerImpl::Proxy::PipelineErrorCallback() {
|
| render_loop_->PostTask(FROM_HERE, NewRunnableMethod(this,
|
| &WebMediaPlayerImpl::Proxy::PipelineErrorTask));
|
| @@ -124,6 +129,13 @@
|
| }
|
| }
|
|
|
| +void WebMediaPlayerImpl::Proxy::PipelineEndedTask() {
|
| + DCHECK(MessageLoop::current() == render_loop_);
|
| + if (webmediaplayer_) {
|
| + webmediaplayer_->OnPipelineEnded();
|
| + }
|
| +}
|
| +
|
| void WebMediaPlayerImpl::Proxy::PipelineErrorTask() {
|
| DCHECK(MessageLoop::current() == render_loop_);
|
| if (webmediaplayer_) {
|
| @@ -162,7 +174,9 @@
|
| // Creates the proxy.
|
| proxy_ = new Proxy(main_loop_, this);
|
|
|
| - // Sets the pipeline's error reporting callback.
|
| + // Set our pipeline callbacks.
|
| + pipeline_->SetPipelineEndedCallback(NewCallback(proxy_.get(),
|
| + &WebMediaPlayerImpl::Proxy::PipelineEndedCallback));
|
| pipeline_->SetPipelineErrorCallback(NewCallback(proxy_.get(),
|
| &WebMediaPlayerImpl::Proxy::PipelineErrorCallback));
|
|
|
| @@ -229,9 +243,12 @@
|
| void WebMediaPlayerImpl::seek(float seconds) {
|
| DCHECK(MessageLoop::current() == main_loop_);
|
|
|
| + // TODO(scherkus): WebKit fires a seek(0) at the very start, however pipeline
|
| + // already does a seek(0) internally. Investigate whether doing two seek(0)
|
| + // at the start impacts startup latency.
|
| +
|
| // Try to preserve as much accuracy as possible.
|
| float microseconds = seconds * base::Time::kMicrosecondsPerSecond;
|
| - if (seconds != 0)
|
| pipeline_->Seek(
|
| base::TimeDelta::FromMicroseconds(static_cast<int64>(microseconds)),
|
| NewCallback(proxy_.get(),
|
| @@ -421,6 +438,13 @@
|
| }
|
| }
|
|
|
| +void WebMediaPlayerImpl::OnPipelineEnded() {
|
| + DCHECK(MessageLoop::current() == main_loop_);
|
| + if (pipeline_->GetError() == media::PIPELINE_OK) {
|
| + GetClient()->timeChanged();
|
| + }
|
| +}
|
| +
|
| void WebMediaPlayerImpl::OnPipelineError() {
|
| DCHECK(MessageLoop::current() == main_loop_);
|
| switch (pipeline_->GetError()) {
|
|
|
| Property changes on: webkit\glue\webmediaplayer_impl.cc
|
| ___________________________________________________________________
|
| Modified: svn:mergeinfo
|
| Merged /trunk/src/webkit/glue/webmediaplayer_impl.cc:r23255
|
|
|
|
|