OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_MANAGER_H_ | |
6 #define CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_MANAGER_H_ | |
7 | |
8 #include <string> | |
9 #include <vector> | |
10 #include "base/macros.h" | |
lcwu1
2015/04/24 02:18:24
Keep a vertical space between C++ system headers a
slan
2015/04/24 05:34:26
Done.
| |
11 #include "base/memory/linked_ptr.h" | |
12 #include "media/audio/audio_manager_base.h" | |
13 | |
14 namespace chromecast { | |
15 class CastAudioStreamProvider; | |
16 } | |
17 | |
18 namespace media { | |
lcwu1
2015/04/24 02:18:24
Any reason why you want this to be outside of chro
slan
2015/04/24 05:34:26
I did this to add readability and avoid name colli
| |
19 | |
20 class AudioLogFactory; | |
21 class CastAudioOutputStream; | |
22 | |
23 class MEDIA_EXPORT CastAudioManager : public AudioManagerBase { | |
24 public: | |
25 // This class acts as a proxy for chromecast::CastAudioStreamProvider, | |
26 // converting external-facing chromecast interfces and data structures to | |
27 // those expected by media::AudioManager. It does not take ownership of | |
28 // |audio_stream_provider|, which must be non-null and which must outlive | |
29 // this class. All calls to CreateAudioLog() will be forwarded to | |
30 // |audio_log_factory|, which also must outlive this class. | |
31 CastAudioManager(AudioLogFactory* audio_log_factory, | |
32 chromecast::CastAudioStreamProvider* audio_stream_provider); | |
33 ~CastAudioManager() override; | |
34 | |
35 // AudioManager overrides. | |
lcwu1
2015/04/24 02:18:24
Our convention is to use
// AudioManager implemen
slan
2015/04/24 05:34:26
Done.
| |
36 bool HasAudioOutputDevices() override; | |
37 bool HasAudioInputDevices() override; | |
38 void ShowAudioInputSettings() override; | |
39 void GetAudioInputDeviceNames(AudioDeviceNames* device_names) override; | |
40 AudioParameters GetInputStreamParameters( | |
41 const std::string& device_id) override; | |
42 | |
43 // AudioManagerBase overrides. | |
44 AudioParameters GetPreferredOutputStreamParameters( | |
45 const std::string& output_device_id, | |
46 const AudioParameters& input_params) override; | |
47 AudioOutputStream* MakeLinearOutputStream( | |
48 const AudioParameters& params) override; | |
49 AudioOutputStream* MakeLowLatencyOutputStream( | |
50 const AudioParameters& params, | |
51 const std::string& device_id) override; | |
52 AudioInputStream* MakeLinearInputStream( | |
53 const AudioParameters& params, | |
54 const std::string& device_id) override; | |
55 AudioInputStream* MakeLowLatencyInputStream( | |
56 const AudioParameters& params, | |
57 const std::string& device_id) override; | |
58 | |
59 private: | |
60 // Host a media::AudioOutputStream interface which wraps a | |
61 // chromecast::AudioOutputStream. | |
62 AudioOutputStream* MakeCastOutputStream(const AudioParameters& params); | |
63 | |
64 // Bindings between media and chromecast audio streams. | |
65 std::vector<linked_ptr<CastAudioOutputStream>> streams_; | |
66 chromecast::CastAudioStreamProvider* audio_stream_provider_; | |
67 | |
68 DISALLOW_COPY_AND_ASSIGN(CastAudioManager); | |
69 }; | |
70 | |
71 } // namespace media | |
72 | |
73 #endif // CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_MANAGER_H_ | |
OLD | NEW |