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

Unified Diff: media/renderers/audio_renderer_impl.cc

Issue 1122393004: Add support for switching the audio output device for HTMLMediaElements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes to MediaPlayers so that they invoke callbacks in the correct threads. First complete implem… Created 5 years, 7 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/renderers/audio_renderer_impl.cc
diff --git a/media/renderers/audio_renderer_impl.cc b/media/renderers/audio_renderer_impl.cc
index d17a0689134d6075491a70e18b66fb5d0d63a9a6..335f13658950d3190c1349e75cc6268f4a47e6ae 100644
--- a/media/renderers/audio_renderer_impl.cc
+++ b/media/renderers/audio_renderer_impl.cc
@@ -396,6 +396,17 @@ void AudioRendererImpl::SetVolume(float volume) {
sink_->SetVolume(volume);
}
+void AudioRendererImpl::SwitchOutputDevice(
+ const std::string& device_id,
+ const GURL& security_origin,
+ const base::Callback<void(int)>& callback) {
+ DCHECK(task_runner_->BelongsToCurrentThread());
+ DCHECK(sink_.get());
+ DVLOG(1) << __FUNCTION__ << "(" << device_id << ", " << security_origin << ")"
+ << ". Forwarding to sink " << sink_ << ".";
+ sink_->SwitchOutputDevice(device_id, security_origin, callback);
+}
+
void AudioRendererImpl::DecodedAudioReady(
AudioBufferStream::Status status,
const scoped_refptr<AudioBuffer>& buffer) {

Powered by Google App Engine
This is Rietveld 408576698