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

Unified Diff: content/renderer/media/audio_message_filter.h

Issue 11880009: Introduce AudioHardwareConfig for renderer side audio device info. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style nits. Created 7 years, 11 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 | « content/renderer/media/audio_hardware.cc ('k') | content/renderer/media/audio_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/audio_message_filter.h
diff --git a/content/renderer/media/audio_message_filter.h b/content/renderer/media/audio_message_filter.h
index de746d5d31cd7767ee20ff4cdcf787dbf9603fbf..117260771918f3d9a9deff0e65872abcb01f8f81 100644
--- a/content/renderer/media/audio_message_filter.h
+++ b/content/renderer/media/audio_message_filter.h
@@ -19,6 +19,7 @@
#include "ipc/ipc_channel_proxy.h"
#include "media/audio/audio_buffers_state.h"
#include "media/audio/audio_output_ipc.h"
+#include "media/base/audio_hardware_config.h"
namespace content {
@@ -37,8 +38,8 @@ class CONTENT_EXPORT AudioMessageFilter
// media::AudioOutputIPC implementation.
virtual int AddDelegate(media::AudioOutputIPCDelegate* delegate) OVERRIDE;
virtual void RemoveDelegate(int id) OVERRIDE;
- virtual void CreateStream(int stream_id,
- const media::AudioParameters& params, int input_channels) OVERRIDE;
+ virtual void CreateStream(int stream_id, const media::AudioParameters& params,
+ int input_channels) OVERRIDE;
virtual void PlayStream(int stream_id) OVERRIDE;
virtual void PauseStream(int stream_id) OVERRIDE;
virtual void FlushStream(int stream_id) OVERRIDE;
@@ -51,6 +52,11 @@ class CONTENT_EXPORT AudioMessageFilter
virtual void OnFilterRemoved() OVERRIDE;
virtual void OnChannelClosing() OVERRIDE;
+ // When set, AudioMessageFilter will update the AudioHardwareConfig with new
+ // configuration values as recieved by OnOutputDeviceChanged(). The provided
+ // |config| must outlive AudioMessageFilter.
+ void SetAudioHardwareConfig(media::AudioHardwareConfig* config);
+
protected:
virtual ~AudioMessageFilter();
@@ -75,21 +81,26 @@ class CONTENT_EXPORT AudioMessageFilter
void OnStreamStateChanged(int stream_id,
media::AudioOutputIPCDelegate::State state);
+ // Received when the browser process detects an output device change.
+ void OnOutputDeviceChanged(int stream_id, int new_buffer_size,
+ int new_sample_rate);
+
// The singleton instance for this filter.
static AudioMessageFilter* filter_;
- // Guards delegates_ since AddDelegate() and RemoveDelegate() are called from
- // threads other than the IO thread.
- base::Lock delegates_lock_;
+ // Unique ID to use for next added delegate.
+ int next_stream_id_;
+ IPC::Channel* channel_;
+
+ // Guards all variables below which are accessed from multiple threads.
+ base::Lock lock_;
// A map of stream ids to delegates.
typedef base::hash_map<int, media::AudioOutputIPCDelegate*> DelegateMap;
DelegateMap delegates_;
- // Unique ID to use for next added delegate.
- int next_stream_id_;
-
- IPC::Channel* channel_;
+ // Audio hardware configuration to update when OnOutputDeviceChanged() fires.
+ media::AudioHardwareConfig* audio_hardware_config_;
DISALLOW_COPY_AND_ASSIGN(AudioMessageFilter);
};
« no previous file with comments | « content/renderer/media/audio_hardware.cc ('k') | content/renderer/media/audio_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698