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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 CheckFrame(i + 1, pid + i + 1, 0); | 256 CheckFrame(i + 1, pid + i + 1, 0); |
257 } | 257 } |
258 } | 258 } |
259 #endif // Timing dependent tests. | 259 #endif // Timing dependent tests. |
260 | 260 |
261 TEST_F(TestFrameBuffer2, ExtractFromEmptyBuffer) { | 261 TEST_F(TestFrameBuffer2, ExtractFromEmptyBuffer) { |
262 ExtractFrame(); | 262 ExtractFrame(); |
263 CheckNoFrame(0); | 263 CheckNoFrame(0); |
264 } | 264 } |
265 | 265 |
| 266 TEST_F(TestFrameBuffer2, MissingFrame) { |
| 267 uint16_t pid = Rand(); |
| 268 uint32_t ts = Rand(); |
| 269 |
| 270 InsertFrame(pid, 0, ts, false); |
| 271 InsertFrame(pid + 2, 0, ts, false, pid); |
| 272 InsertFrame(pid + 3, 0, ts, false, pid + 1, pid + 2); |
| 273 ExtractFrame(); |
| 274 ExtractFrame(); |
| 275 ExtractFrame(); |
| 276 |
| 277 CheckFrame(0, pid, 0); |
| 278 CheckFrame(1, pid + 2, 0); |
| 279 CheckNoFrame(2); |
| 280 } |
| 281 |
266 TEST_F(TestFrameBuffer2, OneLayerStream) { | 282 TEST_F(TestFrameBuffer2, OneLayerStream) { |
267 uint16_t pid = Rand(); | 283 uint16_t pid = Rand(); |
268 uint32_t ts = Rand(); | 284 uint32_t ts = Rand(); |
269 | 285 |
270 InsertFrame(pid, 0, ts, false); | 286 InsertFrame(pid, 0, ts, false); |
271 ExtractFrame(); | 287 ExtractFrame(); |
272 CheckFrame(0, pid, 0); | 288 CheckFrame(0, pid, 0); |
273 for (int i = 1; i < 10; ++i) { | 289 for (int i = 1; i < 10; ++i) { |
274 InsertFrame(pid + i, 0, ts + i * kFps10, false, pid + i - 1); | 290 InsertFrame(pid + i, 0, ts + i * kFps10, false, pid + i - 1); |
275 ExtractFrame(); | 291 ExtractFrame(); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 EXPECT_EQ(pid, InsertFrame(pid + 1, 1, ts, true, pid)); | 414 EXPECT_EQ(pid, InsertFrame(pid + 1, 1, ts, true, pid)); |
399 EXPECT_EQ(pid, InsertFrame(pid + 2, 0, ts, false, pid + 1)); | 415 EXPECT_EQ(pid, InsertFrame(pid + 2, 0, ts, false, pid + 1)); |
400 EXPECT_EQ(pid, InsertFrame(pid + 2, 1, ts, true, pid + 1)); | 416 EXPECT_EQ(pid, InsertFrame(pid + 2, 1, ts, true, pid + 1)); |
401 EXPECT_EQ(pid, InsertFrame(pid + 3, 0, ts, false, pid + 2)); | 417 EXPECT_EQ(pid, InsertFrame(pid + 3, 0, ts, false, pid + 2)); |
402 EXPECT_EQ(pid + 3, InsertFrame(pid + 1, 0, ts, false, pid)); | 418 EXPECT_EQ(pid + 3, InsertFrame(pid + 1, 0, ts, false, pid)); |
403 EXPECT_EQ(pid + 3, InsertFrame(pid + 3, 1, ts, true, pid + 2)); | 419 EXPECT_EQ(pid + 3, InsertFrame(pid + 3, 1, ts, true, pid + 2)); |
404 } | 420 } |
405 | 421 |
406 } // namespace video_coding | 422 } // namespace video_coding |
407 } // namespace webrtc | 423 } // namespace webrtc |
OLD | NEW |