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_DEVICE_FACTORY_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ |
6 #define CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ | 6 #define CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 30 matching lines...) Expand all Loading... | |
41 kSourceMediaElement, | 41 kSourceMediaElement, |
42 kSourceWebRtc, | 42 kSourceWebRtc, |
43 kSourceNonRtcAudioTrack, | 43 kSourceNonRtcAudioTrack, |
44 kSourceWebAudioInteractive, | 44 kSourceWebAudioInteractive, |
45 kSourceWebAudioBalanced, | 45 kSourceWebAudioBalanced, |
46 kSourceWebAudioPlayback, | 46 kSourceWebAudioPlayback, |
47 kSourceWebAudioExact, | 47 kSourceWebAudioExact, |
48 kSourceLast = kSourceWebAudioExact // Only used for validation of format. | 48 kSourceLast = kSourceWebAudioExact // Only used for validation of format. |
49 }; | 49 }; |
50 | 50 |
51 // TODO(olka, guidou): replace with actulal frame id everywhere. | |
Guido Urdaneta
2016/07/06 14:16:16
fix typo: s/actulal/actual
| |
52 enum { kUnknownFrameIdForDefaultDevice = 1 }; | |
DaleCurtis
2016/07/06 18:53:36
Why do we need this? Should we instead just have a
miu
2016/07/06 19:10:57
Not sure if I understand everything going on here,
o1ka
2016/07/13 09:52:41
removed
| |
53 | |
51 // Creates a sink for AudioRendererMixer. | 54 // Creates a sink for AudioRendererMixer. |
52 // |render_frame_id| refers to the RenderFrame containing the entity | 55 // |render_frame_id| refers to the RenderFrame containing the entity |
53 // producing the audio. If |session_id| is nonzero, it is used by the browser | 56 // producing the audio. If |session_id| is nonzero, it is used by the browser |
54 // to select the correct input device ID and its associated output device, if | 57 // to select the correct input device ID and its associated output device, if |
55 // it exists. If |session_id| is zero, |device_id| and |security_origin| | 58 // it exists. If |session_id| is zero, |device_id| and |security_origin| |
56 // identify the output device to use. | 59 // identify the output device to use. |
57 // If |session_id| is zero and |device_id| and |security_origin| are empty, | 60 // If |session_id| is zero and |device_id| and |security_origin| are empty, |
58 // the default output device will be selected. | 61 // the default output device will be selected. |
59 static scoped_refptr<media::AudioRendererSink> NewAudioRendererMixerSink( | 62 static scoped_refptr<media::AudioRendererSink> NewAudioRendererMixerSink( |
60 int render_frame_id, | 63 int render_frame_id, |
(...skipping 17 matching lines...) Expand all Loading... | |
78 // Basing on |source_type| and build configuration, audio played out through | 81 // Basing on |source_type| and build configuration, audio played out through |
79 // the sink goes to AOD directly or can be mixed with other audio before that. | 82 // the sink goes to AOD directly or can be mixed with other audio before that. |
80 static scoped_refptr<media::SwitchableAudioRendererSink> | 83 static scoped_refptr<media::SwitchableAudioRendererSink> |
81 NewSwitchableAudioRendererSink(SourceType source_type, | 84 NewSwitchableAudioRendererSink(SourceType source_type, |
82 int render_frame_id, | 85 int render_frame_id, |
83 int session_id, | 86 int session_id, |
84 const std::string& device_id, | 87 const std::string& device_id, |
85 const url::Origin& security_origin); | 88 const url::Origin& security_origin); |
86 | 89 |
87 // A helper to get device info in the absence of AudioOutputDevice. | 90 // A helper to get device info in the absence of AudioOutputDevice. |
91 // Must be called on renderer thread only. | |
88 static media::OutputDeviceInfo GetOutputDeviceInfo( | 92 static media::OutputDeviceInfo GetOutputDeviceInfo( |
89 int render_frame_id, | 93 int render_frame_id, |
90 int session_id, | 94 int session_id, |
91 const std::string& device_id, | 95 const std::string& device_id, |
92 const url::Origin& security_origin); | 96 const url::Origin& security_origin); |
93 | 97 |
94 // Creates an AudioCapturerSource using the currently registered factory. | 98 // Creates an AudioCapturerSource using the currently registered factory. |
95 // |render_frame_id| refers to the RenderFrame containing the entity | 99 // |render_frame_id| refers to the RenderFrame containing the entity |
96 // consuming the audio. | 100 // consuming the audio. |
97 static scoped_refptr<media::AudioCapturerSource> NewAudioCapturerSource( | 101 static scoped_refptr<media::AudioCapturerSource> NewAudioCapturerSource( |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 int session_id, | 145 int session_id, |
142 const std::string& device_id, | 146 const std::string& device_id, |
143 const url::Origin& security_origin); | 147 const url::Origin& security_origin); |
144 | 148 |
145 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory); | 149 DISALLOW_COPY_AND_ASSIGN(AudioDeviceFactory); |
146 }; | 150 }; |
147 | 151 |
148 } // namespace content | 152 } // namespace content |
149 | 153 |
150 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ | 154 #endif // CONTENT_RENDERER_MEDIA_AUDIO_DEVICE_FACTORY_H_ |
OLD | NEW |