OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 MEDIA_AUDIO_FAKE_AUDIO_MANAGER_H_ | 5 #ifndef MEDIA_AUDIO_FAKE_AUDIO_MANAGER_H_ |
6 #define MEDIA_AUDIO_FAKE_AUDIO_MANAGER_H_ | 6 #define MEDIA_AUDIO_FAKE_AUDIO_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "media/audio/audio_manager_base.h" | 11 #include "media/audio/audio_manager_base.h" |
12 #include "media/audio/fake_audio_input_stream.h" | 12 #include "media/audio/fake_audio_input_stream.h" |
13 #include "media/audio/fake_audio_output_stream.h" | 13 #include "media/audio/fake_audio_output_stream.h" |
14 | 14 |
15 namespace media { | 15 namespace media { |
16 | 16 |
17 class MEDIA_EXPORT FakeAudioManager : public AudioManagerBase { | 17 class MEDIA_EXPORT FakeAudioManager : public AudioManagerBase { |
18 public: | 18 public: |
19 FakeAudioManager( | 19 FakeAudioManager(std::unique_ptr<AudioThread> audio_thread, |
20 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 20 AudioLogFactory* audio_log_factory); |
21 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, | 21 ~FakeAudioManager() override; |
22 AudioLogFactory* audio_log_factory); | |
23 | 22 |
24 // Implementation of AudioManager. | 23 // Implementation of AudioManager. |
25 bool HasAudioOutputDevices() override; | 24 bool HasAudioOutputDevices() override; |
26 bool HasAudioInputDevices() override; | 25 bool HasAudioInputDevices() override; |
27 const char* GetName() override; | 26 const char* GetName() override; |
28 | 27 |
29 // Implementation of AudioManagerBase. | 28 // Implementation of AudioManagerBase. |
30 AudioOutputStream* MakeLinearOutputStream( | 29 AudioOutputStream* MakeLinearOutputStream( |
31 const AudioParameters& params, | 30 const AudioParameters& params, |
32 const LogCallback& log_callback) override; | 31 const LogCallback& log_callback) override; |
33 AudioOutputStream* MakeLowLatencyOutputStream( | 32 AudioOutputStream* MakeLowLatencyOutputStream( |
34 const AudioParameters& params, | 33 const AudioParameters& params, |
35 const std::string& device_id, | 34 const std::string& device_id, |
36 const LogCallback& log_callback) override; | 35 const LogCallback& log_callback) override; |
37 AudioInputStream* MakeLinearInputStream( | 36 AudioInputStream* MakeLinearInputStream( |
38 const AudioParameters& params, | 37 const AudioParameters& params, |
39 const std::string& device_id, | 38 const std::string& device_id, |
40 const LogCallback& log_callback) override; | 39 const LogCallback& log_callback) override; |
41 AudioInputStream* MakeLowLatencyInputStream( | 40 AudioInputStream* MakeLowLatencyInputStream( |
42 const AudioParameters& params, | 41 const AudioParameters& params, |
43 const std::string& device_id, | 42 const std::string& device_id, |
44 const LogCallback& log_callback) override; | 43 const LogCallback& log_callback) override; |
45 AudioParameters GetInputStreamParameters( | 44 AudioParameters GetInputStreamParameters( |
46 const std::string& device_id) override; | 45 const std::string& device_id) override; |
47 | 46 |
48 protected: | 47 protected: |
49 ~FakeAudioManager() override; | |
50 | |
51 AudioParameters GetPreferredOutputStreamParameters( | 48 AudioParameters GetPreferredOutputStreamParameters( |
52 const std::string& output_device_id, | 49 const std::string& output_device_id, |
53 const AudioParameters& input_params) override; | 50 const AudioParameters& input_params) override; |
54 | 51 |
55 private: | 52 private: |
56 DISALLOW_COPY_AND_ASSIGN(FakeAudioManager); | 53 DISALLOW_COPY_AND_ASSIGN(FakeAudioManager); |
57 }; | 54 }; |
58 | 55 |
59 } // namespace media | 56 } // namespace media |
60 | 57 |
61 #endif // MEDIA_AUDIO_FAKE_AUDIO_MANAGER_H_ | 58 #endif // MEDIA_AUDIO_FAKE_AUDIO_MANAGER_H_ |
OLD | NEW |