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_DEVICE_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ |
6 #define CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 | 10 |
11 namespace media { | 11 namespace media { |
12 class AudioInputDevice; | 12 class AudioInputDevice; |
| 13 class AudioOutputDevice; |
13 } | 14 } |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 | 17 |
17 class RendererAudioOutputDevice; | 18 // A factory for creating AudioOutputDevices. There is a global factory |
18 | |
19 // A factory for creating RendererAudioOutputDevices. There is a global factory | |
20 // function that can be installed for the purposes of testing to provide | 19 // function that can be installed for the purposes of testing to provide |
21 // a specialized AudioRendererSink class. | 20 // a specialized AudioRendererSink class. |
22 class AudioDeviceFactory { | 21 class AudioDeviceFactory { |
23 public: | 22 public: |
24 // Creates a RendererAudioOutputDevice using the currently registered factory. | 23 // Creates a AudioOutputDevice using the currently registered factory. |
25 static scoped_refptr<RendererAudioOutputDevice> NewOutputDevice(); | 24 static scoped_refptr<media::AudioOutputDevice> NewOutputDevice( |
| 25 int source_render_view_id); |
26 | 26 |
27 // Creates an AudioInputDevice using the currently registered factory, | 27 // Creates an AudioInputDevice using the currently registered factory, |
28 static scoped_refptr<media::AudioInputDevice> NewInputDevice(); | 28 static scoped_refptr<media::AudioInputDevice> NewInputDevice(); |
29 | 29 |
30 protected: | 30 protected: |
31 AudioDeviceFactory(); | 31 AudioDeviceFactory(); |
32 virtual ~AudioDeviceFactory(); | 32 virtual ~AudioDeviceFactory(); |
33 | 33 |
34 // You can derive from this class and specify an implementation for these | 34 // You can derive from this class and specify an implementation for these |
35 // functions to provide alternate audio device implementations. | 35 // functions to provide alternate audio device implementations. |
36 // If the return value of either of these function is NULL, we fall back | 36 // If the return value of either of these function is NULL, we fall back |
37 // on the default implementation. | 37 // on the default implementation. |
38 virtual RendererAudioOutputDevice* CreateOutputDevice() = 0; | 38 virtual media::AudioOutputDevice* CreateOutputDevice( |
| 39 int source_render_view_id) = 0; |
39 virtual media::AudioInputDevice* CreateInputDevice() = 0; | 40 virtual media::AudioInputDevice* CreateInputDevice() = 0; |
40 | 41 |
41 private: | 42 private: |
42 // The current globally registered factory. This is NULL when we should | 43 // The current globally registered factory. This is NULL when we should |
43 // create the default AudioRendererSinks. | 44 // create the default AudioRendererSinks. |
44 static AudioDeviceFactory* factory_; | 45 static AudioDeviceFactory* factory_; |
45 | 46 |
46 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory); | 47 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory); |
47 }; | 48 }; |
48 | 49 |
49 } // namespace content | 50 } // namespace content |
50 | 51 |
51 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ | 52 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ |
OLD | NEW |