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

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 165472: Merge 23255 - Implemented endofstream callback for media::PipelineImpl.... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 4 months 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
« no previous file with comments | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698