| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 int render_frame_id); | 92 int render_frame_id); |
| 93 | 93 |
| 94 protected: | 94 protected: |
| 95 AudioDeviceFactory(); | 95 AudioDeviceFactory(); |
| 96 virtual ~AudioDeviceFactory(); | 96 virtual ~AudioDeviceFactory(); |
| 97 | 97 |
| 98 // You can derive from this class and specify an implementation for these | 98 // You can derive from this class and specify an implementation for these |
| 99 // functions to provide alternate audio device implementations. | 99 // functions to provide alternate audio device implementations. |
| 100 // If the return value of either of these function is NULL, we fall back | 100 // If the return value of either of these function is NULL, we fall back |
| 101 // on the default implementation. | 101 // on the default implementation. |
| 102 virtual scoped_refptr<media::AudioRendererSink> CreateAudioRendererMixerSink( | 102 |
| 103 // Creates a final sink in the rendering pipeline, which represents the actual |
| 104 // output device. |
| 105 virtual scoped_refptr<media::AudioRendererSink> CreateFinalAudioRendererSink( |
| 103 int render_frame_id, | 106 int render_frame_id, |
| 104 int sesssion_id, | 107 int sesssion_id, |
| 105 const std::string& device_id, | 108 const std::string& device_id, |
| 106 const url::Origin& security_origin) = 0; | 109 const url::Origin& security_origin) = 0; |
| 107 | 110 |
| 108 virtual scoped_refptr<media::AudioRendererSink> CreateAudioRendererSink( | 111 virtual scoped_refptr<media::AudioRendererSink> CreateAudioRendererSink( |
| 109 SourceType source_type, | 112 SourceType source_type, |
| 110 int render_frame_id, | 113 int render_frame_id, |
| 111 int sesssion_id, | 114 int sesssion_id, |
| 112 const std::string& device_id, | 115 const std::string& device_id, |
| 113 const url::Origin& security_origin) = 0; | 116 const url::Origin& security_origin) = 0; |
| 114 | 117 |
| 115 virtual scoped_refptr<media::SwitchableAudioRendererSink> | 118 virtual scoped_refptr<media::SwitchableAudioRendererSink> |
| 116 CreateSwitchableAudioRendererSink(SourceType source_type, | 119 CreateSwitchableAudioRendererSink(SourceType source_type, |
| 117 int render_frame_id, | 120 int render_frame_id, |
| 118 int sesssion_id, | 121 int sesssion_id, |
| 119 const std::string& device_id, | 122 const std::string& device_id, |
| 120 const url::Origin& security_origin) = 0; | 123 const url::Origin& security_origin) = 0; |
| 121 | 124 |
| 122 virtual scoped_refptr<media::AudioCapturerSource> CreateAudioCapturerSource( | 125 virtual scoped_refptr<media::AudioCapturerSource> CreateAudioCapturerSource( |
| 123 int render_frame_id) = 0; | 126 int render_frame_id) = 0; |
| 124 | 127 |
| 125 private: | 128 private: |
| 126 // The current globally registered factory. This is NULL when we should | 129 // The current globally registered factory. This is NULL when we should |
| 127 // create the default AudioRendererSinks. | 130 // create the default AudioRendererSinks. |
| 128 static AudioDeviceFactory* factory_; | 131 static AudioDeviceFactory* factory_; |
| 129 | 132 |
| 133 static scoped_refptr<media::AudioRendererSink> NewFinalAudioRendererSink( |
| 134 int render_frame_id, |
| 135 int session_id, |
| 136 const std::string& device_id, |
| 137 const url::Origin& security_origin); |
| 138 |
| 130 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory); | 139 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory); |
| 131 }; | 140 }; |
| 132 | 141 |
| 133 } // namespace content | 142 } // namespace content |
| 134 | 143 |
| 135 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ | 144 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ |
| OLD | NEW |