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 // AudioInputDeviceManager manages the audio input devices. In particular it | 5 // AudioInputDeviceManager manages the audio input devices. In particular it |
6 // communicates with MediaStreamManager and AudioInputRendererHost on the | 6 // communicates with MediaStreamManager and AudioInputRendererHost on the |
7 // browser IO thread, handles queries like enumerate/open/close from | 7 // browser IO thread, handles queries like enumerate/open/close from |
8 // MediaStreamManager and start/stop from AudioInputRendererHost. | 8 // MediaStreamManager and start/stop from AudioInputRendererHost. |
9 // The work for enumerate/open/close is handled asynchronously on Media Stream | 9 // The work for enumerate/open/close is handled asynchronously on Media Stream |
10 // device thread, while start/stop are synchronous on the IO thread. | 10 // device thread, while start/stop are synchronous on the IO thread. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 // Executed on media stream device thread. | 62 // Executed on media stream device thread. |
63 void EnumerateOnDeviceThread(); | 63 void EnumerateOnDeviceThread(); |
64 void OpenOnDeviceThread(int session_id, const StreamDeviceInfo& device); | 64 void OpenOnDeviceThread(int session_id, const StreamDeviceInfo& device); |
65 void CloseOnDeviceThread(int session_id); | 65 void CloseOnDeviceThread(int session_id); |
66 | 66 |
67 // Executed on IO thread to call Listener. | 67 // Executed on IO thread to call Listener. |
68 void DevicesEnumeratedOnIOThread(StreamDeviceInfoArray* devices); | 68 void DevicesEnumeratedOnIOThread(StreamDeviceInfoArray* devices); |
69 void OpenedOnIOThread(int session_id); | 69 void OpenedOnIOThread(int session_id); |
70 void ClosedOnIOThread(int session_id); | 70 void ClosedOnIOThread(int session_id); |
71 void ErrorOnIOThread(int session_id, MediaStreamProviderError error); | |
72 | 71 |
73 bool IsOnDeviceThread() const; | 72 bool IsOnDeviceThread() const; |
74 | 73 |
75 // Only accessed on Browser::IO thread. | 74 // Only accessed on Browser::IO thread. |
76 MediaStreamProviderListener* listener_; | 75 MediaStreamProviderListener* listener_; |
77 int next_capture_session_id_; | 76 int next_capture_session_id_; |
78 typedef std::map<int, AudioInputDeviceManagerEventHandler*> EventHandlerMap; | 77 typedef std::map<int, AudioInputDeviceManagerEventHandler*> EventHandlerMap; |
79 EventHandlerMap event_handlers_; | 78 EventHandlerMap event_handlers_; |
80 | 79 |
81 // Only accessed from media stream device thread. | 80 // Only accessed from media stream device thread. |
82 typedef std::map<int, media::AudioDeviceName> AudioInputDeviceMap; | 81 typedef std::map<int, media::AudioDeviceName> AudioInputDeviceMap; |
83 AudioInputDeviceMap devices_; | 82 AudioInputDeviceMap devices_; |
84 media::AudioManager* audio_manager_; | 83 media::AudioManager* audio_manager_; |
85 | 84 |
86 // The message loop of media stream device thread that this object runs on. | 85 // The message loop of media stream device thread that this object runs on. |
87 scoped_refptr<base::MessageLoopProxy> device_loop_; | 86 scoped_refptr<base::MessageLoopProxy> device_loop_; |
88 | 87 |
89 DISALLOW_COPY_AND_ASSIGN(AudioInputDeviceManager); | 88 DISALLOW_COPY_AND_ASSIGN(AudioInputDeviceManager); |
90 }; | 89 }; |
91 | 90 |
92 } // namespace media_stream | 91 } // namespace media_stream |
93 | 92 |
94 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEVICE_MANAGER_H_ | 93 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEVICE_MANAGER_H_ |
OLD | NEW |