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 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_MIXER_MANAGER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_MIXER_MANAGER_H_ |
6 #define CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_MIXER_MANAGER_H_ | 6 #define CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_MIXER_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "media/audio/audio_parameters.h" | 15 #include "media/audio/audio_parameters.h" |
16 #include "media/base/output_device.h" | 16 #include "media/base/output_device_info.h" |
17 #include "url/origin.h" | 17 #include "url/origin.h" |
18 | 18 |
19 namespace media { | 19 namespace media { |
20 class AudioHardwareConfig; | 20 class AudioHardwareConfig; |
21 class AudioRendererMixer; | 21 class AudioRendererMixer; |
22 class AudioRendererMixerInput; | 22 class AudioRendererMixerInput; |
23 class AudioRendererSink; | 23 class AudioRendererSink; |
24 } | 24 } |
25 | 25 |
26 namespace content { | 26 namespace content { |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 // Map of MixerKey to <AudioRendererMixer, Count>. Count allows | 112 // Map of MixerKey to <AudioRendererMixer, Count>. Count allows |
113 // AudioRendererMixerManager to keep track explicitly (v.s. RefCounted which | 113 // AudioRendererMixerManager to keep track explicitly (v.s. RefCounted which |
114 // is implicit) of the number of outstanding AudioRendererMixers. | 114 // is implicit) of the number of outstanding AudioRendererMixers. |
115 struct AudioRendererMixerReference { | 115 struct AudioRendererMixerReference { |
116 media::AudioRendererMixer* mixer; | 116 media::AudioRendererMixer* mixer; |
117 int ref_count; | 117 int ref_count; |
118 }; | 118 }; |
119 typedef std::map<MixerKey, AudioRendererMixerReference, MixerKeyCompare> | 119 typedef std::map<MixerKey, AudioRendererMixerReference, MixerKeyCompare> |
120 AudioRendererMixerMap; | 120 AudioRendererMixerMap; |
121 | 121 |
122 // Overrides the AudioRendererSink implementation for unit testing. | |
123 void SetAudioRendererSinkForTesting(media::AudioRendererSink* sink); | |
124 | |
125 // A helper to get hardware output parameters in the absence of | |
126 // AudioOutputDevice. | |
127 static media::AudioParameters GetHardwareOutputParams( | |
128 int render_frame_id, | |
129 int session_id, | |
130 const std::string& device_id, | |
131 const url::Origin& security_origin); | |
132 | |
133 // Active mixers. | 122 // Active mixers. |
134 AudioRendererMixerMap mixers_; | 123 AudioRendererMixerMap mixers_; |
135 base::Lock mixers_lock_; | 124 base::Lock mixers_lock_; |
136 | 125 |
137 media::AudioRendererSink* sink_for_testing_; | |
Henrik Grunell
2016/03/25 10:44:40
This is great to get rid of. :)
| |
138 | |
139 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerManager); | 126 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerManager); |
140 }; | 127 }; |
141 | 128 |
142 } // namespace content | 129 } // namespace content |
143 | 130 |
144 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_MIXER_MANAGER_H_ | 131 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_MIXER_MANAGER_H_ |
OLD | NEW |