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

Unified Diff: media/audio/audio_output_device.h

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/audio/BUILD.gn ('k') | media/audio/audio_output_device.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_device.h
diff --git a/media/audio/audio_output_device.h b/media/audio/audio_output_device.h
index 6255c71fdba8e99155622d78b7abc825a94cb256..dc28352958eebfd267fca1f23164ddc08da759b3 100644
--- a/media/audio/audio_output_device.h
+++ b/media/audio/audio_output_device.h
@@ -58,6 +58,8 @@
#ifndef MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_
#define MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_
+#include <string>
+
#include "base/basictypes.h"
#include "base/bind.h"
#include "base/memory/scoped_ptr.h"
@@ -95,6 +97,9 @@ class MEDIA_EXPORT AudioOutputDevice
void Play() override;
void Pause() override;
bool SetVolume(double volume) override;
+ void SwitchOutputDevice(const std::string& device_id,
+ const GURL& security_origin,
+ const SwitchOutputDeviceCB& callback) override;
// Methods called on IO thread ----------------------------------------------
// AudioOutputIPCDelegate methods.
@@ -102,6 +107,8 @@ class MEDIA_EXPORT AudioOutputDevice
void OnStreamCreated(base::SharedMemoryHandle handle,
base::SyncSocket::Handle socket_handle,
int length) override;
+ void OnOutputDeviceSwitched(int request_id,
+ SwitchOutputDeviceResult result) override;
void OnIPCClosed() override;
protected:
@@ -129,11 +136,16 @@ class MEDIA_EXPORT AudioOutputDevice
void PauseOnIOThread();
void ShutDownOnIOThread();
void SetVolumeOnIOThread(double volume);
+ void SwitchOutputDeviceOnIOThread(const std::string& device_id,
+ const GURL& security_origin,
+ const SwitchOutputDeviceCB& callback);
// base::MessageLoop::DestructionObserver implementation for the IO loop.
// If the IO loop dies before we do, we shut down the audio thread from here.
void WillDestroyCurrentMessageLoop() override;
+ void SetCurrentSwitchRequest(const SwitchOutputDeviceCB& callback);
+
AudioParameters audio_parameters_;
RenderCallback* callback_;
@@ -171,6 +183,9 @@ class MEDIA_EXPORT AudioOutputDevice
// the callback via Start(). See http://crbug.com/151051 for details.
bool stopping_hack_;
+ int current_switch_request_id_;
+ SwitchOutputDeviceCB current_switch_callback_;
+
DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice);
};
« no previous file with comments | « media/audio/BUILD.gn ('k') | media/audio/audio_output_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698