Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(586)

Side by Side Diff: content/renderer/media/audio_renderer_mixer_manager.h

Issue 1892433002: Moving device description utils from AudioManager[Base] into AudioDeviceDescription; to be shared b… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_manager_base.h" 15 #include "media/audio/audio_device_description.h"
16 #include "media/base/audio_parameters.h" 16 #include "media/base/audio_parameters.h"
17 #include "media/base/output_device_info.h" 17 #include "media/base/output_device_info.h"
18 #include "url/origin.h" 18 #include "url/origin.h"
19 19
20 namespace media { 20 namespace media {
21 class AudioHardwareConfig; 21 class AudioHardwareConfig;
22 class AudioRendererMixer; 22 class AudioRendererMixer;
23 class AudioRendererMixerInput; 23 class AudioRendererMixerInput;
24 class AudioRendererSink; 24 class AudioRendererSink;
25 } 25 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 return a.source_render_frame_id < b.source_render_frame_id; 99 return a.source_render_frame_id < b.source_render_frame_id;
100 if (a.params.channels() != b.params.channels()) 100 if (a.params.channels() != b.params.channels())
101 return a.params.channels() < b.params.channels(); 101 return a.params.channels() < b.params.channels();
102 102
103 // Ignore effects(), bits_per_sample(), format(), and frames_per_buffer(), 103 // Ignore effects(), bits_per_sample(), format(), and frames_per_buffer(),
104 // these parameters do not affect mixer reuse. All AudioRendererMixer 104 // these parameters do not affect mixer reuse. All AudioRendererMixer
105 // units disable FIFO, so frames_per_buffer() can be safely ignored. 105 // units disable FIFO, so frames_per_buffer() can be safely ignored.
106 if (a.params.channel_layout() != b.params.channel_layout()) 106 if (a.params.channel_layout() != b.params.channel_layout())
107 return a.params.channel_layout() < b.params.channel_layout(); 107 return a.params.channel_layout() < b.params.channel_layout();
108 108
109 if (media::AudioManagerBase::IsDefaultDeviceId(a.device_id) && 109 if (media::AudioDeviceDescription::IsDefaultDevice(a.device_id) &&
110 media::AudioManagerBase::IsDefaultDeviceId(b.device_id)) { 110 media::AudioDeviceDescription::IsDefaultDevice(b.device_id)) {
111 // Both device IDs represent the same default device => do not compare 111 // Both device IDs represent the same default device => do not compare
112 // them; the default device is always authorized => ignoring security 112 // them; the default device is always authorized => ignoring security
113 // origin. 113 // origin.
114 return false; 114 return false;
115 } 115 }
116 116
117 if (a.device_id != b.device_id) 117 if (a.device_id != b.device_id)
118 return a.device_id < b.device_id; 118 return a.device_id < b.device_id;
119 119
120 return a.security_origin < b.security_origin; 120 return a.security_origin < b.security_origin;
(...skipping 13 matching lines...) Expand all
134 // Active mixers. 134 // Active mixers.
135 AudioRendererMixerMap mixers_; 135 AudioRendererMixerMap mixers_;
136 base::Lock mixers_lock_; 136 base::Lock mixers_lock_;
137 137
138 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerManager); 138 DISALLOW_COPY_AND_ASSIGN(AudioRendererMixerManager);
139 }; 139 };
140 140
141 } // namespace content 141 } // namespace content
142 142
143 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_MIXER_MANAGER_H_ 143 #endif // CONTENT_RENDERER_MEDIA_AUDIO_RENDERER_MIXER_MANAGER_H_
OLDNEW
« no previous file with comments | « content/browser/speech/speech_recognizer_impl_unittest.cc ('k') | content/renderer/media/audio_renderer_mixer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698