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

Unified Diff: media/audio/audio_output_ipc.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 comments 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
Index: media/audio/audio_output_ipc.h
diff --git a/media/audio/audio_output_ipc.h b/media/audio/audio_output_ipc.h
index 9af1df44efe8aa76992a7063b2422aff83328ddf..a224c733ebaed3e3abaddca21e684456b8e28142 100644
--- a/media/audio/audio_output_ipc.h
+++ b/media/audio/audio_output_ipc.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/callback.h"
#include "base/memory/shared_memory.h"
#include "base/sync_socket.h"
#include "media/audio/audio_parameters.h"
@@ -26,6 +27,8 @@ enum SwitchOutputDeviceResult {
SWITCH_OUTPUT_DEVICE_RESULT_ERROR_NOT_SUPPORTED,
};
+typedef base::Callback<void(SwitchOutputDeviceResult)> SwitchOutputDeviceCB;
+
// Current status of the audio output stream in the browser process. Browser
// sends information about the current playback state and error to the
// renderer process using this type.
@@ -57,6 +60,10 @@ class MEDIA_EXPORT AudioOutputIPCDelegate {
base::SyncSocket::Handle socket_handle,
int length) = 0;
+ // Called when an attempt to switch the output device has been completed
+ virtual void OnOutputDeviceSwitched(int request_id,
+ SwitchOutputDeviceResult result) = 0;
+
// Called when the AudioOutputIPC object is going away and/or when the IPC
// channel has been closed and no more ipc requests can be made.
// Implementations should delete their owned AudioOutputIPC instance
@@ -99,6 +106,11 @@ class MEDIA_EXPORT AudioOutputIPC {
// Sets the volume of the audio stream.
virtual void SetVolume(double volume) = 0;
+
+ // Switches the output device of the audio stream.
+ virtual void SwitchOutputDevice(const std::string& device_id,
+ const GURL& security_origin,
+ int request_id) = 0;
};
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698