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

Unified Diff: media/filters/pipeline_controller.cc

Issue 2204673004: WIP - WebMediaPlayer switch media renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some revision. Created 4 years, 3 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/filters/pipeline_controller.cc
diff --git a/media/filters/pipeline_controller.cc b/media/filters/pipeline_controller.cc
index 2055afb9dc08cdd3a3879434301051a1b84167c8..6e7a14266ae043aa2e484756658d61db10ec6838 100644
--- a/media/filters/pipeline_controller.cc
+++ b/media/filters/pipeline_controller.cc
@@ -20,6 +20,7 @@ PipelineController::PipelineController(
seeked_cb_(seeked_cb),
suspended_cb_(suspended_cb),
error_cb_(error_cb),
+ remoting_controller_(new RemotingController(this)),
weak_factory_(this) {
DCHECK(pipeline_);
DCHECK(!renderer_factory_cb_.is_null());
@@ -30,6 +31,7 @@ PipelineController::PipelineController(
PipelineController::~PipelineController() {
DCHECK(thread_checker_.CalledOnValidThread());
+ remoting_controller_.reset();
}
// TODO(sandersd): If there is a pending suspend, don't call pipeline_.Start()
@@ -233,4 +235,38 @@ void PipelineController::Dispatch() {
}
}
+void PipelineController::SetFullscreenMode(bool is_fullscreen) {
+ remoting_controller_->SetFullscreenMode(is_fullscreen);
+}
+
+void PipelineController::SetIsEncryptedContent() {
+ remoting_controller_->SetIsEncryptedContent();
+}
+
+// Switch media renderer between local playing back and remoting media renderer.
+// Note: The actual switching happens when starts or resumes the pipeline.
+void PipelineController::ToggleRenderer() {
+ if (state_ == State::PLAYING) {
+ Suspend();
+ // A new renderer will be created when pipeline resumes.
+ Resume();
+ }
+}
+
+bool PipelineController::ShouldUseRemotingRenderer() const {
+ return remoting_controller_->ShouldUseRemotingRenderer();
+}
+
+VideoDecoderConfig PipelineController::GetVideoDecoderConfig() const {
+ if (!pipeline_)
+ return VideoDecoderConfig();
+ return pipeline_->GetVideoDecoderConfig();
+}
+
+AudioDecoderConfig PipelineController::GetAudioDecoderConfig() const {
+ if (!pipeline_)
+ return AudioDecoderConfig();
+ return pipeline_->GetAudioDecoderConfig();
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698