OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 reference_finder_->PaddingReceived(sn + 4); | 293 reference_finder_->PaddingReceived(sn + 4); |
294 InsertGeneric(sn + 2, sn + 3, false); | 294 InsertGeneric(sn + 2, sn + 3, false); |
295 InsertGeneric(sn + 5, sn + 5, true); | 295 InsertGeneric(sn + 5, sn + 5, true); |
296 reference_finder_->PaddingReceived(sn + 6); | 296 reference_finder_->PaddingReceived(sn + 6); |
297 reference_finder_->PaddingReceived(sn + 9); | 297 reference_finder_->PaddingReceived(sn + 9); |
298 InsertGeneric(sn + 7, sn + 8, false); | 298 InsertGeneric(sn + 7, sn + 8, false); |
299 | 299 |
300 EXPECT_EQ(4UL, frames_from_callback_.size()); | 300 EXPECT_EQ(4UL, frames_from_callback_.size()); |
301 } | 301 } |
302 | 302 |
303 TEST_F(TestRtpFrameReferenceFinder, AdvanceSavedKeyframe) { | |
304 uint16_t sn = Rand(); | |
terelius
2017/02/20 13:19:48
With a random sequence number you have no way of k
philipel
2017/02/20 13:26:42
That is true, but the problem only occurs when the
| |
305 | |
306 InsertGeneric(sn, sn, true); | |
307 InsertGeneric(sn + 1, sn + 1, true); | |
308 InsertGeneric(sn + 2, sn + 10000, false); | |
309 InsertGeneric(sn + 10001, sn + 20000, false); | |
310 InsertGeneric(sn + 20001, sn + 30000, false); | |
311 InsertGeneric(sn + 30001, sn + 40000, false); | |
312 | |
313 EXPECT_EQ(6UL, frames_from_callback_.size()); | |
314 } | |
315 | |
303 TEST_F(TestRtpFrameReferenceFinder, ClearTo) { | 316 TEST_F(TestRtpFrameReferenceFinder, ClearTo) { |
304 uint16_t sn = Rand(); | 317 uint16_t sn = Rand(); |
305 | 318 |
306 InsertGeneric(sn, sn + 1, true); | 319 InsertGeneric(sn, sn + 1, true); |
307 InsertGeneric(sn + 4, sn + 5, false); // stashed | 320 InsertGeneric(sn + 4, sn + 5, false); // stashed |
308 EXPECT_EQ(1UL, frames_from_callback_.size()); | 321 EXPECT_EQ(1UL, frames_from_callback_.size()); |
309 | 322 |
310 InsertGeneric(sn + 6, sn + 7, true); // keyframe | 323 InsertGeneric(sn + 6, sn + 7, true); // keyframe |
311 EXPECT_EQ(2UL, frames_from_callback_.size()); | 324 EXPECT_EQ(2UL, frames_from_callback_.size()); |
312 reference_finder_->ClearTo(sn + 7); | 325 reference_finder_->ClearTo(sn + 7); |
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1478 reference_finder_->ManageFrame(std::move(frame)); | 1491 reference_finder_->ManageFrame(std::move(frame)); |
1479 } | 1492 } |
1480 | 1493 |
1481 ASSERT_EQ(2UL, frames_from_callback_.size()); | 1494 ASSERT_EQ(2UL, frames_from_callback_.size()); |
1482 CheckReferencesVp9(1, 0); | 1495 CheckReferencesVp9(1, 0); |
1483 CheckReferencesVp9(129, 0); | 1496 CheckReferencesVp9(129, 0); |
1484 } | 1497 } |
1485 | 1498 |
1486 } // namespace video_coding | 1499 } // namespace video_coding |
1487 } // namespace webrtc | 1500 } // namespace webrtc |
OLD | NEW |