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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 reference_finder_->PaddingReceived(sn + 4); | 265 reference_finder_->PaddingReceived(sn + 4); |
266 InsertGeneric(sn + 2, sn + 3, false); | 266 InsertGeneric(sn + 2, sn + 3, false); |
267 InsertGeneric(sn + 5, sn + 5, true); | 267 InsertGeneric(sn + 5, sn + 5, true); |
268 reference_finder_->PaddingReceived(sn + 6); | 268 reference_finder_->PaddingReceived(sn + 6); |
269 reference_finder_->PaddingReceived(sn + 9); | 269 reference_finder_->PaddingReceived(sn + 9); |
270 InsertGeneric(sn + 7, sn + 8, false); | 270 InsertGeneric(sn + 7, sn + 8, false); |
271 | 271 |
272 EXPECT_EQ(4UL, frames_from_callback_.size()); | 272 EXPECT_EQ(4UL, frames_from_callback_.size()); |
273 } | 273 } |
274 | 274 |
| 275 TEST_F(TestRtpFrameReferenceFinder, ClearTo) { |
| 276 uint16_t sn = Rand(); |
| 277 |
| 278 InsertGeneric(sn, sn + 1, true); |
| 279 InsertGeneric(sn + 4, sn + 5, false); // stashed |
| 280 EXPECT_EQ(1UL, frames_from_callback_.size()); |
| 281 |
| 282 InsertGeneric(sn + 6, sn + 7, true); // keyframe |
| 283 EXPECT_EQ(2UL, frames_from_callback_.size()); |
| 284 reference_finder_->ClearTo(sn + 7); |
| 285 |
| 286 InsertGeneric(sn + 8, sn + 9, false); // first frame after keyframe. |
| 287 EXPECT_EQ(3UL, frames_from_callback_.size()); |
| 288 |
| 289 InsertGeneric(sn + 2, sn + 3, false); // late, cleared past this frame. |
| 290 EXPECT_EQ(3UL, frames_from_callback_.size()); |
| 291 } |
| 292 |
275 TEST_F(TestRtpFrameReferenceFinder, Vp8NoPictureId) { | 293 TEST_F(TestRtpFrameReferenceFinder, Vp8NoPictureId) { |
276 uint16_t sn = Rand(); | 294 uint16_t sn = Rand(); |
277 | 295 |
278 InsertVp8(sn, sn + 2, true); | 296 InsertVp8(sn, sn + 2, true); |
279 ASSERT_EQ(1UL, frames_from_callback_.size()); | 297 ASSERT_EQ(1UL, frames_from_callback_.size()); |
280 | 298 |
281 InsertVp8(sn + 3, sn + 4, false); | 299 InsertVp8(sn + 3, sn + 4, false); |
282 ASSERT_EQ(2UL, frames_from_callback_.size()); | 300 ASSERT_EQ(2UL, frames_from_callback_.size()); |
283 | 301 |
284 InsertVp8(sn + 5, sn + 8, false); | 302 InsertVp8(sn + 5, sn + 8, false); |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 CheckReferencesVp9(pid + 5, 1, pid + 4); | 1204 CheckReferencesVp9(pid + 5, 1, pid + 4); |
1187 CheckReferencesVp9(pid + 6, 0, pid + 4); | 1205 CheckReferencesVp9(pid + 6, 0, pid + 4); |
1188 CheckReferencesVp9(pid + 6, 1, pid + 5); | 1206 CheckReferencesVp9(pid + 6, 1, pid + 5); |
1189 CheckReferencesVp9(pid + 7, 1, pid + 6); | 1207 CheckReferencesVp9(pid + 7, 1, pid + 6); |
1190 CheckReferencesVp9(pid + 8, 0, pid + 6); | 1208 CheckReferencesVp9(pid + 8, 0, pid + 6); |
1191 CheckReferencesVp9(pid + 8, 1, pid + 7); | 1209 CheckReferencesVp9(pid + 8, 1, pid + 7); |
1192 } | 1210 } |
1193 | 1211 |
1194 } // namespace video_coding | 1212 } // namespace video_coding |
1195 } // namespace webrtc | 1213 } // namespace webrtc |
OLD | NEW |