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

Unified Diff: content/browser/renderer_host/media/audio_renderer_host.h

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/renderer_host/media/audio_renderer_host.h
diff --git a/content/browser/renderer_host/media/audio_renderer_host.h b/content/browser/renderer_host/media/audio_renderer_host.h
index 69d3ea14c73ca994cfd33f045ac93486616bb4a9..825a5b9fa5c17c3b18d5649d9b7e5cca3f753f3d 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.h
+++ b/content/browser/renderer_host/media/audio_renderer_host.h
@@ -38,6 +38,7 @@
#define CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_RENDERER_HOST_H_
#include <map>
+#include <string>
#include "base/atomic_ref_count.h"
#include "base/gtest_prod_util.h"
@@ -49,6 +50,7 @@
#include "content/public/browser/browser_message_filter.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/resource_context.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_logging.h"
#include "media/audio/audio_output_controller.h"
@@ -64,6 +66,7 @@ namespace content {
class AudioMirroringManager;
class MediaInternals;
class MediaStreamManager;
+class MediaStreamUIProxy;
class ResourceContext;
class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
@@ -73,7 +76,8 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
media::AudioManager* audio_manager,
AudioMirroringManager* mirroring_manager,
MediaInternals* media_internals,
- MediaStreamManager* media_stream_manager);
+ MediaStreamManager* media_stream_manager,
+ const ResourceContext::SaltCallback& salt_callback);
// Calls |callback| with the list of AudioOutputControllers for this object.
void GetOutputControllers(
@@ -135,6 +139,38 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
// Set the volume of the audio stream referenced by |stream_id|.
void OnSetVolume(int stream_id, double volume);
+ // Set the output device of the audio stream referenced by |stream_id|.
+ void OnSwitchOutputDevice(int stream_id,
+ const std::string& device_id,
+ const GURL& security_origin,
+ int render_frame_id,
+ int request_id);
+
+ void OutputDeviceAccessChecked(scoped_ptr<MediaStreamUIProxy> ui_proxy,
+ int stream_id,
+ const std::string& device_id,
+ const GURL& security_origin,
+ int render_frame_id,
+ int request_id,
+ bool have_access);
+
+ void StartTranslateOutputDeviceName(int stream_id,
+ const std::string& device_id,
+ const GURL& security_origin,
+ int request_id);
+
+ void FinishTranslateOutputDeviceName(int stream_id,
+ const std::string& device_id,
+ const GURL& security_origin,
+ int request_id,
+ media::AudioDeviceNames*);
+
+ void DoSwitchOutputDevice(int stream_id,
+ const std::string& raw_device_id,
+ int request_id);
+
+ void DoOutputDeviceSwitched(int stream_id, int request_id);
+
// Complete the process of creating an audio stream. This will set up the
// shared memory or shared socket in low latency mode and send the
// NotifyStreamCreated message to the peer.
@@ -179,6 +215,9 @@ class CONTENT_EXPORT AudioRendererHost : public BrowserMessageFilter {
// The number of streams in the playing state.
base::AtomicRefCount num_playing_streams_;
+ // Salt required to translate renderer device IDs to raw device IDs
+ ResourceContext::SaltCallback salt_callback_;
+
DISALLOW_COPY_AND_ASSIGN(AudioRendererHost);
};

Powered by Google App Engine
This is Rietveld 408576698