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 |
(...skipping 332 matching lines...) Loading... |
343 TEST_F(RtpPayloadRegistryTest, InvalidRtxConfiguration) { | 343 TEST_F(RtpPayloadRegistryTest, InvalidRtxConfiguration) { |
344 rtp_payload_registry_->SetRtxSsrc(100); | 344 rtp_payload_registry_->SetRtxSsrc(100); |
345 // Fails because no mappings exist and the incoming payload type isn't known. | 345 // Fails because no mappings exist and the incoming payload type isn't known. |
346 TestRtxPacket(rtp_payload_registry_.get(), 105, 0, false); | 346 TestRtxPacket(rtp_payload_registry_.get(), 105, 0, false); |
347 // Succeeds when the mapping is used, but fails for the implicit fallback. | 347 // Succeeds when the mapping is used, but fails for the implicit fallback. |
348 rtp_payload_registry_->SetRtxPayloadType(105, 95); | 348 rtp_payload_registry_->SetRtxPayloadType(105, 95); |
349 TestRtxPacket(rtp_payload_registry_.get(), 105, 95, true); | 349 TestRtxPacket(rtp_payload_registry_.get(), 105, 95, true); |
350 TestRtxPacket(rtp_payload_registry_.get(), 106, 0, false); | 350 TestRtxPacket(rtp_payload_registry_.get(), 106, 0, false); |
351 } | 351 } |
352 | 352 |
353 TEST_F(RtpPayloadRegistryTest, AssumeRtxWrappingRed) { | |
354 rtp_payload_registry_->SetRtxSsrc(100); | |
355 // Succeeds when the mapping is used, but fails for the implicit fallback. | |
356 rtp_payload_registry_->SetRtxPayloadType(105, 95); | |
357 // Set the incoming payload type to 96, which we assume is red. | |
358 RTPHeader header; | |
359 header.payloadType = 96; | |
360 header.ssrc = 1; | |
361 rtp_payload_registry_->SetIncomingPayloadType(header); | |
362 // Recovers with correct, but unexpected, payload type since we haven't | |
363 // configured red. | |
364 TestRtxPacket(rtp_payload_registry_.get(), 105, 95, true); | |
365 bool created_new_payload; | |
366 rtp_payload_registry_->RegisterReceivePayload( | |
367 "RED", header.payloadType, 90000, 1, 0, &created_new_payload); | |
368 // Now that red is configured we expect to get the red payload type back on | |
369 // recovery because of the workaround to always recover red when configured. | |
370 TestRtxPacket(rtp_payload_registry_.get(), 105, header.payloadType, true); | |
371 } | |
372 | |
373 INSTANTIATE_TEST_CASE_P(TestDynamicRange, | 353 INSTANTIATE_TEST_CASE_P(TestDynamicRange, |
374 RtpPayloadRegistryGenericTest, | 354 RtpPayloadRegistryGenericTest, |
375 testing::Range(96, 127 + 1)); | 355 testing::Range(96, 127 + 1)); |
376 | 356 |
377 } // namespace webrtc | 357 } // namespace webrtc |
OLD | NEW |