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

Unified Diff: media/base/pipeline_impl.cc

Issue 1812543003: Allow muting/unmuting audio through media track API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blink-sb-tracks6
Patch Set: rebase Created 4 years, 9 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/base/pipeline_impl.cc
diff --git a/media/base/pipeline_impl.cc b/media/base/pipeline_impl.cc
index 5f4705b5d2639c6b4b2dd65bceacc72178d26d9c..7971a2ae5af2be205a2351bd772214eed30a8927 100644
--- a/media/base/pipeline_impl.cc
+++ b/media/base/pipeline_impl.cc
@@ -204,6 +204,36 @@ void PipelineImpl::SetCdm(CdmContext* cdm_context,
cdm_attached_cb));
}
+void PipelineImpl::OnEnabledAudioStreamsChanged(
+ const std::vector<const DemuxerStream*>& enabledAudioStreams) {
+ if (!task_runner_->BelongsToCurrentThread()) {
+ task_runner_->PostTask(
+ FROM_HERE, base::Bind(&PipelineImpl::OnEnabledAudioStreamsChanged,
+ weak_factory_.GetWeakPtr(), enabledAudioStreams));
+ return;
+ }
+ base::AutoLock auto_lock(lock_);
+ DCHECK(task_runner_->BelongsToCurrentThread());
+ if (renderer_) {
+ renderer_->OnEnabledAudioStreamsChanged(enabledAudioStreams);
+ }
+}
+
+void PipelineImpl::OnSelectedVideoStreamChanged(
+ const DemuxerStream* selectedVideoStream) {
+ if (!task_runner_->BelongsToCurrentThread()) {
+ task_runner_->PostTask(
+ FROM_HERE, base::Bind(&PipelineImpl::OnSelectedVideoStreamChanged,
+ weak_factory_.GetWeakPtr(), selectedVideoStream));
+ return;
+ }
+ base::AutoLock auto_lock(lock_);
+ DCHECK(task_runner_->BelongsToCurrentThread());
+ if (renderer_) {
+ renderer_->OnSelectedVideoStreamChanged(selectedVideoStream);
+ }
+}
+
void PipelineImpl::SetErrorForTesting(PipelineStatus status) {
OnError(status);
}

Powered by Google App Engine
This is Rietveld 408576698