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 20 matching lines...) Expand all Loading... |
31 | 31 |
32 class CONTENT_EXPORT AudioInputDeviceManager | 32 class CONTENT_EXPORT AudioInputDeviceManager |
33 : public base::RefCountedThreadSafe<AudioInputDeviceManager>, | 33 : public base::RefCountedThreadSafe<AudioInputDeviceManager>, |
34 public MediaStreamProvider { | 34 public MediaStreamProvider { |
35 public: | 35 public: |
36 // Calling Start() with this kFakeOpenSessionId will open the default device, | 36 // Calling Start() with this kFakeOpenSessionId will open the default device, |
37 // even though Open() has not been called. This is used to be able to use the | 37 // even though Open() has not been called. This is used to be able to use the |
38 // AudioInputDeviceManager before MediaStream is implemented. | 38 // AudioInputDeviceManager before MediaStream is implemented. |
39 static const int kFakeOpenSessionId; | 39 static const int kFakeOpenSessionId; |
40 | 40 |
41 static const int kInvalidSessionId; | |
42 static const char kInvalidDeviceId[]; | |
43 | |
44 explicit AudioInputDeviceManager(media::AudioManager* audio_manager); | 41 explicit AudioInputDeviceManager(media::AudioManager* audio_manager); |
45 | 42 |
46 // MediaStreamProvider implementation, called on IO thread. | 43 // MediaStreamProvider implementation, called on IO thread. |
47 virtual void Register(MediaStreamProviderListener* listener, | 44 virtual void Register(MediaStreamProviderListener* listener, |
48 base::MessageLoopProxy* device_thread_loop) OVERRIDE; | 45 base::MessageLoopProxy* device_thread_loop) OVERRIDE; |
49 virtual void Unregister() OVERRIDE; | 46 virtual void Unregister() OVERRIDE; |
50 virtual void EnumerateDevices() OVERRIDE; | 47 virtual void EnumerateDevices() OVERRIDE; |
51 virtual int Open(const StreamDeviceInfo& device) OVERRIDE; | 48 virtual int Open(const StreamDeviceInfo& device) OVERRIDE; |
52 virtual void Close(int session_id) OVERRIDE; | 49 virtual void Close(int session_id) OVERRIDE; |
53 | 50 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 85 |
89 // The message loop of media stream device thread that this object runs on. | 86 // The message loop of media stream device thread that this object runs on. |
90 scoped_refptr<base::MessageLoopProxy> device_loop_; | 87 scoped_refptr<base::MessageLoopProxy> device_loop_; |
91 | 88 |
92 DISALLOW_COPY_AND_ASSIGN(AudioInputDeviceManager); | 89 DISALLOW_COPY_AND_ASSIGN(AudioInputDeviceManager); |
93 }; | 90 }; |
94 | 91 |
95 } // namespace media_stream | 92 } // namespace media_stream |
96 | 93 |
97 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEVICE_MANAGER_H_ | 94 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_AUDIO_INPUT_DEVICE_MANAGER_H_ |
OLD | NEW |