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 MEDIA_AUDIO_VIRTUAL_AUDIO_OUTPUT_STREAM_H_ | |
6 #define MEDIA_AUDIO_VIRTUAL_AUDIO_OUTPUT_STREAM_H_ | |
7 | |
8 #include "media/audio/audio_io.h" | |
9 #include "media/audio/audio_parameters.h" | |
10 #include "media/base/audio_converter.h" | |
11 | |
12 namespace media { | |
13 | |
14 class AudioManagerBase; | |
15 class VirtualAudioInputStream; | |
16 | |
17 // Audio output stream that can be used as an AudioConverter input. This class | |
Alpha Left Google
2012/11/28 01:04:47
First mention this is connected to VirtualAudioOut
justinlin
2012/11/28 14:30:31
Done.
| |
18 // substitutes for a regular audio output stream which outputs to sound | |
19 // hardware. Instead, this is used as a source of audio by a virtual audio input | |
Alpha Left Google
2012/11/28 01:04:47
by VirtualAudioOutputStream
justinlin
2012/11/28 14:30:31
Done.
| |
20 // stream. | |
21 class MEDIA_EXPORT VirtualAudioOutputStream | |
22 : public AudioOutputStream, | |
23 public AudioConverter::InputCallback { | |
24 public: | |
25 static VirtualAudioOutputStream* MakeStream(AudioManagerBase* manager, | |
26 const AudioParameters& params, | |
27 VirtualAudioInputStream* input); | |
28 | |
29 // AudioOutputStream: | |
30 virtual bool Open() OVERRIDE; | |
31 virtual void Start(AudioSourceCallback* callback) OVERRIDE; | |
32 virtual void Stop() OVERRIDE; | |
33 virtual void SetVolume(double volume) OVERRIDE; | |
34 virtual void GetVolume(double* volume) OVERRIDE; | |
35 virtual void Close() OVERRIDE; | |
36 | |
37 private: | |
38 VirtualAudioOutputStream(AudioManagerBase* manager, | |
39 const AudioParameters& params, | |
40 VirtualAudioInputStream* input); | |
41 virtual ~VirtualAudioOutputStream(); | |
42 | |
43 // AudioConverter::InputCallback: | |
44 virtual double ProvideInput(AudioBus* audio_bus, | |
45 base::TimeDelta buffer_delay) OVERRIDE; | |
46 | |
47 AudioManagerBase* audio_manager_; | |
48 AudioSourceCallback* callback_; | |
49 AudioParameters params_; | |
50 // Pointer to the virtual audio input stream this should attach to. We expect | |
51 // this pointer to always be valid because we always destroy all virtual audio | |
52 // output streams before deleting the the virtual audio input stream. | |
53 VirtualAudioInputStream* input_; | |
Alpha Left Google
2012/11/28 01:04:47
This is not really input for this class but a pair
justinlin
2012/11/28 14:30:31
Changed it to target_input_stream_. "Attached" mak
| |
54 float volume_; | |
55 bool attached_; | |
56 | |
57 DISALLOW_COPY_AND_ASSIGN(VirtualAudioOutputStream); | |
58 }; | |
59 | |
60 } // namespace media | |
61 | |
62 #endif // MEDIA_AUDIO_VIRTUAL_AUDIO_OUTPUT_STREAM_H_ | |
OLD | NEW |