| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ | 6 #define CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ |
| 7 | 7 |
| 8 #include "base/id_map.h" | 8 #include "base/id_map.h" |
| 9 #include "base/shared_memory.h" | 9 #include "base/shared_memory.h" |
| 10 #include "base/sync_socket.h" | 10 #include "base/sync_socket.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // Associates |render_view_id| as the destination of audio for a stream. | 35 // Associates |render_view_id| as the destination of audio for a stream. |
| 36 void AssociateStreamWithConsumer(int stream_id, int render_view_id); | 36 void AssociateStreamWithConsumer(int stream_id, int render_view_id); |
| 37 | 37 |
| 38 // Implementation of AudioInputIPC. All methods must be called on the | 38 // Implementation of AudioInputIPC. All methods must be called on the |
| 39 // provided |io_message_loop|. | 39 // provided |io_message_loop|. |
| 40 virtual int AddDelegate( | 40 virtual int AddDelegate( |
| 41 media::AudioInputIPCDelegate* delegate) OVERRIDE; | 41 media::AudioInputIPCDelegate* delegate) OVERRIDE; |
| 42 virtual void RemoveDelegate(int id) OVERRIDE; | 42 virtual void RemoveDelegate(int id) OVERRIDE; |
| 43 virtual void CreateStream( | 43 virtual void CreateStream( |
| 44 int stream_id, | 44 int stream_id, |
| 45 int session_id, |
| 45 const media::AudioParameters& params, | 46 const media::AudioParameters& params, |
| 46 const std::string& device_id, | |
| 47 bool automatic_gain_control, | 47 bool automatic_gain_control, |
| 48 uint32 total_segments) OVERRIDE; | 48 uint32 total_segments) OVERRIDE; |
| 49 virtual void StartDevice(int stream_id, int session_id) OVERRIDE; | |
| 50 virtual void RecordStream(int stream_id) OVERRIDE; | 49 virtual void RecordStream(int stream_id) OVERRIDE; |
| 51 virtual void CloseStream(int stream_id) OVERRIDE; | 50 virtual void CloseStream(int stream_id) OVERRIDE; |
| 52 virtual void SetVolume(int stream_id, double volume) OVERRIDE; | 51 virtual void SetVolume(int stream_id, double volume) OVERRIDE; |
| 53 | 52 |
| 54 scoped_refptr<base::MessageLoopProxy> io_message_loop() const { | 53 scoped_refptr<base::MessageLoopProxy> io_message_loop() const { |
| 55 return io_message_loop_; | 54 return io_message_loop_; |
| 56 } | 55 } |
| 57 | 56 |
| 58 private: | 57 private: |
| 59 virtual ~AudioInputMessageFilter(); | 58 virtual ~AudioInputMessageFilter(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 79 uint32 total_segments); | 78 uint32 total_segments); |
| 80 | 79 |
| 81 // Notification of volume property of an audio input stream. | 80 // Notification of volume property of an audio input stream. |
| 82 void OnStreamVolume(int stream_id, double volume); | 81 void OnStreamVolume(int stream_id, double volume); |
| 83 | 82 |
| 84 // Received when internal state of browser process' audio input stream has | 83 // Received when internal state of browser process' audio input stream has |
| 85 // changed. | 84 // changed. |
| 86 void OnStreamStateChanged(int stream_id, | 85 void OnStreamStateChanged(int stream_id, |
| 87 media::AudioInputIPCDelegate::State state); | 86 media::AudioInputIPCDelegate::State state); |
| 88 | 87 |
| 89 // Notification of the opened device of an audio session. | |
| 90 void OnDeviceStarted(int stream_id, const std::string& device_id); | |
| 91 | |
| 92 // A map of stream ids to delegates. | 88 // A map of stream ids to delegates. |
| 93 IDMap<media::AudioInputIPCDelegate> delegates_; | 89 IDMap<media::AudioInputIPCDelegate> delegates_; |
| 94 | 90 |
| 95 // IPC channel for Send(), must only be accesed on |io_message_loop_|. | 91 // IPC channel for Send(), must only be accesed on |io_message_loop_|. |
| 96 IPC::Channel* channel_; | 92 IPC::Channel* channel_; |
| 97 | 93 |
| 98 // The singleton instance for this filter. | 94 // The singleton instance for this filter. |
| 99 static AudioInputMessageFilter* filter_; | 95 static AudioInputMessageFilter* filter_; |
| 100 | 96 |
| 101 // Message loop on which IPC calls are driven. | 97 // Message loop on which IPC calls are driven. |
| 102 const scoped_refptr<base::MessageLoopProxy> io_message_loop_; | 98 const scoped_refptr<base::MessageLoopProxy> io_message_loop_; |
| 103 | 99 |
| 104 DISALLOW_COPY_AND_ASSIGN(AudioInputMessageFilter); | 100 DISALLOW_COPY_AND_ASSIGN(AudioInputMessageFilter); |
| 105 }; | 101 }; |
| 106 | 102 |
| 107 } // namespace content | 103 } // namespace content |
| 108 | 104 |
| 109 #endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ | 105 #endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_MESSAGE_FILTER_H_ |
| OLD | NEW |