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

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: relaxing the notreached back to log(error) since nacl tests will otherwise fail 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
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..97749968c7e81b135f34f7c052b6086c6cfe3fe6 100644
--- a/content/renderer/media/audio_input_message_filter.h
+++ b/content/renderer/media/audio_input_message_filter.h
@@ -14,50 +14,33 @@
#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_device_ipc.h"
class CONTENT_EXPORT AudioInputMessageFilter
- : public IPC::ChannelProxy::MessageFilter {
+ : public IPC::ChannelProxy::MessageFilter,
+ public NON_EXPORTED_BASE(media::AudioInputDeviceIPC) {
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);
+ // Implementation of AudioInputDeviceIPC.
+ virtual int AddDelegate(
+ media::AudioInputDeviceIPCDelegate* 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;
- // Remove a delegate referenced by |id| from the map.
- void RemoveDelegate(int32 id);
+ private:
+ virtual ~AudioInputMessageFilter();
// Sends an IPC message using |channel_|.
bool Send(IPC::Message* message);
- private:
- virtual ~AudioInputMessageFilter();
-
// IPC::ChannelProxy::MessageFilter override. Called on IO thread.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void OnFilterAdded(IPC::Channel* channel) OVERRIDE;
@@ -78,13 +61,14 @@ 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,
scherkus (not reviewing) 2012/07/24 17:57:48 indent
tommi (sloooow) - chröme 2012/07/25 13:46:17 Done.
+ media::AudioInputDeviceIPCDelegate::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::AudioInputDeviceIPCDelegate> delegates_;
IPC::Channel* channel_;

Powered by Google App Engine
This is Rietveld 408576698