OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "content/common/content_export.h" |
| 11 |
| 12 namespace media { |
| 13 class AudioRendererSink; |
| 14 } |
| 15 |
| 16 namespace content { |
| 17 |
| 18 // A factory for creating AudioRendererSinks. There is a global factory |
| 19 // function that can be installed for the purposes of testing to provide |
| 20 // a specialized AudioRendererSink class. |
| 21 // This class uses the same pattern as content::RenderViewHostFactory. |
| 22 class CONTENT_EXPORT AudioDeviceFactory { |
| 23 public: |
| 24 // Creates an AudioRendererSink using the currently registered factory, |
| 25 // or the default one if no factory is registered. Ownership of the returned |
| 26 // pointer will be passed to the caller. |
| 27 static media::AudioRendererSink* Create(); |
| 28 |
| 29 protected: |
| 30 AudioDeviceFactory(); |
| 31 virtual ~AudioDeviceFactory(); |
| 32 |
| 33 // You can derive from this class and specify an implementation for this |
| 34 // function to create a different kind of AudioRendererSink for testing. |
| 35 virtual media::AudioRendererSink* CreateAudioDevice() = 0; |
| 36 |
| 37 private: |
| 38 // The current globally registered factory. This is NULL when we should |
| 39 // create the default AudioRendererSinks. |
| 40 static AudioDeviceFactory* factory_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory); |
| 43 }; |
| 44 |
| 45 } // namespace content |
| 46 |
| 47 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ |
OLD | NEW |