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

Unified Diff: content/browser/media/media_internals.cc

Issue 1171953002: Add IPC interface for switching the audio output device for a given audio stream in the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix style Created 5 years, 6 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 | « content/browser/bad_message.h ('k') | content/browser/renderer_host/media/audio_renderer_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/media_internals.cc
diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc
index c3b87ce94851c3ed495b92c0499e4e1862646d6b..d622820a3915a9e72172d0e71dac0e2d1ffa7102 100644
--- a/content/browser/media/media_internals.cc
+++ b/content/browser/media/media_internals.cc
@@ -102,6 +102,8 @@ class AudioLogImpl : public media::AudioLog {
void OnClosed(int component_id) override;
void OnError(int component_id) override;
void OnSetVolume(int component_id, double volume) override;
+ void OnSwitchOutputDevice(int component_id,
+ const std::string& device_id) override;
// Called by MediaInternals to update the WebContents title for a stream.
void SendWebContentsTitle(int component_id,
@@ -187,6 +189,16 @@ void AudioLogImpl::OnSetVolume(int component_id, double volume) {
kAudioLogUpdateFunction, &dict);
}
+void AudioLogImpl::OnSwitchOutputDevice(int component_id,
+ const std::string& device_id) {
+ base::DictionaryValue dict;
+ StoreComponentMetadata(component_id, &dict);
+ dict.SetString("device_id", device_id);
+ media_internals_->SendAudioLogUpdate(MediaInternals::UPDATE_IF_EXISTS,
+ FormatCacheKey(component_id),
+ kAudioLogUpdateFunction, &dict);
+}
+
void AudioLogImpl::SendWebContentsTitle(int component_id,
int render_process_id,
int render_frame_id) {
« no previous file with comments | « content/browser/bad_message.h ('k') | content/browser/renderer_host/media/audio_renderer_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698