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

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

Issue 12383016: Merge AssociateStreamWithProducer message into CreateStream message for both audio output and input. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 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/content_renderer.gypi ('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
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 and AudioInputDevices. There is a
18 19 // global factory function that can be installed for the purposes of testing to
19 // A factory for creating RendererAudioOutputDevices. There is a global factory 20 // provide specialized implementations.
20 // function that can be installed for the purposes of testing to provide
21 // 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 an AudioOutputDevice using the currently registered factory.
25 static scoped_refptr<RendererAudioOutputDevice> NewOutputDevice(); 24 // |render_view_id| refers to the render view containing the entity producing
25 // the audio.
26 static scoped_refptr<media::AudioOutputDevice> NewOutputDevice(
27 int render_view_id);
26 28
27 // Creates an AudioInputDevice using the currently registered factory, 29 // Creates an AudioInputDevice using the currently registered factory.
28 static scoped_refptr<media::AudioInputDevice> NewInputDevice(); 30 // |render_view_id| refers to the render view containing the entity consuming
31 // the audio.
32 static scoped_refptr<media::AudioInputDevice> NewInputDevice(
33 int render_view_id);
29 34
30 protected: 35 protected:
31 AudioDeviceFactory(); 36 AudioDeviceFactory();
32 virtual ~AudioDeviceFactory(); 37 virtual ~AudioDeviceFactory();
33 38
34 // You can derive from this class and specify an implementation for these 39 // You can derive from this class and specify an implementation for these
35 // functions to provide alternate audio device implementations. 40 // functions to provide alternate audio device implementations.
36 // If the return value of either of these function is NULL, we fall back 41 // If the return value of either of these function is NULL, we fall back
37 // on the default implementation. 42 // on the default implementation.
38 virtual RendererAudioOutputDevice* CreateOutputDevice() = 0; 43 virtual media::AudioOutputDevice* CreateOutputDevice(int render_view_id) = 0;
39 virtual media::AudioInputDevice* CreateInputDevice() = 0; 44 virtual media::AudioInputDevice* CreateInputDevice(int render_view_id) = 0;
40 45
41 private: 46 private:
42 // The current globally registered factory. This is NULL when we should 47 // The current globally registered factory. This is NULL when we should
43 // create the default AudioRendererSinks. 48 // create the default AudioRendererSinks.
44 static AudioDeviceFactory* factory_; 49 static AudioDeviceFactory* factory_;
45 50
46 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory); 51 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory);
47 }; 52 };
48 53
49 } // namespace content 54 } // namespace content
50 55
51 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ 56 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_
OLDNEW
« no previous file with comments | « content/content_renderer.gypi ('k') | content/renderer/media/audio_device_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698