OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // MessageFilter that handles audio input messages and delegates them to | 5 // MessageFilter that handles audio input messages and delegates them to |
6 // audio capturers. Created on render thread, AudioMessageFilter is operated on | 6 // audio capturers. Created on render thread, AudioMessageFilter is operated on |
7 // IO thread (main thread of render process), it intercepts audio messages | 7 // IO thread (main thread of render process), it intercepts audio messages |
8 // and process them on IO thread since these messages are time critical. | 8 // and process them on IO thread since these messages are time critical. |
9 // This implementation only supports low-latency (based on SyncSocket) | 9 // This implementation only supports low-latency (based on SyncSocket) |
10 // messaging. | 10 // messaging. |
11 | 11 |
12 #ifndef CONTENT_RENDERER_AUDIO_INPUT_MESSAGE_FILTER_H_ | 12 #ifndef CONTENT_RENDERER_AUDIO_INPUT_MESSAGE_FILTER_H_ |
13 #define CONTENT_RENDERER_AUDIO_INPUT_MESSAGE_FILTER_H_ | 13 #define CONTENT_RENDERER_AUDIO_INPUT_MESSAGE_FILTER_H_ |
14 #pragma once | 14 #pragma once |
15 | 15 |
16 #include "base/id_map.h" | 16 #include "base/id_map.h" |
17 #include "base/shared_memory.h" | 17 #include "base/shared_memory.h" |
18 #include "base/sync_socket.h" | 18 #include "base/sync_socket.h" |
19 #include "ipc/ipc_channel_proxy.h" | 19 #include "ipc/ipc_channel_proxy.h" |
20 #include "media/audio/audio_buffers_state.h" | 20 #include "media/audio/audio_buffers_state.h" |
21 | 21 |
| 22 class MessageLoop; |
| 23 |
22 class AudioInputMessageFilter : public IPC::ChannelProxy::MessageFilter { | 24 class AudioInputMessageFilter : public IPC::ChannelProxy::MessageFilter { |
23 public: | 25 public: |
24 class Delegate { | 26 class Delegate { |
25 public: | 27 public: |
26 // Called when a low-latency audio input stream has been created in the | 28 // Called when a low-latency audio input stream has been created in the |
27 // browser process. | 29 // browser process. |
28 virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, | 30 virtual void OnLowLatencyCreated(base::SharedMemoryHandle handle, |
29 base::SyncSocket::Handle socket_handle, | 31 base::SyncSocket::Handle socket_handle, |
30 uint32 length) = 0; | 32 uint32 length) = 0; |
31 | 33 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 IPC::Channel* channel_; | 81 IPC::Channel* channel_; |
80 | 82 |
81 int32 route_id_; | 83 int32 route_id_; |
82 | 84 |
83 MessageLoop* message_loop_; | 85 MessageLoop* message_loop_; |
84 | 86 |
85 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputMessageFilter); | 87 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputMessageFilter); |
86 }; | 88 }; |
87 | 89 |
88 #endif // CONTENT_RENDERER_AUDIO_INPUT_MESSAGE_FILTER_H_ | 90 #endif // CONTENT_RENDERER_AUDIO_INPUT_MESSAGE_FILTER_H_ |
OLD | NEW |