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

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

Issue 12383016: Merge AssociateStreamWithProducer message into CreateStream message for both audio output and input. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 10 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 82af71e8717f3975770a556a79e2fe5ca80fa186..1715bc2e00436ab9b09ed6cb0d9dfb7ae3da1b87 100644
--- a/content/renderer/media/audio_input_message_filter.h
+++ b/content/renderer/media/audio_input_message_filter.h
@@ -6,6 +6,7 @@
#define CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_
#include "base/id_map.h"
+#include "base/memory/scoped_ptr.h"
#include "base/shared_memory.h"
#include "base/sync_socket.h"
#include "content/common/content_export.h"
@@ -23,8 +24,7 @@ namespace content {
// IO thread (secondary thread of render process), it intercepts audio messages
// and process them on IO thread since these messages are time critical.
class CONTENT_EXPORT AudioInputMessageFilter
- : public IPC::ChannelProxy::MessageFilter,
- public NON_EXPORTED_BASE(media::AudioInputIPC) {
+ : public IPC::ChannelProxy::MessageFilter {
public:
explicit AudioInputMessageFilter(
const scoped_refptr<base::MessageLoopProxy>& io_message_loop);
@@ -32,26 +32,22 @@ class CONTENT_EXPORT AudioInputMessageFilter
// Getter for the one AudioInputMessageFilter object.
static AudioInputMessageFilter* Get();
- // Associates |render_view_id| as the destination of audio for a stream.
- void AssociateStreamWithConsumer(int stream_id, int render_view_id);
-
- // Implementation of AudioInputIPC. All methods must be called on the
- // provided |io_message_loop|.
- 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;
+ // Create an AudioInputIPC to be owned by one delegate. |render_view_id| is
+ // the render view containing the entity consuming the audio.
+ //
+ // The returned object is not thread-safe, and must be used on
+ // |io_message_loop|.
+ scoped_ptr<media::AudioInputIPC> CreateAudioInputIPC(int render_view_id);
scoped_refptr<base::MessageLoopProxy> io_message_loop() const {
return io_message_loop_;
}
private:
+ // Implementation of media::AudioInputIPC which augments IPC calls with
+ // stream_id and the destination render_view_id.
+ class AudioInputIPCImpl;
+
virtual ~AudioInputMessageFilter();
// Sends an IPC message using |channel_|.
@@ -89,9 +85,6 @@ class CONTENT_EXPORT AudioInputMessageFilter
// IPC channel for Send(), must only be accesed on |io_message_loop_|.
IPC::Channel* channel_;
- // The singleton instance for this filter.
- static AudioInputMessageFilter* filter_;
-
// Message loop on which IPC calls are driven.
const scoped_refptr<base::MessageLoopProxy> io_message_loop_;

Powered by Google App Engine
This is Rietveld 408576698