OLD | NEW |
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 // A fake implementation of AudioInputStream, useful for testing purpose. | 5 // A fake implementation of AudioInputStream, useful for testing purpose. |
6 | 6 |
7 #ifndef MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ | 7 #ifndef MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ |
8 #define MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ | 8 #define MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 16 matching lines...) Expand all Loading... |
27 static AudioInputStream* MakeFakeStream(AudioManagerBase* manager, | 27 static AudioInputStream* MakeFakeStream(AudioManagerBase* manager, |
28 const AudioParameters& params); | 28 const AudioParameters& params); |
29 | 29 |
30 virtual bool Open() override; | 30 virtual bool Open() override; |
31 virtual void Start(AudioInputCallback* callback) override; | 31 virtual void Start(AudioInputCallback* callback) override; |
32 virtual void Stop() override; | 32 virtual void Stop() override; |
33 virtual void Close() override; | 33 virtual void Close() override; |
34 virtual double GetMaxVolume() override; | 34 virtual double GetMaxVolume() override; |
35 virtual void SetVolume(double volume) override; | 35 virtual void SetVolume(double volume) override; |
36 virtual double GetVolume() override; | 36 virtual double GetVolume() override; |
| 37 virtual bool IsMuted() override; |
37 virtual void SetAutomaticGainControl(bool enabled) override; | 38 virtual void SetAutomaticGainControl(bool enabled) override; |
38 virtual bool GetAutomaticGainControl() override; | 39 virtual bool GetAutomaticGainControl() override; |
39 | 40 |
40 // Generate one beep sound. This method is called by | 41 // Generate one beep sound. This method is called by |
41 // FakeVideoCaptureDevice to test audio/video synchronization. | 42 // FakeVideoCaptureDevice to test audio/video synchronization. |
42 // This is a static method because FakeVideoCaptureDevice is | 43 // This is a static method because FakeVideoCaptureDevice is |
43 // disconnected from an audio device. This means only one instance of | 44 // disconnected from an audio device. This means only one instance of |
44 // this class gets to respond, which is okay because we assume there's | 45 // this class gets to respond, which is okay because we assume there's |
45 // only one stream for this testing purpose. | 46 // only one stream for this testing purpose. |
46 // TODO(hclam): Make this non-static. To do this we'll need to fix | 47 // TODO(hclam): Make this non-static. To do this we'll need to fix |
(...skipping 27 matching lines...) Expand all Loading... |
74 // Allows us to run tasks on the FakeAudioInputStream instance which are | 75 // Allows us to run tasks on the FakeAudioInputStream instance which are |
75 // bound by its lifetime. | 76 // bound by its lifetime. |
76 base::WeakPtrFactory<FakeAudioInputStream> weak_factory_; | 77 base::WeakPtrFactory<FakeAudioInputStream> weak_factory_; |
77 | 78 |
78 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputStream); | 79 DISALLOW_COPY_AND_ASSIGN(FakeAudioInputStream); |
79 }; | 80 }; |
80 | 81 |
81 } // namespace media | 82 } // namespace media |
82 | 83 |
83 #endif // MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ | 84 #endif // MEDIA_AUDIO_FAKE_AUDIO_INPUT_STREAM_H_ |
OLD | NEW |