Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1693)

Side by Side Diff: content/renderer/media/audio_device_factory.h

Issue 10537121: Adds AudioDevice factory for all audio clients in Chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/renderer/media/audio_device.cc ('k') | content/renderer/media/audio_device_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_
OLDNEW
« no previous file with comments | « content/renderer/media/audio_device.cc ('k') | content/renderer/media/audio_device_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698