OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 } | 153 } |
154 | 154 |
155 // Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine. | 155 // Options that can be applied to a VoiceMediaChannel or a VoiceMediaEngine. |
156 // Used to be flags, but that makes it hard to selectively apply options. | 156 // Used to be flags, but that makes it hard to selectively apply options. |
157 // We are moving all of the setting of options to structs like this, | 157 // We are moving all of the setting of options to structs like this, |
158 // but some things currently still use flags. | 158 // but some things currently still use flags. |
159 struct AudioOptions { | 159 struct AudioOptions { |
160 void SetAll(const AudioOptions& change) { | 160 void SetAll(const AudioOptions& change) { |
161 echo_cancellation.SetFrom(change.echo_cancellation); | 161 echo_cancellation.SetFrom(change.echo_cancellation); |
162 auto_gain_control.SetFrom(change.auto_gain_control); | 162 auto_gain_control.SetFrom(change.auto_gain_control); |
163 rx_auto_gain_control.SetFrom(change.rx_auto_gain_control); | |
164 noise_suppression.SetFrom(change.noise_suppression); | 163 noise_suppression.SetFrom(change.noise_suppression); |
165 highpass_filter.SetFrom(change.highpass_filter); | 164 highpass_filter.SetFrom(change.highpass_filter); |
166 stereo_swapping.SetFrom(change.stereo_swapping); | 165 stereo_swapping.SetFrom(change.stereo_swapping); |
167 audio_jitter_buffer_max_packets.SetFrom( | 166 audio_jitter_buffer_max_packets.SetFrom( |
168 change.audio_jitter_buffer_max_packets); | 167 change.audio_jitter_buffer_max_packets); |
169 audio_jitter_buffer_fast_accelerate.SetFrom( | 168 audio_jitter_buffer_fast_accelerate.SetFrom( |
170 change.audio_jitter_buffer_fast_accelerate); | 169 change.audio_jitter_buffer_fast_accelerate); |
171 typing_detection.SetFrom(change.typing_detection); | 170 typing_detection.SetFrom(change.typing_detection); |
172 aecm_generate_comfort_noise.SetFrom(change.aecm_generate_comfort_noise); | 171 aecm_generate_comfort_noise.SetFrom(change.aecm_generate_comfort_noise); |
173 conference_mode.SetFrom(change.conference_mode); | 172 conference_mode.SetFrom(change.conference_mode); |
174 adjust_agc_delta.SetFrom(change.adjust_agc_delta); | 173 adjust_agc_delta.SetFrom(change.adjust_agc_delta); |
175 experimental_agc.SetFrom(change.experimental_agc); | 174 experimental_agc.SetFrom(change.experimental_agc); |
176 extended_filter_aec.SetFrom(change.extended_filter_aec); | 175 extended_filter_aec.SetFrom(change.extended_filter_aec); |
177 delay_agnostic_aec.SetFrom(change.delay_agnostic_aec); | 176 delay_agnostic_aec.SetFrom(change.delay_agnostic_aec); |
178 experimental_ns.SetFrom(change.experimental_ns); | 177 experimental_ns.SetFrom(change.experimental_ns); |
179 aec_dump.SetFrom(change.aec_dump); | 178 aec_dump.SetFrom(change.aec_dump); |
180 tx_agc_target_dbov.SetFrom(change.tx_agc_target_dbov); | 179 tx_agc_target_dbov.SetFrom(change.tx_agc_target_dbov); |
181 tx_agc_digital_compression_gain.SetFrom( | 180 tx_agc_digital_compression_gain.SetFrom( |
182 change.tx_agc_digital_compression_gain); | 181 change.tx_agc_digital_compression_gain); |
183 tx_agc_limiter.SetFrom(change.tx_agc_limiter); | 182 tx_agc_limiter.SetFrom(change.tx_agc_limiter); |
184 rx_agc_target_dbov.SetFrom(change.rx_agc_target_dbov); | |
185 rx_agc_digital_compression_gain.SetFrom( | |
186 change.rx_agc_digital_compression_gain); | |
187 rx_agc_limiter.SetFrom(change.rx_agc_limiter); | |
188 recording_sample_rate.SetFrom(change.recording_sample_rate); | 183 recording_sample_rate.SetFrom(change.recording_sample_rate); |
189 playout_sample_rate.SetFrom(change.playout_sample_rate); | 184 playout_sample_rate.SetFrom(change.playout_sample_rate); |
190 dscp.SetFrom(change.dscp); | 185 dscp.SetFrom(change.dscp); |
191 combined_audio_video_bwe.SetFrom(change.combined_audio_video_bwe); | 186 combined_audio_video_bwe.SetFrom(change.combined_audio_video_bwe); |
192 } | 187 } |
193 | 188 |
194 bool operator==(const AudioOptions& o) const { | 189 bool operator==(const AudioOptions& o) const { |
195 return echo_cancellation == o.echo_cancellation && | 190 return echo_cancellation == o.echo_cancellation && |
196 auto_gain_control == o.auto_gain_control && | 191 auto_gain_control == o.auto_gain_control && |
197 rx_auto_gain_control == o.rx_auto_gain_control && | |
198 noise_suppression == o.noise_suppression && | 192 noise_suppression == o.noise_suppression && |
199 highpass_filter == o.highpass_filter && | 193 highpass_filter == o.highpass_filter && |
200 stereo_swapping == o.stereo_swapping && | 194 stereo_swapping == o.stereo_swapping && |
201 audio_jitter_buffer_max_packets == o.audio_jitter_buffer_max_packets && | 195 audio_jitter_buffer_max_packets == o.audio_jitter_buffer_max_packets && |
202 audio_jitter_buffer_fast_accelerate == | 196 audio_jitter_buffer_fast_accelerate == |
203 o.audio_jitter_buffer_fast_accelerate && | 197 o.audio_jitter_buffer_fast_accelerate && |
204 typing_detection == o.typing_detection && | 198 typing_detection == o.typing_detection && |
205 aecm_generate_comfort_noise == o.aecm_generate_comfort_noise && | 199 aecm_generate_comfort_noise == o.aecm_generate_comfort_noise && |
206 conference_mode == o.conference_mode && | 200 conference_mode == o.conference_mode && |
207 experimental_agc == o.experimental_agc && | 201 experimental_agc == o.experimental_agc && |
208 extended_filter_aec == o.extended_filter_aec && | 202 extended_filter_aec == o.extended_filter_aec && |
209 delay_agnostic_aec == o.delay_agnostic_aec && | 203 delay_agnostic_aec == o.delay_agnostic_aec && |
210 experimental_ns == o.experimental_ns && | 204 experimental_ns == o.experimental_ns && |
211 adjust_agc_delta == o.adjust_agc_delta && | 205 adjust_agc_delta == o.adjust_agc_delta && |
212 aec_dump == o.aec_dump && | 206 aec_dump == o.aec_dump && |
213 tx_agc_target_dbov == o.tx_agc_target_dbov && | 207 tx_agc_target_dbov == o.tx_agc_target_dbov && |
214 tx_agc_digital_compression_gain == o.tx_agc_digital_compression_gain && | 208 tx_agc_digital_compression_gain == o.tx_agc_digital_compression_gain && |
215 tx_agc_limiter == o.tx_agc_limiter && | 209 tx_agc_limiter == o.tx_agc_limiter && |
216 rx_agc_target_dbov == o.rx_agc_target_dbov && | |
217 rx_agc_digital_compression_gain == o.rx_agc_digital_compression_gain && | |
218 rx_agc_limiter == o.rx_agc_limiter && | |
219 recording_sample_rate == o.recording_sample_rate && | 210 recording_sample_rate == o.recording_sample_rate && |
220 playout_sample_rate == o.playout_sample_rate && | 211 playout_sample_rate == o.playout_sample_rate && |
221 dscp == o.dscp && | 212 dscp == o.dscp && |
222 combined_audio_video_bwe == o.combined_audio_video_bwe; | 213 combined_audio_video_bwe == o.combined_audio_video_bwe; |
223 } | 214 } |
224 | 215 |
225 std::string ToString() const { | 216 std::string ToString() const { |
226 std::ostringstream ost; | 217 std::ostringstream ost; |
227 ost << "AudioOptions {"; | 218 ost << "AudioOptions {"; |
228 ost << ToStringIfSet("aec", echo_cancellation); | 219 ost << ToStringIfSet("aec", echo_cancellation); |
229 ost << ToStringIfSet("agc", auto_gain_control); | 220 ost << ToStringIfSet("agc", auto_gain_control); |
230 ost << ToStringIfSet("rx_agc", rx_auto_gain_control); | |
231 ost << ToStringIfSet("ns", noise_suppression); | 221 ost << ToStringIfSet("ns", noise_suppression); |
232 ost << ToStringIfSet("hf", highpass_filter); | 222 ost << ToStringIfSet("hf", highpass_filter); |
233 ost << ToStringIfSet("swap", stereo_swapping); | 223 ost << ToStringIfSet("swap", stereo_swapping); |
234 ost << ToStringIfSet("audio_jitter_buffer_max_packets", | 224 ost << ToStringIfSet("audio_jitter_buffer_max_packets", |
235 audio_jitter_buffer_max_packets); | 225 audio_jitter_buffer_max_packets); |
236 ost << ToStringIfSet("audio_jitter_buffer_fast_accelerate", | 226 ost << ToStringIfSet("audio_jitter_buffer_fast_accelerate", |
237 audio_jitter_buffer_fast_accelerate); | 227 audio_jitter_buffer_fast_accelerate); |
238 ost << ToStringIfSet("typing", typing_detection); | 228 ost << ToStringIfSet("typing", typing_detection); |
239 ost << ToStringIfSet("comfort_noise", aecm_generate_comfort_noise); | 229 ost << ToStringIfSet("comfort_noise", aecm_generate_comfort_noise); |
240 ost << ToStringIfSet("conference", conference_mode); | 230 ost << ToStringIfSet("conference", conference_mode); |
241 ost << ToStringIfSet("agc_delta", adjust_agc_delta); | 231 ost << ToStringIfSet("agc_delta", adjust_agc_delta); |
242 ost << ToStringIfSet("experimental_agc", experimental_agc); | 232 ost << ToStringIfSet("experimental_agc", experimental_agc); |
243 ost << ToStringIfSet("extended_filter_aec", extended_filter_aec); | 233 ost << ToStringIfSet("extended_filter_aec", extended_filter_aec); |
244 ost << ToStringIfSet("delay_agnostic_aec", delay_agnostic_aec); | 234 ost << ToStringIfSet("delay_agnostic_aec", delay_agnostic_aec); |
245 ost << ToStringIfSet("experimental_ns", experimental_ns); | 235 ost << ToStringIfSet("experimental_ns", experimental_ns); |
246 ost << ToStringIfSet("aec_dump", aec_dump); | 236 ost << ToStringIfSet("aec_dump", aec_dump); |
247 ost << ToStringIfSet("tx_agc_target_dbov", tx_agc_target_dbov); | 237 ost << ToStringIfSet("tx_agc_target_dbov", tx_agc_target_dbov); |
248 ost << ToStringIfSet("tx_agc_digital_compression_gain", | 238 ost << ToStringIfSet("tx_agc_digital_compression_gain", |
249 tx_agc_digital_compression_gain); | 239 tx_agc_digital_compression_gain); |
250 ost << ToStringIfSet("tx_agc_limiter", tx_agc_limiter); | 240 ost << ToStringIfSet("tx_agc_limiter", tx_agc_limiter); |
251 ost << ToStringIfSet("rx_agc_target_dbov", rx_agc_target_dbov); | |
252 ost << ToStringIfSet("rx_agc_digital_compression_gain", | |
253 rx_agc_digital_compression_gain); | |
254 ost << ToStringIfSet("rx_agc_limiter", rx_agc_limiter); | |
255 ost << ToStringIfSet("recording_sample_rate", recording_sample_rate); | 241 ost << ToStringIfSet("recording_sample_rate", recording_sample_rate); |
256 ost << ToStringIfSet("playout_sample_rate", playout_sample_rate); | 242 ost << ToStringIfSet("playout_sample_rate", playout_sample_rate); |
257 ost << ToStringIfSet("dscp", dscp); | 243 ost << ToStringIfSet("dscp", dscp); |
258 ost << ToStringIfSet("combined_audio_video_bwe", combined_audio_video_bwe); | 244 ost << ToStringIfSet("combined_audio_video_bwe", combined_audio_video_bwe); |
259 ost << "}"; | 245 ost << "}"; |
260 return ost.str(); | 246 return ost.str(); |
261 } | 247 } |
262 | 248 |
263 // Audio processing that attempts to filter away the output signal from | 249 // Audio processing that attempts to filter away the output signal from |
264 // later inbound pickup. | 250 // later inbound pickup. |
265 Settable<bool> echo_cancellation; | 251 Settable<bool> echo_cancellation; |
266 // Audio processing to adjust the sensitivity of the local mic dynamically. | 252 // Audio processing to adjust the sensitivity of the local mic dynamically. |
267 Settable<bool> auto_gain_control; | 253 Settable<bool> auto_gain_control; |
268 // Audio processing to apply gain to the remote audio. | |
269 Settable<bool> rx_auto_gain_control; | |
270 // Audio processing to filter out background noise. | 254 // Audio processing to filter out background noise. |
271 Settable<bool> noise_suppression; | 255 Settable<bool> noise_suppression; |
272 // Audio processing to remove background noise of lower frequencies. | 256 // Audio processing to remove background noise of lower frequencies. |
273 Settable<bool> highpass_filter; | 257 Settable<bool> highpass_filter; |
274 // Audio processing to swap the left and right channels. | 258 // Audio processing to swap the left and right channels. |
275 Settable<bool> stereo_swapping; | 259 Settable<bool> stereo_swapping; |
276 // Audio receiver jitter buffer (NetEq) max capacity in number of packets. | 260 // Audio receiver jitter buffer (NetEq) max capacity in number of packets. |
277 Settable<int> audio_jitter_buffer_max_packets; | 261 Settable<int> audio_jitter_buffer_max_packets; |
278 // Audio receiver jitter buffer (NetEq) fast accelerate mode. | 262 // Audio receiver jitter buffer (NetEq) fast accelerate mode. |
279 Settable<bool> audio_jitter_buffer_fast_accelerate; | 263 Settable<bool> audio_jitter_buffer_fast_accelerate; |
280 // Audio processing to detect typing. | 264 // Audio processing to detect typing. |
281 Settable<bool> typing_detection; | 265 Settable<bool> typing_detection; |
282 Settable<bool> aecm_generate_comfort_noise; | 266 Settable<bool> aecm_generate_comfort_noise; |
283 Settable<bool> conference_mode; | 267 Settable<bool> conference_mode; |
284 Settable<int> adjust_agc_delta; | 268 Settable<int> adjust_agc_delta; |
285 Settable<bool> experimental_agc; | 269 Settable<bool> experimental_agc; |
286 Settable<bool> extended_filter_aec; | 270 Settable<bool> extended_filter_aec; |
287 Settable<bool> delay_agnostic_aec; | 271 Settable<bool> delay_agnostic_aec; |
288 Settable<bool> experimental_ns; | 272 Settable<bool> experimental_ns; |
289 Settable<bool> aec_dump; | 273 Settable<bool> aec_dump; |
290 // Note that tx_agc_* only applies to non-experimental AGC. | 274 // Note that tx_agc_* only applies to non-experimental AGC. |
291 Settable<uint16_t> tx_agc_target_dbov; | 275 Settable<uint16_t> tx_agc_target_dbov; |
292 Settable<uint16_t> tx_agc_digital_compression_gain; | 276 Settable<uint16_t> tx_agc_digital_compression_gain; |
293 Settable<bool> tx_agc_limiter; | 277 Settable<bool> tx_agc_limiter; |
294 Settable<uint16_t> rx_agc_target_dbov; | |
295 Settable<uint16_t> rx_agc_digital_compression_gain; | |
296 Settable<bool> rx_agc_limiter; | |
297 Settable<uint32_t> recording_sample_rate; | 278 Settable<uint32_t> recording_sample_rate; |
298 Settable<uint32_t> playout_sample_rate; | 279 Settable<uint32_t> playout_sample_rate; |
299 // Set DSCP value for packet sent from audio channel. | 280 // Set DSCP value for packet sent from audio channel. |
300 Settable<bool> dscp; | 281 Settable<bool> dscp; |
301 // Enable combined audio+bandwidth BWE. | 282 // Enable combined audio+bandwidth BWE. |
302 Settable<bool> combined_audio_video_bwe; | 283 Settable<bool> combined_audio_video_bwe; |
303 }; | 284 }; |
304 | 285 |
305 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. | 286 // Options that can be applied to a VideoMediaChannel or a VideoMediaEngine. |
306 // Used to be flags, but that makes it hard to selectively apply options. | 287 // Used to be flags, but that makes it hard to selectively apply options. |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 // Signal when the media channel is ready to send the stream. Arguments are: | 1262 // Signal when the media channel is ready to send the stream. Arguments are: |
1282 // writable(bool) | 1263 // writable(bool) |
1283 sigslot::signal1<bool> SignalReadyToSend; | 1264 sigslot::signal1<bool> SignalReadyToSend; |
1284 // Signal for notifying that the remote side has closed the DataChannel. | 1265 // Signal for notifying that the remote side has closed the DataChannel. |
1285 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; | 1266 sigslot::signal1<uint32_t> SignalStreamClosedRemotely; |
1286 }; | 1267 }; |
1287 | 1268 |
1288 } // namespace cricket | 1269 } // namespace cricket |
1289 | 1270 |
1290 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ | 1271 #endif // TALK_MEDIA_BASE_MEDIACHANNEL_H_ |
OLD | NEW |