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 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 CheckReferencesVp9(pid + 5, 1, pid + 4); | 1278 CheckReferencesVp9(pid + 5, 1, pid + 4); |
1279 CheckReferencesVp9(pid + 6, 0, pid + 4); | 1279 CheckReferencesVp9(pid + 6, 0, pid + 4); |
1280 CheckReferencesVp9(pid + 6, 1, pid + 5); | 1280 CheckReferencesVp9(pid + 6, 1, pid + 5); |
1281 CheckReferencesVp9(pid + 7, 1, pid + 6); | 1281 CheckReferencesVp9(pid + 7, 1, pid + 6); |
1282 CheckReferencesVp9(pid + 8, 0, pid + 6); | 1282 CheckReferencesVp9(pid + 8, 0, pid + 6); |
1283 CheckReferencesVp9(pid + 8, 1, pid + 7); | 1283 CheckReferencesVp9(pid + 8, 1, pid + 7); |
1284 } | 1284 } |
1285 | 1285 |
1286 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be | 1286 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be |
1287 // around M59). | 1287 // around M59). |
| 1288 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_PidJumpsForwardNoTl0PicIdx) { |
| 1289 GofInfoVP9 ss; |
| 1290 ss.SetGofInfoVP9(kTemporalStructureMode1); |
| 1291 |
| 1292 VCMPacket packet; |
| 1293 packet.timestamp = 0; |
| 1294 packet.codec = kVideoCodecVP9; |
| 1295 packet.frameType = kVideoFrameKey; |
| 1296 packet.markerBit = true; |
| 1297 packet.video_header.codecHeader.VP9.flexible_mode = false; |
| 1298 packet.video_header.codecHeader.VP9.picture_id = 0; |
| 1299 packet.video_header.codecHeader.VP9.temporal_idx = kNoTemporalIdx; |
| 1300 packet.video_header.codecHeader.VP9.spatial_idx = kNoSpatialIdx; |
| 1301 packet.video_header.codecHeader.VP9.tl0_pic_idx = kNoTl0PicIdx; |
| 1302 packet.video_header.codecHeader.VP9.temporal_up_switch = true; |
| 1303 packet.video_header.codecHeader.VP9.ss_data_available = true; |
| 1304 packet.video_header.codecHeader.VP9.gof = ss; |
| 1305 |
| 1306 ref_packet_buffer_->InsertPacket(&packet); |
| 1307 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
| 1308 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
| 1309 |
| 1310 packet.timestamp = 1; |
| 1311 packet.video_header.codecHeader.VP9.picture_id = 5000; |
| 1312 |
| 1313 ref_packet_buffer_->InsertPacket(&packet); |
| 1314 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
| 1315 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
| 1316 |
| 1317 ASSERT_EQ(2UL, frames_from_callback_.size()); |
| 1318 CheckReferencesVp9(0, 0); |
| 1319 CheckReferencesVp9(128, 0); |
| 1320 } |
| 1321 |
| 1322 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be |
| 1323 // around M59). |
1288 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_PidJumpsBackwardThenForward) { | 1324 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_PidJumpsBackwardThenForward) { |
1289 GofInfoVP9 ss; | 1325 GofInfoVP9 ss; |
1290 ss.SetGofInfoVP9(kTemporalStructureMode1); | 1326 ss.SetGofInfoVP9(kTemporalStructureMode1); |
1291 | 1327 |
1292 VCMPacket packet; | 1328 VCMPacket packet; |
1293 packet.timestamp = 0; | 1329 packet.timestamp = 0; |
1294 packet.codec = kVideoCodecVP9; | 1330 packet.codec = kVideoCodecVP9; |
1295 packet.frameType = kVideoFrameKey; | 1331 packet.frameType = kVideoFrameKey; |
1296 packet.markerBit = true; | 1332 packet.markerBit = true; |
1297 packet.video_header.codecHeader.VP9.flexible_mode = false; | 1333 packet.video_header.codecHeader.VP9.flexible_mode = false; |
1298 packet.video_header.codecHeader.VP9.picture_id = 1; | 1334 packet.video_header.codecHeader.VP9.picture_id = 1; |
1299 packet.video_header.codecHeader.VP9.temporal_idx = 0; | 1335 packet.video_header.codecHeader.VP9.temporal_idx = 0; |
1300 packet.video_header.codecHeader.VP9.spatial_idx = 0; | 1336 packet.video_header.codecHeader.VP9.spatial_idx = 0; |
1301 packet.video_header.codecHeader.VP9.tl0_pic_idx = 0; | 1337 packet.video_header.codecHeader.VP9.tl0_pic_idx = 0; |
1302 packet.video_header.codecHeader.VP9.temporal_up_switch = true; | 1338 packet.video_header.codecHeader.VP9.temporal_up_switch = true; |
1303 packet.video_header.codecHeader.VP9.ss_data_available = true; | 1339 packet.video_header.codecHeader.VP9.ss_data_available = true; |
1304 packet.video_header.codecHeader.VP9.gof = ss; | 1340 packet.video_header.codecHeader.VP9.gof = ss; |
1305 | 1341 |
1306 { | 1342 ref_packet_buffer_->InsertPacket(&packet); |
1307 ref_packet_buffer_->InsertPacket(&packet); | 1343 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1308 std::unique_ptr<RtpFrameObject> frame( | 1344 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1309 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1310 reference_finder_->ManageFrame(std::move(frame)); | |
1311 } | |
1312 | 1345 |
1313 // Timestamp goes forward but pid goes backwards. | 1346 // Timestamp goes forward but pid goes backwards. |
1314 packet.timestamp = 1; | 1347 packet.timestamp = 1; |
1315 packet.video_header.codecHeader.VP9.picture_id = 0; | 1348 packet.video_header.codecHeader.VP9.picture_id = 0; |
1316 | 1349 |
1317 { | 1350 ref_packet_buffer_->InsertPacket(&packet); |
1318 ref_packet_buffer_->InsertPacket(&packet); | 1351 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1319 std::unique_ptr<RtpFrameObject> frame( | 1352 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1320 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1321 reference_finder_->ManageFrame(std::move(frame)); | |
1322 } | |
1323 | 1353 |
1324 packet.timestamp = 2; | 1354 packet.timestamp = 2; |
1325 packet.video_header.codecHeader.VP9.picture_id = 5000; | 1355 packet.video_header.codecHeader.VP9.picture_id = 5000; |
1326 | 1356 |
1327 { | 1357 ref_packet_buffer_->InsertPacket(&packet); |
1328 ref_packet_buffer_->InsertPacket(&packet); | 1358 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1329 std::unique_ptr<RtpFrameObject> frame( | 1359 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1330 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1331 reference_finder_->ManageFrame(std::move(frame)); | |
1332 } | |
1333 | 1360 |
1334 ASSERT_EQ(3UL, frames_from_callback_.size()); | 1361 ASSERT_EQ(3UL, frames_from_callback_.size()); |
1335 CheckReferencesVp9(1, 0); | 1362 CheckReferencesVp9(1, 0); |
1336 CheckReferencesVp9(129, 0); | 1363 CheckReferencesVp9(129, 0); |
1337 CheckReferencesVp9(257, 0); | 1364 CheckReferencesVp9(257, 0); |
1338 } | 1365 } |
1339 | 1366 |
1340 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be | 1367 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be |
1341 // around M59). | 1368 // around M59). |
1342 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_Tl0JumpsBackwardThenForward) { | 1369 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_Tl0JumpsBackwardThenForward) { |
1343 GofInfoVP9 ss; | 1370 GofInfoVP9 ss; |
1344 ss.SetGofInfoVP9(kTemporalStructureMode1); | 1371 ss.SetGofInfoVP9(kTemporalStructureMode1); |
1345 | 1372 |
1346 VCMPacket packet; | 1373 VCMPacket packet; |
1347 packet.timestamp = 0; | 1374 packet.timestamp = 0; |
1348 packet.codec = kVideoCodecVP9; | 1375 packet.codec = kVideoCodecVP9; |
1349 packet.frameType = kVideoFrameKey; | 1376 packet.frameType = kVideoFrameKey; |
1350 packet.markerBit = true; | 1377 packet.markerBit = true; |
1351 packet.video_header.codecHeader.VP9.flexible_mode = false; | 1378 packet.video_header.codecHeader.VP9.flexible_mode = false; |
1352 packet.video_header.codecHeader.VP9.picture_id = 0; | 1379 packet.video_header.codecHeader.VP9.picture_id = 0; |
1353 packet.video_header.codecHeader.VP9.temporal_idx = 0; | 1380 packet.video_header.codecHeader.VP9.temporal_idx = 0; |
1354 packet.video_header.codecHeader.VP9.spatial_idx = 0; | 1381 packet.video_header.codecHeader.VP9.spatial_idx = 0; |
1355 packet.video_header.codecHeader.VP9.tl0_pic_idx = 1; | 1382 packet.video_header.codecHeader.VP9.tl0_pic_idx = 1; |
1356 packet.video_header.codecHeader.VP9.temporal_up_switch = true; | 1383 packet.video_header.codecHeader.VP9.temporal_up_switch = true; |
1357 packet.video_header.codecHeader.VP9.ss_data_available = true; | 1384 packet.video_header.codecHeader.VP9.ss_data_available = true; |
1358 packet.video_header.codecHeader.VP9.gof = ss; | 1385 packet.video_header.codecHeader.VP9.gof = ss; |
1359 { | 1386 ref_packet_buffer_->InsertPacket(&packet); |
1360 ref_packet_buffer_->InsertPacket(&packet); | 1387 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1361 std::unique_ptr<RtpFrameObject> frame( | 1388 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1362 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1363 reference_finder_->ManageFrame(std::move(frame)); | |
1364 } | |
1365 | 1389 |
1366 packet.timestamp = 1; | 1390 packet.timestamp = 1; |
1367 packet.video_header.codecHeader.VP9.picture_id = 1; | 1391 packet.video_header.codecHeader.VP9.picture_id = 1; |
1368 packet.video_header.codecHeader.VP9.tl0_pic_idx = 0; | 1392 packet.video_header.codecHeader.VP9.tl0_pic_idx = 0; |
1369 { | 1393 ref_packet_buffer_->InsertPacket(&packet); |
1370 ref_packet_buffer_->InsertPacket(&packet); | 1394 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1371 std::unique_ptr<RtpFrameObject> frame( | 1395 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1372 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1373 reference_finder_->ManageFrame(std::move(frame)); | |
1374 } | |
1375 | 1396 |
1376 packet.timestamp = 2; | 1397 packet.timestamp = 2; |
1377 packet.frameType = kVideoFrameDelta; | 1398 packet.frameType = kVideoFrameDelta; |
1378 packet.video_header.codecHeader.VP9.picture_id = 2; | 1399 packet.video_header.codecHeader.VP9.picture_id = 2; |
1379 packet.video_header.codecHeader.VP9.tl0_pic_idx = 2; | 1400 packet.video_header.codecHeader.VP9.tl0_pic_idx = 2; |
1380 { | 1401 ref_packet_buffer_->InsertPacket(&packet); |
1381 ref_packet_buffer_->InsertPacket(&packet); | 1402 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1382 std::unique_ptr<RtpFrameObject> frame( | 1403 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1383 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1384 reference_finder_->ManageFrame(std::move(frame)); | |
1385 } | |
1386 | 1404 |
1387 packet.timestamp = 3; | 1405 packet.timestamp = 3; |
1388 packet.frameType = kVideoFrameKey; | 1406 packet.frameType = kVideoFrameKey; |
1389 packet.video_header.codecHeader.VP9.ss_data_available = true; | 1407 packet.video_header.codecHeader.VP9.ss_data_available = true; |
1390 packet.video_header.codecHeader.VP9.picture_id = 3; | 1408 packet.video_header.codecHeader.VP9.picture_id = 3; |
1391 packet.video_header.codecHeader.VP9.tl0_pic_idx = 129; | 1409 packet.video_header.codecHeader.VP9.tl0_pic_idx = 129; |
1392 { | 1410 ref_packet_buffer_->InsertPacket(&packet); |
1393 ref_packet_buffer_->InsertPacket(&packet); | 1411 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1394 std::unique_ptr<RtpFrameObject> frame( | 1412 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1395 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1396 reference_finder_->ManageFrame(std::move(frame)); | |
1397 } | |
1398 | 1413 |
1399 ASSERT_EQ(4UL, frames_from_callback_.size()); | 1414 ASSERT_EQ(4UL, frames_from_callback_.size()); |
1400 CheckReferencesVp9(0, 0); | 1415 CheckReferencesVp9(0, 0); |
1401 CheckReferencesVp9(128, 0); | 1416 CheckReferencesVp9(128, 0); |
1402 CheckReferencesVp9(129, 0, 128); | 1417 CheckReferencesVp9(129, 0, 128); |
1403 CheckReferencesVp9(257, 0); | 1418 CheckReferencesVp9(257, 0); |
1404 } | 1419 } |
1405 | 1420 |
1406 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be | 1421 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be |
1407 // around M59). | 1422 // around M59). |
1408 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_PidSmallJumpForward) { | 1423 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_PidSmallJumpForward) { |
1409 GofInfoVP9 ss; | 1424 GofInfoVP9 ss; |
1410 ss.SetGofInfoVP9(kTemporalStructureMode1); | 1425 ss.SetGofInfoVP9(kTemporalStructureMode1); |
1411 | 1426 |
1412 VCMPacket packet; | 1427 VCMPacket packet; |
1413 packet.timestamp = 0; | 1428 packet.timestamp = 0; |
1414 packet.codec = kVideoCodecVP9; | 1429 packet.codec = kVideoCodecVP9; |
1415 packet.frameType = kVideoFrameKey; | 1430 packet.frameType = kVideoFrameKey; |
1416 packet.markerBit = true; | 1431 packet.markerBit = true; |
1417 packet.video_header.codecHeader.VP9.flexible_mode = false; | 1432 packet.video_header.codecHeader.VP9.flexible_mode = false; |
1418 packet.video_header.codecHeader.VP9.picture_id = 1; | 1433 packet.video_header.codecHeader.VP9.picture_id = 1; |
1419 packet.video_header.codecHeader.VP9.temporal_idx = 0; | 1434 packet.video_header.codecHeader.VP9.temporal_idx = 0; |
1420 packet.video_header.codecHeader.VP9.spatial_idx = 0; | 1435 packet.video_header.codecHeader.VP9.spatial_idx = 0; |
1421 packet.video_header.codecHeader.VP9.tl0_pic_idx = 1; | 1436 packet.video_header.codecHeader.VP9.tl0_pic_idx = 1; |
1422 packet.video_header.codecHeader.VP9.temporal_up_switch = true; | 1437 packet.video_header.codecHeader.VP9.temporal_up_switch = true; |
1423 packet.video_header.codecHeader.VP9.ss_data_available = true; | 1438 packet.video_header.codecHeader.VP9.ss_data_available = true; |
1424 packet.video_header.codecHeader.VP9.gof = ss; | 1439 packet.video_header.codecHeader.VP9.gof = ss; |
1425 { | 1440 ref_packet_buffer_->InsertPacket(&packet); |
1426 ref_packet_buffer_->InsertPacket(&packet); | 1441 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1427 std::unique_ptr<RtpFrameObject> frame( | 1442 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1428 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1429 reference_finder_->ManageFrame(std::move(frame)); | |
1430 } | |
1431 | 1443 |
1432 packet.timestamp = 1; | 1444 packet.timestamp = 1; |
1433 packet.video_header.codecHeader.VP9.picture_id = 2; | 1445 packet.video_header.codecHeader.VP9.picture_id = 2; |
1434 packet.video_header.codecHeader.VP9.tl0_pic_idx = 2; | 1446 packet.video_header.codecHeader.VP9.tl0_pic_idx = 2; |
1435 { | 1447 ref_packet_buffer_->InsertPacket(&packet); |
1436 ref_packet_buffer_->InsertPacket(&packet); | 1448 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1437 std::unique_ptr<RtpFrameObject> frame( | 1449 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1438 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1439 reference_finder_->ManageFrame(std::move(frame)); | |
1440 } | |
1441 | 1450 |
1442 packet.timestamp = 2; | 1451 packet.timestamp = 2; |
1443 packet.video_header.codecHeader.VP9.picture_id = 3; | 1452 packet.video_header.codecHeader.VP9.picture_id = 3; |
1444 packet.video_header.codecHeader.VP9.tl0_pic_idx = 2; | 1453 packet.video_header.codecHeader.VP9.tl0_pic_idx = 2; |
1445 { | 1454 ref_packet_buffer_->InsertPacket(&packet); |
1446 ref_packet_buffer_->InsertPacket(&packet); | 1455 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1447 std::unique_ptr<RtpFrameObject> frame( | 1456 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1448 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1449 reference_finder_->ManageFrame(std::move(frame)); | |
1450 } | |
1451 | 1457 |
1452 packet.timestamp = 2; | 1458 packet.timestamp = 2; |
1453 packet.video_header.codecHeader.VP9.picture_id = 4; | 1459 packet.video_header.codecHeader.VP9.picture_id = 4; |
1454 packet.video_header.codecHeader.VP9.tl0_pic_idx = 1; | 1460 packet.video_header.codecHeader.VP9.tl0_pic_idx = 1; |
1455 { | 1461 ref_packet_buffer_->InsertPacket(&packet); |
1456 ref_packet_buffer_->InsertPacket(&packet); | 1462 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1457 std::unique_ptr<RtpFrameObject> frame( | 1463 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1458 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1459 reference_finder_->ManageFrame(std::move(frame)); | |
1460 } | |
1461 | 1464 |
1462 ASSERT_EQ(4UL, frames_from_callback_.size()); | 1465 ASSERT_EQ(4UL, frames_from_callback_.size()); |
1463 CheckReferencesVp9(1, 0); | 1466 CheckReferencesVp9(1, 0); |
1464 CheckReferencesVp9(2, 0); | 1467 CheckReferencesVp9(2, 0); |
1465 CheckReferencesVp9(3, 0); | 1468 CheckReferencesVp9(3, 0); |
1466 CheckReferencesVp9(131, 0); | 1469 CheckReferencesVp9(131, 0); |
1467 } | 1470 } |
1468 | 1471 |
1469 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be | 1472 // TODO(philipel): Remove when VP9 PID/TL0 does not jump mid-stream (should be |
1470 // around M59). | 1473 // around M59). |
1471 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_DropOldFrame) { | 1474 TEST_F(TestRtpFrameReferenceFinder, Vp9PidFix_DropOldFrame) { |
1472 GofInfoVP9 ss; | 1475 GofInfoVP9 ss; |
1473 ss.SetGofInfoVP9(kTemporalStructureMode1); | 1476 ss.SetGofInfoVP9(kTemporalStructureMode1); |
1474 | 1477 |
1475 VCMPacket packet; | 1478 VCMPacket packet; |
1476 packet.timestamp = 0; | 1479 packet.timestamp = 0; |
1477 packet.codec = kVideoCodecVP9; | 1480 packet.codec = kVideoCodecVP9; |
1478 packet.frameType = kVideoFrameKey; | 1481 packet.frameType = kVideoFrameKey; |
1479 packet.markerBit = true; | 1482 packet.markerBit = true; |
1480 packet.video_header.codecHeader.VP9.flexible_mode = false; | 1483 packet.video_header.codecHeader.VP9.flexible_mode = false; |
1481 packet.video_header.codecHeader.VP9.picture_id = 1; | 1484 packet.video_header.codecHeader.VP9.picture_id = 1; |
1482 packet.video_header.codecHeader.VP9.temporal_idx = 0; | 1485 packet.video_header.codecHeader.VP9.temporal_idx = 0; |
1483 packet.video_header.codecHeader.VP9.spatial_idx = 0; | 1486 packet.video_header.codecHeader.VP9.spatial_idx = 0; |
1484 packet.video_header.codecHeader.VP9.tl0_pic_idx = 1; | 1487 packet.video_header.codecHeader.VP9.tl0_pic_idx = 1; |
1485 packet.video_header.codecHeader.VP9.temporal_up_switch = true; | 1488 packet.video_header.codecHeader.VP9.temporal_up_switch = true; |
1486 packet.video_header.codecHeader.VP9.ss_data_available = true; | 1489 packet.video_header.codecHeader.VP9.ss_data_available = true; |
1487 packet.video_header.codecHeader.VP9.gof = ss; | 1490 packet.video_header.codecHeader.VP9.gof = ss; |
1488 { | 1491 ref_packet_buffer_->InsertPacket(&packet); |
1489 ref_packet_buffer_->InsertPacket(&packet); | 1492 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1490 std::unique_ptr<RtpFrameObject> frame( | 1493 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1491 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1492 reference_finder_->ManageFrame(std::move(frame)); | |
1493 } | |
1494 | 1494 |
1495 packet.timestamp = 1; | 1495 packet.timestamp = 1; |
1496 packet.video_header.codecHeader.VP9.picture_id = 0; | 1496 packet.video_header.codecHeader.VP9.picture_id = 0; |
1497 packet.video_header.codecHeader.VP9.tl0_pic_idx = 2; | 1497 packet.video_header.codecHeader.VP9.tl0_pic_idx = 2; |
1498 { | 1498 ref_packet_buffer_->InsertPacket(&packet); |
1499 ref_packet_buffer_->InsertPacket(&packet); | 1499 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1500 std::unique_ptr<RtpFrameObject> frame( | 1500 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1501 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1502 reference_finder_->ManageFrame(std::move(frame)); | |
1503 } | |
1504 | 1501 |
1505 packet.timestamp = 0; | 1502 packet.timestamp = 0; |
1506 packet.video_header.codecHeader.VP9.picture_id = 3; | 1503 packet.video_header.codecHeader.VP9.picture_id = 3; |
1507 packet.video_header.codecHeader.VP9.tl0_pic_idx = 2; | 1504 packet.video_header.codecHeader.VP9.tl0_pic_idx = 2; |
1508 { | 1505 ref_packet_buffer_->InsertPacket(&packet); |
1509 ref_packet_buffer_->InsertPacket(&packet); | 1506 reference_finder_->ManageFrame(std::unique_ptr<RtpFrameObject>( |
1510 std::unique_ptr<RtpFrameObject> frame( | 1507 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0))); |
1511 new RtpFrameObject(ref_packet_buffer_, 0, 0, 0, 0, 0)); | |
1512 reference_finder_->ManageFrame(std::move(frame)); | |
1513 } | |
1514 | 1508 |
1515 ASSERT_EQ(2UL, frames_from_callback_.size()); | 1509 ASSERT_EQ(2UL, frames_from_callback_.size()); |
1516 CheckReferencesVp9(1, 0); | 1510 CheckReferencesVp9(1, 0); |
1517 CheckReferencesVp9(129, 0); | 1511 CheckReferencesVp9(129, 0); |
1518 } | 1512 } |
1519 | 1513 |
1520 } // namespace video_coding | 1514 } // namespace video_coding |
1521 } // namespace webrtc | 1515 } // namespace webrtc |
OLD | NEW |