OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
324 int32_t SetMicrophoneMute(bool enable) override { | 324 int32_t SetMicrophoneMute(bool enable) override { |
325 FATAL() << "Not implemented"; | 325 FATAL() << "Not implemented"; |
326 return -1; | 326 return -1; |
327 } | 327 } |
328 | 328 |
329 int32_t MicrophoneMute(bool& enabled) const override { | 329 int32_t MicrophoneMute(bool& enabled) const override { |
330 FATAL() << "Not implemented"; | 330 FATAL() << "Not implemented"; |
331 return -1; | 331 return -1; |
332 } | 332 } |
333 | 333 |
334 // Returns true if the audio manager has been configured to support stereo | |
335 // and false otherwised. Default is mono. | |
334 int32_t StereoPlayoutIsAvailable(bool& available) override { | 336 int32_t StereoPlayoutIsAvailable(bool& available) override { |
335 LOG(INFO) << __FUNCTION__; | 337 LOG(INFO) << __FUNCTION__; |
336 available = false; | 338 available = audio_manager_->IsStereoPlayoutSupported(); |
337 return 0; | 339 return 0; |
338 } | 340 } |
339 | 341 |
340 // TODO(henrika): add support. | |
341 int32_t SetStereoPlayout(bool enable) override { | 342 int32_t SetStereoPlayout(bool enable) override { |
342 LOG(INFO) << __FUNCTION__; | 343 LOG(INFO) << __FUNCTION__; |
343 // Allow disabling stereo playout, as that matches returning false(0) from | 344 bool available = audio_manager_->IsStereoPlayoutSupported(); |
344 // StereoPlayoutIsAvailable and is the default case. | 345 // Android does not support changes between mono and stero on the fly. |
345 return enable ? -1 : 0; | 346 // Instead, the native audio layer is configured via the aduio manager |
hlundin-webrtc
2017/09/11 07:43:42
Typo: aduio -> audio
| |
347 // to either support mono or stereo. It is allowed to call this method | |
348 // if that same state is not modified. | |
349 return (enable == available) ? 0 : -1; | |
346 } | 350 } |
347 | 351 |
348 // TODO(henrika): add support. | |
349 int32_t StereoPlayout(bool& enabled) const override { | 352 int32_t StereoPlayout(bool& enabled) const override { |
350 enabled = false; | 353 enabled = audio_manager_->IsStereoPlayoutSupported(); |
351 FATAL() << "Should never be called"; | 354 return 0; |
352 return -1; | |
353 } | 355 } |
354 | 356 |
355 int32_t StereoRecordingIsAvailable(bool& available) override { | 357 int32_t StereoRecordingIsAvailable(bool& available) override { |
356 LOG(INFO) << __FUNCTION__; | 358 LOG(INFO) << __FUNCTION__; |
357 available = false; | 359 available = audio_manager_->IsStereoRecordSupported(); |
358 return 0; | 360 return 0; |
359 } | 361 } |
360 | 362 |
361 int32_t SetStereoRecording(bool enable) override { | 363 int32_t SetStereoRecording(bool enable) override { |
362 LOG(INFO) << __FUNCTION__; | 364 LOG(INFO) << __FUNCTION__; |
363 return -1; | 365 bool available = audio_manager_->IsStereoRecordSupported(); |
366 // Android does not support changes between mono and stero on the fly. | |
367 // Instead, the native audio layer is configured via the aduio manager | |
hlundin-webrtc
2017/09/11 07:43:42
Typo: aduio -> audio
| |
368 // to either support mono or stereo. It is allowed to call this method | |
369 // if that same state is not modified. | |
370 return (enable == available) ? 0 : -1; | |
364 } | 371 } |
365 | 372 |
366 int32_t StereoRecording(bool& enabled) const override { | 373 int32_t StereoRecording(bool& enabled) const override { |
367 LOG(INFO) << __FUNCTION__; | 374 LOG(INFO) << __FUNCTION__; |
368 enabled = false; | 375 enabled = audio_manager_->IsStereoRecordSupported(); |
369 return 0; | 376 return 0; |
370 } | 377 } |
371 | 378 |
372 int32_t PlayoutDelay(uint16_t& delay_ms) const override { | 379 int32_t PlayoutDelay(uint16_t& delay_ms) const override { |
373 // Best guess we can do is to use half of the estimated total delay. | 380 // Best guess we can do is to use half of the estimated total delay. |
374 delay_ms = audio_manager_->GetDelayEstimateInMilliseconds() / 2; | 381 delay_ms = audio_manager_->GetDelayEstimateInMilliseconds() / 2; |
375 RTC_DCHECK_GT(delay_ms, 0); | 382 RTC_DCHECK_GT(delay_ms, 0); |
376 return 0; | 383 return 0; |
377 } | 384 } |
378 | 385 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
502 OutputType output_; | 509 OutputType output_; |
503 | 510 |
504 InputType input_; | 511 InputType input_; |
505 | 512 |
506 bool initialized_; | 513 bool initialized_; |
507 }; | 514 }; |
508 | 515 |
509 } // namespace webrtc | 516 } // namespace webrtc |
510 | 517 |
511 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_DEVICE_TEMPLATE_H_ | 518 #endif // WEBRTC_MODULES_AUDIO_DEVICE_ANDROID_AUDIO_DEVICE_TEMPLATE_H_ |
OLD | NEW |