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 | 7 // browser IO thread, handles queries like |
8 // enumerate/open/close/GetOpenedDeviceInfoById from MediaStreamManager and | 8 // enumerate/open/close/GetOpenedDeviceInfoById from MediaStreamManager and |
9 // GetOpenedDeviceInfoById from AudioInputRendererHost. | 9 // GetOpenedDeviceInfoById from AudioInputRendererHost. |
10 // The work for enumerate/open/close is handled asynchronously on Media Stream | 10 // The work for enumerate/open/close is handled asynchronously on Media Stream |
(...skipping 26 matching lines...) Expand all Loading... |
37 // AudioInputDeviceManager before MediaStream is implemented. | 37 // AudioInputDeviceManager before MediaStream is implemented. |
38 // TODO(xians): Remove it when the webrtc unittest does not need it any more. | 38 // TODO(xians): Remove it when the webrtc unittest does not need it any more. |
39 static const int kFakeOpenSessionId; | 39 static const int kFakeOpenSessionId; |
40 | 40 |
41 explicit AudioInputDeviceManager(media::AudioManager* audio_manager); | 41 explicit AudioInputDeviceManager(media::AudioManager* audio_manager); |
42 | 42 |
43 // Gets the opened device info by |session_id|. Returns NULL if the device | 43 // Gets the opened device info by |session_id|. Returns NULL if the device |
44 // is not opened, otherwise the opened device. Called on IO thread. | 44 // is not opened, otherwise the opened device. Called on IO thread. |
45 const StreamDeviceInfo* GetOpenedDeviceInfoById(int session_id); | 45 const StreamDeviceInfo* GetOpenedDeviceInfoById(int session_id); |
46 | 46 |
| 47 void Unregister(); |
| 48 |
47 // MediaStreamProvider implementation, called on IO thread. | 49 // MediaStreamProvider implementation, called on IO thread. |
48 void Register(MediaStreamProviderListener* listener, | 50 void Register(MediaStreamProviderListener* listener, |
49 const scoped_refptr<base::SingleThreadTaskRunner>& | 51 const scoped_refptr<base::SingleThreadTaskRunner>& |
50 device_task_runner) override; | 52 device_task_runner) override; |
51 void Unregister() override; | |
52 void EnumerateDevices(MediaStreamType stream_type) override; | 53 void EnumerateDevices(MediaStreamType stream_type) override; |
53 int Open(const StreamDeviceInfo& device) override; | 54 int Open(const StreamDeviceInfo& device) override; |
54 void Close(int session_id) override; | 55 void Close(int session_id) override; |
55 | 56 |
56 void UseFakeDevice(); | 57 void UseFakeDevice(); |
57 bool ShouldUseFakeDevice() const; | 58 bool ShouldUseFakeDevice() const; |
58 | 59 |
59 #if defined(OS_CHROMEOS) | 60 #if defined(OS_CHROMEOS) |
60 // Registers and unregisters that a stream using keyboard mic has been opened | 61 // Registers and unregisters that a stream using keyboard mic has been opened |
61 // or closed. Keeps count of how many such streams are open and activates and | 62 // or closed. Keeps count of how many such streams are open and activates and |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 119 |
119 // The message loop of media stream device thread that this object runs on. | 120 // The message loop of media stream device thread that this object runs on. |
120 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; | 121 scoped_refptr<base::SingleThreadTaskRunner> device_task_runner_; |
121 | 122 |
122 DISALLOW_COPY_AND_ASSIGN(AudioInputDeviceManager); | 123 DISALLOW_COPY_AND_ASSIGN(AudioInputDeviceManager); |
123 }; | 124 }; |
124 | 125 |
125 } // namespace content | 126 } // namespace content |
126 | 127 |
127 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEVICE_MANAGER_H_ | 128 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEVICE_MANAGER_H_ |
OLD | NEW |