| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 } | 415 } |
| 416 | 416 |
| 417 void TestAllCodecs::Run(TestPack* channel) { | 417 void TestAllCodecs::Run(TestPack* channel) { |
| 418 AudioFrame audio_frame; | 418 AudioFrame audio_frame; |
| 419 | 419 |
| 420 int32_t out_freq_hz = outfile_b_.SamplingFrequency(); | 420 int32_t out_freq_hz = outfile_b_.SamplingFrequency(); |
| 421 size_t receive_size; | 421 size_t receive_size; |
| 422 uint32_t timestamp_diff; | 422 uint32_t timestamp_diff; |
| 423 channel->reset_payload_size(); | 423 channel->reset_payload_size(); |
| 424 int error_count = 0; | 424 int error_count = 0; |
| 425 int counter = 0; |
| 426 // Set test length to 500 ms (50 blocks of 10 ms each). |
| 427 infile_a_.SetNum10MsBlocksToRead(50); |
| 428 // Fast-forward 1 second (100 blocks) since the file starts with silence. |
| 429 infile_a_.FastForward(100); |
| 425 | 430 |
| 426 int counter = 0; | |
| 427 while (!infile_a_.EndOfFile()) { | 431 while (!infile_a_.EndOfFile()) { |
| 428 // Add 10 msec to ACM. | 432 // Add 10 msec to ACM. |
| 429 infile_a_.Read10MsData(audio_frame); | 433 infile_a_.Read10MsData(audio_frame); |
| 430 CHECK_ERROR(acm_a_->Add10MsData(audio_frame)); | 434 CHECK_ERROR(acm_a_->Add10MsData(audio_frame)); |
| 431 | 435 |
| 432 // Verify that the received packet size matches the settings. | 436 // Verify that the received packet size matches the settings. |
| 433 receive_size = channel->payload_size(); | 437 receive_size = channel->payload_size(); |
| 434 if (receive_size) { | 438 if (receive_size) { |
| 435 if ((receive_size != packet_size_bytes_) && | 439 if ((receive_size != packet_size_bytes_) && |
| 436 (packet_size_bytes_ != kVariableSize)) { | 440 (packet_size_bytes_ != kVariableSize)) { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 } | 480 } |
| 477 | 481 |
| 478 void TestAllCodecs::DisplaySendReceiveCodec() { | 482 void TestAllCodecs::DisplaySendReceiveCodec() { |
| 479 CodecInst my_codec_param; | 483 CodecInst my_codec_param; |
| 480 printf("%s -> ", acm_a_->SendCodec()->plname); | 484 printf("%s -> ", acm_a_->SendCodec()->plname); |
| 481 acm_b_->ReceiveCodec(&my_codec_param); | 485 acm_b_->ReceiveCodec(&my_codec_param); |
| 482 printf("%s\n", my_codec_param.plname); | 486 printf("%s\n", my_codec_param.plname); |
| 483 } | 487 } |
| 484 | 488 |
| 485 } // namespace webrtc | 489 } // namespace webrtc |
| OLD | NEW |