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

Unified Diff: content/browser/media/media_internals.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: content/browser/media/media_internals.cc
diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc
index f0b071a4e12fb3dda001b9506df53f42b98dec13..3f3900525f6179718cd8c0388ff0118067dcf413 100644
--- a/content/browser/media/media_internals.cc
+++ b/content/browser/media/media_internals.cc
@@ -104,6 +104,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,
@@ -189,6 +191,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) {

Powered by Google App Engine
This is Rietveld 408576698