| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 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 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 620 bool FakeAudioCaptureModule::ShouldStartProcessing() { | 620 bool FakeAudioCaptureModule::ShouldStartProcessing() { |
| 621 return recording_ || playing_; | 621 return recording_ || playing_; |
| 622 } | 622 } |
| 623 | 623 |
| 624 void FakeAudioCaptureModule::UpdateProcessing(bool start) { | 624 void FakeAudioCaptureModule::UpdateProcessing(bool start) { |
| 625 if (start) { | 625 if (start) { |
| 626 if (!process_thread_) { | 626 if (!process_thread_) { |
| 627 process_thread_.reset(new rtc::Thread()); | 627 process_thread_.reset(new rtc::Thread()); |
| 628 process_thread_->Start(); | 628 process_thread_->Start(); |
| 629 } | 629 } |
| 630 process_thread_->Post(this, MSG_START_PROCESS); | 630 process_thread_->Post(RTC_FROM_HERE, this, MSG_START_PROCESS); |
| 631 } else { | 631 } else { |
| 632 if (process_thread_) { | 632 if (process_thread_) { |
| 633 process_thread_->Stop(); | 633 process_thread_->Stop(); |
| 634 process_thread_.reset(nullptr); | 634 process_thread_.reset(nullptr); |
| 635 } | 635 } |
| 636 started_ = false; | 636 started_ = false; |
| 637 } | 637 } |
| 638 } | 638 } |
| 639 | 639 |
| 640 void FakeAudioCaptureModule::StartProcessP() { | 640 void FakeAudioCaptureModule::StartProcessP() { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 661 } | 661 } |
| 662 if (recording_) { | 662 if (recording_) { |
| 663 SendFrameP(); | 663 SendFrameP(); |
| 664 } | 664 } |
| 665 } | 665 } |
| 666 | 666 |
| 667 next_frame_time_ += kTimePerFrameMs; | 667 next_frame_time_ += kTimePerFrameMs; |
| 668 const int64_t current_time = rtc::TimeMillis(); | 668 const int64_t current_time = rtc::TimeMillis(); |
| 669 const int64_t wait_time = | 669 const int64_t wait_time = |
| 670 (next_frame_time_ > current_time) ? next_frame_time_ - current_time : 0; | 670 (next_frame_time_ > current_time) ? next_frame_time_ - current_time : 0; |
| 671 process_thread_->PostDelayed(wait_time, this, MSG_RUN_PROCESS); | 671 process_thread_->PostDelayed(RTC_FROM_HERE, wait_time, this, MSG_RUN_PROCESS); |
| 672 } | 672 } |
| 673 | 673 |
| 674 void FakeAudioCaptureModule::ReceiveFrameP() { | 674 void FakeAudioCaptureModule::ReceiveFrameP() { |
| 675 ASSERT(process_thread_->IsCurrent()); | 675 ASSERT(process_thread_->IsCurrent()); |
| 676 { | 676 { |
| 677 rtc::CritScope cs(&crit_callback_); | 677 rtc::CritScope cs(&crit_callback_); |
| 678 if (!audio_callback_) { | 678 if (!audio_callback_) { |
| 679 return; | 679 return; |
| 680 } | 680 } |
| 681 ResetRecBuffer(); | 681 ResetRecBuffer(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 kNumberOfChannels, | 716 kNumberOfChannels, |
| 717 kSamplesPerSecond, kTotalDelayMs, | 717 kSamplesPerSecond, kTotalDelayMs, |
| 718 kClockDriftMs, current_mic_level, | 718 kClockDriftMs, current_mic_level, |
| 719 key_pressed, | 719 key_pressed, |
| 720 current_mic_level) != 0) { | 720 current_mic_level) != 0) { |
| 721 ASSERT(false); | 721 ASSERT(false); |
| 722 } | 722 } |
| 723 SetMicrophoneVolume(current_mic_level); | 723 SetMicrophoneVolume(current_mic_level); |
| 724 } | 724 } |
| 725 | 725 |
| OLD | NEW |