| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 uint16_t test_sequence_number; | 158 uint16_t test_sequence_number; |
| 159 uint32_t test_CSRC[webrtc::kRtpCsrcSize]; | 159 uint32_t test_CSRC[webrtc::kRtpCsrcSize]; |
| 160 SimulatedClock fake_clock; | 160 SimulatedClock fake_clock; |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 TEST_F(RtpRtcpAudioTest, Basic) { | 163 TEST_F(RtpRtcpAudioTest, Basic) { |
| 164 module1->SetSSRC(test_ssrc); | 164 module1->SetSSRC(test_ssrc); |
| 165 module1->SetStartTimestamp(test_timestamp); | 165 module1->SetStartTimestamp(test_timestamp); |
| 166 | 166 |
| 167 // Test detection at the end of a DTMF tone. | 167 // Test detection at the end of a DTMF tone. |
| 168 //EXPECT_EQ(0, module2->SetTelephoneEventForwardToDecoder(true)); | 168 // EXPECT_EQ(0, module2->SetTelephoneEventForwardToDecoder(true)); |
| 169 | 169 |
| 170 EXPECT_EQ(0, module1->SetSendingStatus(true)); | 170 EXPECT_EQ(0, module1->SetSendingStatus(true)); |
| 171 | 171 |
| 172 // Start basic RTP test. | 172 // Start basic RTP test. |
| 173 | 173 |
| 174 // Send an empty RTP packet. | 174 // Send an empty RTP packet. |
| 175 // Should fail since we have not registered the payload type. | 175 // Should fail since we have not registered the payload type. |
| 176 EXPECT_EQ(-1, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, | 176 EXPECT_EQ(-1, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, |
| 177 96, 0, -1, NULL, 0)); | 177 96, 0, -1, NULL, 0)); |
| 178 | 178 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 // Send a DTMF tone using RFC 2833 (4733). | 327 // Send a DTMF tone using RFC 2833 (4733). |
| 328 for (int i = 0; i < 16; i++) { | 328 for (int i = 0; i < 16; i++) { |
| 329 EXPECT_EQ(0, module1->SendTelephoneEventOutband(i, timeStamp, 10)); | 329 EXPECT_EQ(0, module1->SendTelephoneEventOutband(i, timeStamp, 10)); |
| 330 } | 330 } |
| 331 timeStamp += 160; // Prepare for next packet. | 331 timeStamp += 160; // Prepare for next packet. |
| 332 | 332 |
| 333 const uint8_t test[9] = "test"; | 333 const uint8_t test[9] = "test"; |
| 334 | 334 |
| 335 // Send RTP packets for 16 tones a 160 ms 100ms | 335 // Send RTP packets for 16 tones a 160 ms 100ms |
| 336 // pause between = 2560ms + 1600ms = 4160ms | 336 // pause between = 2560ms + 1600ms = 4160ms |
| 337 for (;timeStamp <= 250 * 160; timeStamp += 160) { | 337 for (; timeStamp <= 250 * 160; timeStamp += 160) { |
| 338 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, | 338 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, |
| 339 timeStamp, -1, test, 4)); | 339 timeStamp, -1, test, 4)); |
| 340 fake_clock.AdvanceTimeMilliseconds(20); | 340 fake_clock.AdvanceTimeMilliseconds(20); |
| 341 module1->Process(); | 341 module1->Process(); |
| 342 } | 342 } |
| 343 EXPECT_EQ(0, module1->SendTelephoneEventOutband(32, 9000, 10)); | 343 EXPECT_EQ(0, module1->SendTelephoneEventOutband(32, 9000, 10)); |
| 344 | 344 |
| 345 for (;timeStamp <= 740 * 160; timeStamp += 160) { | 345 for (; timeStamp <= 740 * 160; timeStamp += 160) { |
| 346 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, | 346 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, |
| 347 timeStamp, -1, test, 4)); | 347 timeStamp, -1, test, 4)); |
| 348 fake_clock.AdvanceTimeMilliseconds(20); | 348 fake_clock.AdvanceTimeMilliseconds(20); |
| 349 module1->Process(); | 349 module1->Process(); |
| 350 } | 350 } |
| 351 } | 351 } |
| 352 | 352 |
| 353 } // namespace | 353 } // namespace |
| 354 } // namespace webrtc | 354 } // namespace webrtc |
| OLD | NEW |