| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 |
| 11 // Test to verify correct stereo and multi-channel operation. | 11 // Test to verify correct stereo and multi-channel operation. |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <memory> |
| 14 #include <string> | 15 #include <string> |
| 15 #include <list> | 16 #include <list> |
| 16 | 17 |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include "webrtc/base/scoped_ptr.h" | |
| 19 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h" | 19 #include "webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.h" |
| 20 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" | 20 #include "webrtc/modules/audio_coding/neteq/include/neteq.h" |
| 21 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" | 21 #include "webrtc/modules/audio_coding/neteq/tools/input_audio_file.h" |
| 22 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" | 22 #include "webrtc/modules/audio_coding/neteq/tools/rtp_generator.h" |
| 23 #include "webrtc/test/testsupport/fileutils.h" | 23 #include "webrtc/test/testsupport/fileutils.h" |
| 24 | 24 |
| 25 namespace webrtc { | 25 namespace webrtc { |
| 26 | 26 |
| 27 struct TestParameters { | 27 struct TestParameters { |
| 28 int frame_size; | 28 int frame_size; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 uint8_t* encoded_; | 254 uint8_t* encoded_; |
| 255 uint8_t* encoded_multi_channel_; | 255 uint8_t* encoded_multi_channel_; |
| 256 int16_t output_[kMaxBlockSize]; | 256 int16_t output_[kMaxBlockSize]; |
| 257 int16_t* output_multi_channel_; | 257 int16_t* output_multi_channel_; |
| 258 WebRtcRTPHeader rtp_header_mono_; | 258 WebRtcRTPHeader rtp_header_mono_; |
| 259 WebRtcRTPHeader rtp_header_; | 259 WebRtcRTPHeader rtp_header_; |
| 260 size_t payload_size_bytes_; | 260 size_t payload_size_bytes_; |
| 261 size_t multi_payload_size_bytes_; | 261 size_t multi_payload_size_bytes_; |
| 262 int last_send_time_; | 262 int last_send_time_; |
| 263 int last_arrival_time_; | 263 int last_arrival_time_; |
| 264 rtc::scoped_ptr<test::InputAudioFile> input_file_; | 264 std::unique_ptr<test::InputAudioFile> input_file_; |
| 265 }; | 265 }; |
| 266 | 266 |
| 267 class NetEqStereoTestNoJitter : public NetEqStereoTest { | 267 class NetEqStereoTestNoJitter : public NetEqStereoTest { |
| 268 protected: | 268 protected: |
| 269 NetEqStereoTestNoJitter() | 269 NetEqStereoTestNoJitter() |
| 270 : NetEqStereoTest() { | 270 : NetEqStereoTest() { |
| 271 // Start the sender 100 ms before the receiver to pre-fill the buffer. | 271 // Start the sender 100 ms before the receiver to pre-fill the buffer. |
| 272 // This is to avoid doing preemptive expand early in the test. | 272 // This is to avoid doing preemptive expand early in the test. |
| 273 // TODO(hlundin): Mock the decision making instead to control the modes. | 273 // TODO(hlundin): Mock the decision making instead to control the modes. |
| 274 last_arrival_time_ = -100; | 274 last_arrival_time_ = -100; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 | 428 |
| 429 INSTANTIATE_TEST_CASE_P(MultiChannel, | 429 INSTANTIATE_TEST_CASE_P(MultiChannel, |
| 430 NetEqStereoTestDelays, | 430 NetEqStereoTestDelays, |
| 431 ::testing::ValuesIn(GetTestParameters())); | 431 ::testing::ValuesIn(GetTestParameters())); |
| 432 | 432 |
| 433 INSTANTIATE_TEST_CASE_P(MultiChannel, | 433 INSTANTIATE_TEST_CASE_P(MultiChannel, |
| 434 NetEqStereoTestLosses, | 434 NetEqStereoTestLosses, |
| 435 ::testing::ValuesIn(GetTestParameters())); | 435 ::testing::ValuesIn(GetTestParameters())); |
| 436 | 436 |
| 437 } // namespace webrtc | 437 } // namespace webrtc |
| OLD | NEW |