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

Unified Diff: media/base/audio_renderer_mixer_input.cc

Issue 1184473002: Add support for the audio-output-device switching IPC mechanism to the renderer lower layers (media… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build dependencies for audio_unittests 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 | « media/base/audio_renderer_mixer_input.h ('k') | media/base/audio_renderer_sink.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_renderer_mixer_input.cc
diff --git a/media/base/audio_renderer_mixer_input.cc b/media/base/audio_renderer_mixer_input.cc
index ab9f0a7ecab20e0d2c6ddae12fc6bcc690009960..6194f21ca94d8c1e2a0fc22873cfdef2c82a7af7 100644
--- a/media/base/audio_renderer_mixer_input.cc
+++ b/media/base/audio_renderer_mixer_input.cc
@@ -5,6 +5,7 @@
#include "media/base/audio_renderer_mixer_input.h"
#include "base/bind.h"
+#include "base/location.h"
#include "base/logging.h"
#include "media/base/audio_renderer_mixer.h"
@@ -94,6 +95,19 @@ bool AudioRendererMixerInput::SetVolume(double volume) {
return true;
}
+void AudioRendererMixerInput::SwitchOutputDevice(
+ const std::string& device_id,
+ const GURL& security_origin,
+ const SwitchOutputDeviceCB& callback) {
+ DVLOG(1) << __FUNCTION__
+ << "(" << device_id << ", " << security_origin << ")";
+ if (mixer_) {
+ mixer_->SwitchOutputDevice(device_id, security_origin, callback);
+ } else {
+ callback.Run(SWITCH_OUTPUT_DEVICE_RESULT_ERROR_NOT_SUPPORTED);
+ }
+}
+
double AudioRendererMixerInput::ProvideInput(AudioBus* audio_bus,
base::TimeDelta buffer_delay) {
int frames_filled = callback_->Render(
« no previous file with comments | « media/base/audio_renderer_mixer_input.h ('k') | media/base/audio_renderer_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698