Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(482)

Side by Side Diff: webrtc/modules/audio_device/ios/audio_device_unittest_ios.cc

Issue 1254883002: Refactor the AudioDevice for iOS and improve the performance and stability (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Improved error handling and added support for BT headsets Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 EXPECT_EQ(0, audio_device_->Init()); 500 EXPECT_EQ(0, audio_device_->Init());
501 EXPECT_EQ(0, 501 EXPECT_EQ(0,
502 audio_device()->GetPlayoutAudioParameters(&playout_parameters_)); 502 audio_device()->GetPlayoutAudioParameters(&playout_parameters_));
503 EXPECT_EQ(0, audio_device()->GetRecordAudioParameters(&record_parameters_)); 503 EXPECT_EQ(0, audio_device()->GetRecordAudioParameters(&record_parameters_));
504 } 504 }
505 virtual ~AudioDeviceTest() { 505 virtual ~AudioDeviceTest() {
506 EXPECT_EQ(0, audio_device_->Terminate()); 506 EXPECT_EQ(0, audio_device_->Terminate());
507 rtc::LogMessage::LogToDebug(old_sev_); 507 rtc::LogMessage::LogToDebug(old_sev_);
508 } 508 }
509 509
510 // TODO(henrika): don't use hardcoded values below.
511 int playout_sample_rate() const { return playout_parameters_.sample_rate(); } 510 int playout_sample_rate() const { return playout_parameters_.sample_rate(); }
512 int record_sample_rate() const { return record_parameters_.sample_rate(); } 511 int record_sample_rate() const { return record_parameters_.sample_rate(); }
513 int playout_channels() const { return playout_parameters_.channels(); } 512 int playout_channels() const { return playout_parameters_.channels(); }
514 int record_channels() const { return record_parameters_.channels(); } 513 int record_channels() const { return record_parameters_.channels(); }
515 size_t playout_frames_per_10ms_buffer() const { 514 size_t playout_frames_per_10ms_buffer() const {
516 return playout_parameters_.frames_per_10ms_buffer(); 515 return playout_parameters_.frames_per_10ms_buffer();
517 } 516 }
518 size_t record_frames_per_10ms_buffer() const { 517 size_t record_frames_per_10ms_buffer() const {
519 return record_parameters_.frames_per_10ms_buffer(); 518 return record_parameters_.frames_per_10ms_buffer();
520 } 519 }
521 520
522 int total_delay_ms() const {
523 // TODO(henrika): improve this part.
524 return 100;
525 }
526
527 rtc::scoped_refptr<AudioDeviceModule> audio_device() const { 521 rtc::scoped_refptr<AudioDeviceModule> audio_device() const {
528 return audio_device_; 522 return audio_device_;
529 } 523 }
530 524
531 AudioDeviceModuleImpl* audio_device_impl() const { 525 AudioDeviceModuleImpl* audio_device_impl() const {
532 return static_cast<AudioDeviceModuleImpl*>(audio_device_.get()); 526 return static_cast<AudioDeviceModuleImpl*>(audio_device_.get());
533 } 527 }
534 528
535 AudioDeviceBuffer* audio_device_buffer() const { 529 AudioDeviceBuffer* audio_device_buffer() const {
536 return audio_device_impl()->GetAudioDeviceBuffer(); 530 return audio_device_impl()->GetAudioDeviceBuffer();
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 StopPlayout(); 778 StopPlayout();
785 StopRecording(); 779 StopRecording();
786 // Verify that the correct number of transmitted impulses are detected. 780 // Verify that the correct number of transmitted impulses are detected.
787 EXPECT_EQ(latency_audio_stream->num_latency_values(), 781 EXPECT_EQ(latency_audio_stream->num_latency_values(),
788 static_cast<size_t>( 782 static_cast<size_t>(
789 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1)); 783 kImpulseFrequencyInHz * kMeasureLatencyTimeInSec - 1));
790 latency_audio_stream->PrintResults(); 784 latency_audio_stream->PrintResults();
791 } 785 }
792 786
793 } // namespace webrtc 787 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698