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

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

Issue 10790121: First step towards moving AudioDevice from content/ to media/audio. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comments after closing ppapi bug Created 8 years, 5 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_input_device.cc ('k') | content/renderer/media/audio_input_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_input_message_filter.h
diff --git a/content/renderer/media/audio_input_message_filter.h b/content/renderer/media/audio_input_message_filter.h
index ba5e9def33ee31d395488bf664933db518b8b263..ee99900d64e078e4f51c6c136a772b3e66182bcb 100644
--- a/content/renderer/media/audio_input_message_filter.h
+++ b/content/renderer/media/audio_input_message_filter.h
@@ -14,50 +14,36 @@
#include "base/shared_memory.h"
#include "base/sync_socket.h"
#include "content/common/content_export.h"
-#include "content/common/media/audio_stream_state.h"
#include "ipc/ipc_channel_proxy.h"
#include "media/audio/audio_buffers_state.h"
+#include "media/audio/audio_input_ipc.h"
class CONTENT_EXPORT AudioInputMessageFilter
- : public IPC::ChannelProxy::MessageFilter {
+ : public IPC::ChannelProxy::MessageFilter,
+ public NON_EXPORTED_BASE(media::AudioInputIPC) {
public:
- class CONTENT_EXPORT Delegate {
- public:
- // Called when an audio input stream has been created in the browser
- // process.
- virtual void OnStreamCreated(base::SharedMemoryHandle handle,
- base::SyncSocket::Handle socket_handle,
- uint32 length) = 0;
-
- // Called when notification of input stream volume is received from the
- // browser process.
- virtual void OnVolume(double volume) = 0;
-
- // Called when state of an input stream has changed in the browser process.
- virtual void OnStateChanged(AudioStreamState state) = 0;
-
- // Called when the device referenced by the index has been started in
- // the browswer process.
- virtual void OnDeviceReady(const std::string& device_id) = 0;
-
- protected:
- virtual ~Delegate() {}
- };
-
AudioInputMessageFilter();
- // Add a delegate to the map and return id of the entry.
- int32 AddDelegate(Delegate* delegate);
-
- // Remove a delegate referenced by |id| from the map.
- void RemoveDelegate(int32 id);
+ // Getter for the one AudioInputMessageFilter object.
+ static AudioInputMessageFilter* Get();
- // Sends an IPC message using |channel_|.
- bool Send(IPC::Message* message);
+ // Implementation of AudioInputIPC.
+ virtual int AddDelegate(
+ media::AudioInputIPCDelegate* delegate) OVERRIDE;
+ virtual void RemoveDelegate(int id) OVERRIDE;
+ virtual void CreateStream(int stream_id, const media::AudioParameters& params,
+ const std::string& device_id, bool automatic_gain_control) OVERRIDE;
+ virtual void StartDevice(int stream_id, int session_id) OVERRIDE;
+ virtual void RecordStream(int stream_id) OVERRIDE;
+ virtual void CloseStream(int stream_id) OVERRIDE;
+ virtual void SetVolume(int stream_id, double volume) OVERRIDE;
private:
virtual ~AudioInputMessageFilter();
+ // Sends an IPC message using |channel_|.
+ bool Send(IPC::Message* message);
+
// IPC::ChannelProxy::MessageFilter override. Called on IO thread.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE;
@@ -78,16 +64,20 @@ class CONTENT_EXPORT AudioInputMessageFilter
// Received when internal state of browser process' audio input stream has
// changed.
- void OnStreamStateChanged(int stream_id, AudioStreamState state);
+ void OnStreamStateChanged(int stream_id,
+ media::AudioInputIPCDelegate::State state);
// Notification of the opened device of an audio session.
void OnDeviceStarted(int stream_id, const std::string& device_id);
// A map of stream ids to delegates.
- IDMap<Delegate> delegates_;
+ IDMap<media::AudioInputIPCDelegate> delegates_;
IPC::Channel* channel_;
+ // The singleton instance for this filter.
+ static AudioInputMessageFilter* filter_;
+
DISALLOW_COPY_AND_ASSIGN(AudioInputMessageFilter);
};
« no previous file with comments | « content/renderer/media/audio_input_device.cc ('k') | content/renderer/media/audio_input_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698