OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 } | 494 } |
495 | 495 |
496 if (capture_.transient_suppressor_enabled != | 496 if (capture_.transient_suppressor_enabled != |
497 config.Get<ExperimentalNs>().enabled) { | 497 config.Get<ExperimentalNs>().enabled) { |
498 capture_.transient_suppressor_enabled = | 498 capture_.transient_suppressor_enabled = |
499 config.Get<ExperimentalNs>().enabled; | 499 config.Get<ExperimentalNs>().enabled; |
500 InitializeTransient(); | 500 InitializeTransient(); |
501 } | 501 } |
502 } | 502 } |
503 | 503 |
| 504 int AudioProcessingImpl::input_sample_rate_hz() const { |
| 505 // Accessed from outside APM, hence a lock is needed. |
| 506 rtc::CritScope cs(&crit_capture_); |
| 507 return formats_.api_format.input_stream().sample_rate_hz(); |
| 508 } |
| 509 |
504 int AudioProcessingImpl::proc_sample_rate_hz() const { | 510 int AudioProcessingImpl::proc_sample_rate_hz() const { |
505 // Used as callback from submodules, hence locking is not allowed. | 511 // Used as callback from submodules, hence locking is not allowed. |
506 return capture_nonlocked_.fwd_proc_format.sample_rate_hz(); | 512 return capture_nonlocked_.fwd_proc_format.sample_rate_hz(); |
507 } | 513 } |
508 | 514 |
509 int AudioProcessingImpl::proc_split_sample_rate_hz() const { | 515 int AudioProcessingImpl::proc_split_sample_rate_hz() const { |
510 // Used as callback from submodules, hence locking is not allowed. | 516 // Used as callback from submodules, hence locking is not allowed. |
511 return capture_nonlocked_.split_rate; | 517 return capture_nonlocked_.split_rate; |
512 } | 518 } |
513 | 519 |
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1484 debug_dump_.capture.event_msg->set_type(audioproc::Event::CONFIG); | 1490 debug_dump_.capture.event_msg->set_type(audioproc::Event::CONFIG); |
1485 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); | 1491 debug_dump_.capture.event_msg->mutable_config()->CopyFrom(config); |
1486 | 1492 |
1487 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), | 1493 RETURN_ON_ERR(WriteMessageToDebugFile(debug_dump_.debug_file.get(), |
1488 &crit_debug_, &debug_dump_.capture)); | 1494 &crit_debug_, &debug_dump_.capture)); |
1489 return kNoError; | 1495 return kNoError; |
1490 } | 1496 } |
1491 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP | 1497 #endif // WEBRTC_AUDIOPROC_DEBUG_DUMP |
1492 | 1498 |
1493 } // namespace webrtc | 1499 } // namespace webrtc |
OLD | NEW |