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

Side by Side Diff: media/audio/virtual_audio_output_stream.h

Issue 11298006: Browser-wide audio mirroring for TabCapture API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adress comments Created 8 years 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
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 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
16 // Audio output stream that can be used as an AudioConverter input. This class
17 // substitutes for a regular audio output stream which outputs to sound
18 // hardware. Instead, this is used as a source of audio by a virtual audio input
19 // stream.
20 class MEDIA_EXPORT VirtualAudioOutputStream
21 : public AudioOutputStream,
22 public AudioConverter::InputCallback {
23 public:
24 static VirtualAudioOutputStream* MakeStream(AudioManagerBase* manager,
25 const AudioParameters& params);
26
27 // AudioOutputStream:
28 virtual bool Open() OVERRIDE;
29 virtual void Start(AudioSourceCallback* callback) OVERRIDE;
30 virtual void Stop() OVERRIDE;
31 virtual void SetVolume(double volume) OVERRIDE;
32 virtual void GetVolume(double* volume) OVERRIDE;
33 virtual void Close() OVERRIDE;
34
35 private:
36 VirtualAudioOutputStream(AudioManagerBase* manager,
37 const AudioParameters& params);
38 virtual ~VirtualAudioOutputStream();
39
40 // AudioConverter::InputCallback:
41 virtual double ProvideInput(AudioBus* audio_bus,
42 base::TimeDelta buffer_delay) OVERRIDE;
43
44 AudioManagerBase* audio_manager_;
45 AudioSourceCallback* callback_;
46 float volume_;
47
48 DISALLOW_COPY_AND_ASSIGN(VirtualAudioOutputStream);
49 };
50
51 } // namespace media
52
53 #endif // MEDIA_AUDIO_VIRTUAL_AUDIO_OUTPUT_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698