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 | |
11 #include "base/macros.h" | |
12 #include "base/memory/linked_ptr.h" | |
13 #include "media/audio/audio_manager_base.h" | |
14 | |
15 namespace media { | |
16 class AudioLogFactory; | |
17 } | |
18 | |
19 namespace chromecast { | |
20 | |
21 class CastAudioOutputDevice; | |
22 class ChromecastDeviceAudioOutputStream; | |
23 | |
24 class CastAudioManager : public media::AudioManagerBase { | |
gunsch
2015/04/27 16:09:11
+1 to Eric's comment about namespacing, prefer ::m
slan
2015/04/28 00:11:38
Done for entire chromecast/media/audio directory.
| |
25 public: | |
26 // This class acts as a proxy for chromecast::CastAudioOutputDevice, | |
gunsch
2015/04/27 16:09:11
Documentation nit: separate the "class" docs from
slan
2015/04/28 00:11:38
Done.
| |
27 // converting external-facing chromecast interfaces and data structures to | |
28 // those expected by media::AudioManager. It does not take ownership of | |
29 // |audio_output_device|, which must be non-null and which must outlive this | |
30 // class. All calls to CreateAudioLog() will be forwarded to | |
31 // |audio_log_factory|, which also must outlive this class. | |
32 CastAudioManager(media::AudioLogFactory* audio_log_factory, | |
33 CastAudioOutputDevice* audio_output_device); | |
byungchul
2015/04/27 17:38:06
who instantiate CastAudioOutputDevice?
slan
2015/04/28 00:11:38
|audio_output_device| should be a global instance
| |
34 ~CastAudioManager() override; | |
35 | |
36 // media::AudioManager implementation: | |
37 bool HasAudioOutputDevices() override; | |
38 bool HasAudioInputDevices() override; | |
39 void ShowAudioInputSettings() override; | |
40 void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names) override; | |
41 media::AudioParameters GetInputStreamParameters( | |
42 const std::string& device_id) override; | |
43 | |
44 // media::AudioManagerBase implementation: | |
45 media::AudioParameters GetPreferredOutputStreamParameters( | |
46 const std::string& output_device_id, | |
47 const media::AudioParameters& input_params) override; | |
48 media::AudioOutputStream* MakeLinearOutputStream( | |
49 const media::AudioParameters& params) override; | |
50 media::AudioOutputStream* MakeLowLatencyOutputStream( | |
51 const media::AudioParameters& params, | |
52 const std::string& device_id) override; | |
53 media::AudioInputStream* MakeLinearInputStream( | |
54 const media::AudioParameters& params, | |
55 const std::string& device_id) override; | |
56 media::AudioInputStream* MakeLowLatencyInputStream( | |
57 const media::AudioParameters& params, | |
58 const std::string& device_id) override; | |
59 | |
60 private: | |
61 // Host a media::AudioOutputStream interface which wraps a | |
62 // chromecast::AudioOutputStream. | |
63 media::AudioOutputStream* MakeCastOutputStream( | |
64 const media::AudioParameters& params); | |
65 | |
66 // Bindings between media and chromecast audio streams. | |
67 std::vector<linked_ptr<ChromecastDeviceAudioOutputStream>> streams_; | |
68 | |
69 // The underlying audio output device. | |
70 chromecast::CastAudioOutputDevice* audio_output_device_; | |
byungchul
2015/04/27 17:38:06
* const
slan
2015/04/28 00:11:38
Done.
| |
71 | |
72 DISALLOW_COPY_AND_ASSIGN(CastAudioManager); | |
73 }; | |
74 | |
75 } // namespace chromecast | |
76 | |
77 #endif // CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_MANAGER_H_ | |
OLD | NEW |