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

Unified Diff: media/blink/webmediaplayer_impl.cc

Issue 2696663002: Media Remoting: Don't auto suspend the media pipeline. (Closed)
Patch Set: Disable other auto suspend for optimization. Created 3 years, 10 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
Index: media/blink/webmediaplayer_impl.cc
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index a195bbffe433dd586df6ba14be3dffe79a5891dd..40b3a9f1c83fba28f48a3387dfd4235aa236f990 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -267,6 +267,9 @@ WebMediaPlayerImpl::WebMediaPlayerImpl(
// e.g. GetCurrentFrameFromCompositor(). See http://crbug.com/434861
audio_source_provider_ =
new WebAudioSourceProviderImpl(params.audio_renderer_sink(), media_log_);
+
+ if (observer_)
+ observer_->SetClient(this);
}
WebMediaPlayerImpl::~WebMediaPlayerImpl() {
@@ -1838,7 +1841,7 @@ void WebMediaPlayerImpl::UpdatePlayState() {
bool is_streaming = false;
#else
bool is_remote = false;
- bool is_streaming = IsStreaming();
+ bool is_streaming = IsStreaming() || disable_pipeline_auto_suspend_;
miu 2017/02/13 23:36:08 This |is_streaming| variable should probably be re
xjz 2017/02/14 01:46:10 Done.
#endif
bool is_suspended = pipeline_controller_.IsSuspended();
@@ -2287,4 +2290,14 @@ void WebMediaPlayerImpl::ReportTimeFromForegroundToFirstFrame(
}
}
+void WebMediaPlayerImpl::SwitchRenderer() {
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
+ ScheduleRestart();
+}
+
+void WebMediaPlayerImpl::DisablePipelineAutoSuspend(bool disable) {
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
+ disable_pipeline_auto_suspend_ = disable;
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698