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