Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "media/base/android/media_codec_bridge.h" | 10 #include "media/base/android/media_codec_bridge.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 424 // Send back the seek done notification. This should trigger the player to | 424 // Send back the seek done notification. This should trigger the player to |
| 425 // call OnReadFromDemuxer() again. | 425 // call OnReadFromDemuxer() again. |
| 426 EXPECT_EQ(original_num_data_requests, demuxer_->num_data_requests()); | 426 EXPECT_EQ(original_num_data_requests, demuxer_->num_data_requests()); |
| 427 player_.OnDemuxerSeekDone(kNoTimestamp()); | 427 player_.OnDemuxerSeekDone(kNoTimestamp()); |
| 428 EXPECT_EQ(original_num_data_requests + 1, demuxer_->num_data_requests()); | 428 EXPECT_EQ(original_num_data_requests + 1, demuxer_->num_data_requests()); |
| 429 | 429 |
| 430 // No other seek should have been requested. | 430 // No other seek should have been requested. |
| 431 EXPECT_EQ(original_num_seeks + 1, demuxer_->num_seek_requests()); | 431 EXPECT_EQ(original_num_seeks + 1, demuxer_->num_seek_requests()); |
| 432 } | 432 } |
| 433 | 433 |
| 434 // Preroll the decoder job to |target_timestamp|. The first access unit | |
| 435 // to decode have a timestamp equal to |start_timestamp|. | |
|
wolenetz
2014/01/02 19:24:53
nit: s/have/will have/ ?
qinmin
2014/01/02 22:57:01
Done.
| |
| 436 void PrerollDecoderToTime(bool is_audio, | |
| 437 const base::TimeDelta& start_timestamp, | |
| 438 const base::TimeDelta& target_timestamp) { | |
| 439 EXPECT_EQ(target_timestamp, player_.GetCurrentTime()); | |
| 440 // |start_timestamp| must be smaller than |target_timestamp|. | |
| 441 // This simulates the common condition that AUs received after browser | |
| 442 // seek begin with timestamps before the seek target, and don't | |
| 443 // immediately complete preroll. | |
| 444 EXPECT_LE(start_timestamp, target_timestamp); | |
| 445 DemuxerData data = is_audio ? CreateReadFromDemuxerAckForAudio(1) : | |
| 446 CreateReadFromDemuxerAckForVideo(); | |
| 447 int current_timestamp = start_timestamp.InMilliseconds(); | |
| 448 | |
| 449 // Send some data with access unit timestamps before the preroll_time, and | |
|
wolenetz
2014/01/02 19:24:53
nit: s/preroll_time/|target_timestamp|/ ?
qinmin
2014/01/02 22:57:01
Done.
| |
| 450 // continue sending the data until preroll finishes. | |
| 451 // This simulates the common condition that AUs received after browser | |
|
wolenetz
2014/01/02 19:24:53
nit: de-duplicate this versus earlier comment.
qinmin
2014/01/02 22:57:01
Done.
| |
| 452 // seek begin with timestamps before the seek target, and don't | |
| 453 // immediately complete preroll. | |
| 454 while (player_.GetCurrentTime() == target_timestamp) { | |
|
acolwell GONE FROM CHROMIUM
2014/01/02 19:07:49
Could you use IsPrerolling(is_audio) here instead?
| |
| 455 data.access_units[0].timestamp = | |
| 456 base::TimeDelta::FromMilliseconds(current_timestamp); | |
| 457 player_.OnDemuxerDataAvailable(data); | |
| 458 EXPECT_TRUE(GetMediaDecoderJob(is_audio)->is_decoding()); | |
| 459 current_timestamp += 30; | |
| 460 message_loop_.Run(); | |
| 461 } | |
| 462 EXPECT_LT(target_timestamp, player_.GetCurrentTime()); | |
| 463 EXPECT_FALSE(IsPrerolling(is_audio)); | |
| 464 } | |
| 465 | |
| 434 DemuxerData CreateReadFromDemuxerAckWithConfigChanged(bool is_audio, | 466 DemuxerData CreateReadFromDemuxerAckWithConfigChanged(bool is_audio, |
| 435 int config_unit_index) { | 467 int config_unit_index) { |
| 436 DemuxerData data; | 468 DemuxerData data; |
| 437 data.type = is_audio ? DemuxerStream::AUDIO : DemuxerStream::VIDEO; | 469 data.type = is_audio ? DemuxerStream::AUDIO : DemuxerStream::VIDEO; |
| 438 data.access_units.resize(config_unit_index + 1); | 470 data.access_units.resize(config_unit_index + 1); |
| 439 | 471 |
| 440 for (int i = 0; i < config_unit_index; ++i) | 472 for (int i = 0; i < config_unit_index; ++i) |
| 441 data.access_units[i] = CreateAccessUnitWithData(is_audio, i); | 473 data.access_units[i] = CreateAccessUnitWithData(is_audio, i); |
| 442 | 474 |
| 443 data.access_units[config_unit_index].status = DemuxerStream::kConfigChanged; | 475 data.access_units[config_unit_index].status = DemuxerStream::kConfigChanged; |
| (...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1340 } | 1372 } |
| 1341 | 1373 |
| 1342 TEST_F(MediaSourcePlayerTest, PrerollAudioAfterSeek) { | 1374 TEST_F(MediaSourcePlayerTest, PrerollAudioAfterSeek) { |
| 1343 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); | 1375 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); |
| 1344 | 1376 |
| 1345 // Test decoder job will preroll the media to the seek position. | 1377 // Test decoder job will preroll the media to the seek position. |
| 1346 StartAudioDecoderJob(true); | 1378 StartAudioDecoderJob(true); |
| 1347 | 1379 |
| 1348 SeekPlayerWithAbort(true, base::TimeDelta::FromMilliseconds(100)); | 1380 SeekPlayerWithAbort(true, base::TimeDelta::FromMilliseconds(100)); |
| 1349 EXPECT_TRUE(IsPrerolling(true)); | 1381 EXPECT_TRUE(IsPrerolling(true)); |
| 1350 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); | 1382 PrerollDecoderToTime( |
| 1351 | 1383 true, base::TimeDelta(), base::TimeDelta::FromMilliseconds(100)); |
| 1352 // Send some data before the seek position. | |
| 1353 for (int i = 1; i < 4; ++i) { | |
| 1354 player_.OnDemuxerDataAvailable(CreateReadFromDemuxerAckForAudio(i)); | |
| 1355 EXPECT_TRUE(GetMediaDecoderJob(true)->is_decoding()); | |
| 1356 message_loop_.Run(); | |
| 1357 } | |
| 1358 EXPECT_EQ(100.0, player_.GetCurrentTime().InMillisecondsF()); | |
| 1359 EXPECT_TRUE(IsPrerolling(true)); | |
| 1360 | |
| 1361 // Send data after the seek position. | |
| 1362 DemuxerData data = CreateReadFromDemuxerAckForAudio(3); | |
| 1363 data.access_units[0].timestamp = base::TimeDelta::FromMilliseconds(100); | |
| 1364 player_.OnDemuxerDataAvailable(data); | |
| 1365 message_loop_.Run(); | |
| 1366 EXPECT_LT(100.0, player_.GetCurrentTime().InMillisecondsF()); | |
| 1367 EXPECT_FALSE(IsPrerolling(true)); | |
| 1368 } | 1384 } |
| 1369 | 1385 |
| 1370 TEST_F(MediaSourcePlayerTest, PrerollVideoAfterSeek) { | 1386 TEST_F(MediaSourcePlayerTest, PrerollVideoAfterSeek) { |
| 1371 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); | 1387 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); |
| 1372 | 1388 |
| 1373 // Test decoder job will preroll the media to the seek position. | 1389 // Test decoder job will preroll the media to the seek position. |
| 1374 CreateNextTextureAndSetVideoSurface(); | 1390 CreateNextTextureAndSetVideoSurface(); |
| 1375 StartVideoDecoderJob(true); | 1391 StartVideoDecoderJob(true); |
| 1376 | 1392 |
| 1377 SeekPlayerWithAbort(false, base::TimeDelta::FromMilliseconds(100)); | 1393 SeekPlayerWithAbort(false, base::TimeDelta::FromMilliseconds(100)); |
| 1378 EXPECT_TRUE(IsPrerolling(false)); | 1394 EXPECT_TRUE(IsPrerolling(false)); |
| 1379 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); | 1395 PrerollDecoderToTime( |
| 1380 | 1396 false, base::TimeDelta(), base::TimeDelta::FromMilliseconds(100)); |
| 1381 // Send some data before the seek position. | |
| 1382 DemuxerData data; | |
| 1383 for (int i = 1; i < 4; ++i) { | |
| 1384 data = CreateReadFromDemuxerAckForVideo(); | |
| 1385 data.access_units[0].timestamp = base::TimeDelta::FromMilliseconds(i * 30); | |
| 1386 player_.OnDemuxerDataAvailable(data); | |
| 1387 EXPECT_TRUE(GetMediaDecoderJob(false)->is_decoding()); | |
| 1388 message_loop_.Run(); | |
| 1389 } | |
| 1390 EXPECT_EQ(100.0, player_.GetCurrentTime().InMillisecondsF()); | |
| 1391 EXPECT_TRUE(IsPrerolling(false)); | |
| 1392 | |
| 1393 // Send data at the seek position. | |
| 1394 data = CreateReadFromDemuxerAckForVideo(); | |
| 1395 data.access_units[0].timestamp = base::TimeDelta::FromMilliseconds(100); | |
| 1396 player_.OnDemuxerDataAvailable(data); | |
| 1397 message_loop_.Run(); | |
| 1398 | |
| 1399 // TODO(wolenetz/qinmin): Player's maintenance of current time for video-only | |
| 1400 // streams depends on decoder output, which may be initially inaccurate, and | |
| 1401 // encoded video test data may also need updating. Verify at least that AU | |
| 1402 // timestamp-based preroll logic has determined video preroll has completed. | |
| 1403 // See http://crbug.com/310823 and http://b/11356652. | |
| 1404 EXPECT_FALSE(IsPrerolling(false)); | |
| 1405 } | 1397 } |
| 1406 | 1398 |
| 1407 TEST_F(MediaSourcePlayerTest, SeekingAfterCompletingPrerollRestartsPreroll) { | 1399 TEST_F(MediaSourcePlayerTest, SeekingAfterCompletingPrerollRestartsPreroll) { |
| 1408 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); | 1400 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); |
| 1409 | 1401 |
| 1410 // Test decoder job will begin prerolling upon seek, when it was not | 1402 // Test decoder job will begin prerolling upon seek, when it was not |
| 1411 // prerolling prior to the seek. | 1403 // prerolling prior to the seek. |
| 1412 StartAudioDecoderJob(true); | 1404 StartAudioDecoderJob(true); |
| 1413 MediaDecoderJob* decoder_job = GetMediaDecoderJob(true); | 1405 MediaDecoderJob* decoder_job = GetMediaDecoderJob(true); |
| 1414 EXPECT_TRUE(IsPrerolling(true)); | 1406 EXPECT_TRUE(IsPrerolling(true)); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1446 EXPECT_EQ(decoder_job, GetMediaDecoderJob(true)); | 1438 EXPECT_EQ(decoder_job, GetMediaDecoderJob(true)); |
| 1447 } | 1439 } |
| 1448 | 1440 |
| 1449 TEST_F(MediaSourcePlayerTest, PrerollContinuesAcrossReleaseAndStart) { | 1441 TEST_F(MediaSourcePlayerTest, PrerollContinuesAcrossReleaseAndStart) { |
| 1450 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); | 1442 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); |
| 1451 | 1443 |
| 1452 // Test decoder job will resume media prerolling if interrupted by Release() | 1444 // Test decoder job will resume media prerolling if interrupted by Release() |
| 1453 // and Start(). | 1445 // and Start(). |
| 1454 StartAudioDecoderJob(true); | 1446 StartAudioDecoderJob(true); |
| 1455 | 1447 |
| 1456 SeekPlayerWithAbort(true, base::TimeDelta::FromMilliseconds(100)); | 1448 base::TimeDelta target_timestamp = base::TimeDelta::FromMilliseconds(100); |
| 1449 SeekPlayerWithAbort(true, target_timestamp); | |
| 1457 EXPECT_TRUE(IsPrerolling(true)); | 1450 EXPECT_TRUE(IsPrerolling(true)); |
| 1458 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); | 1451 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); |
| 1459 | 1452 |
| 1460 // Send some data before the seek position. | 1453 // Send some data before the seek position. |
| 1461 // Test uses 'large' number of iterations because decoder job may not get | 1454 // Test uses 'large' number of iterations because decoder job may not get |
| 1462 // MEDIA_CODEC_OK output status until after a few dequeue output attempts. | 1455 // MEDIA_CODEC_OK output status until after a few dequeue output attempts. |
| 1463 // This allows decoder status to stabilize prior to AU timestamp reaching | 1456 // This allows decoder status to stabilize prior to AU timestamp reaching |
| 1464 // the preroll target. | 1457 // the preroll target. |
| 1465 DemuxerData data; | 1458 DemuxerData data; |
| 1466 for (int i = 0; i < 10; ++i) { | 1459 for (int i = 0; i < 10; ++i) { |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 1485 player_.OnDemuxerDataAvailable(data); | 1478 player_.OnDemuxerDataAvailable(data); |
| 1486 EXPECT_TRUE(GetMediaDecoderJob(true)->is_decoding()); | 1479 EXPECT_TRUE(GetMediaDecoderJob(true)->is_decoding()); |
| 1487 message_loop_.Run(); | 1480 message_loop_.Run(); |
| 1488 } | 1481 } |
| 1489 EXPECT_TRUE(IsPrerolling(true)); | 1482 EXPECT_TRUE(IsPrerolling(true)); |
| 1490 } | 1483 } |
| 1491 EXPECT_EQ(100.0, player_.GetCurrentTime().InMillisecondsF()); | 1484 EXPECT_EQ(100.0, player_.GetCurrentTime().InMillisecondsF()); |
| 1492 EXPECT_TRUE(IsPrerolling(true)); | 1485 EXPECT_TRUE(IsPrerolling(true)); |
| 1493 | 1486 |
| 1494 // Send data after the seek position. | 1487 // Send data after the seek position. |
| 1495 data = CreateReadFromDemuxerAckForAudio(3); | 1488 PrerollDecoderToTime(true, target_timestamp, target_timestamp); |
| 1496 data.access_units[0].timestamp = base::TimeDelta::FromMilliseconds(100); | |
| 1497 player_.OnDemuxerDataAvailable(data); | |
| 1498 message_loop_.Run(); | |
| 1499 EXPECT_LT(100.0, player_.GetCurrentTime().InMillisecondsF()); | |
| 1500 EXPECT_FALSE(IsPrerolling(true)); | |
| 1501 } | 1489 } |
| 1502 | 1490 |
| 1503 TEST_F(MediaSourcePlayerTest, PrerollContinuesAcrossConfigChange) { | 1491 TEST_F(MediaSourcePlayerTest, PrerollContinuesAcrossConfigChange) { |
| 1504 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); | 1492 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); |
| 1505 | 1493 |
| 1506 // Test decoder job will resume media prerolling if interrupted by | 1494 // Test decoder job will resume media prerolling if interrupted by |
| 1507 // |kConfigChanged| and OnDemuxerConfigsAvailable(). | 1495 // |kConfigChanged| and OnDemuxerConfigsAvailable(). |
| 1508 StartAudioDecoderJob(true); | 1496 StartAudioDecoderJob(true); |
| 1509 | 1497 |
| 1510 SeekPlayerWithAbort(true, base::TimeDelta::FromMilliseconds(100)); | 1498 SeekPlayerWithAbort(true, base::TimeDelta::FromMilliseconds(100)); |
| 1511 EXPECT_TRUE(IsPrerolling(true)); | 1499 EXPECT_TRUE(IsPrerolling(true)); |
| 1512 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); | 1500 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); |
| 1513 | 1501 |
| 1514 // In response to data request, simulate that demuxer signals config change by | 1502 // In response to data request, simulate that demuxer signals config change by |
| 1515 // sending an AU with |kConfigChanged|. Player should prepare to reconfigure | 1503 // sending an AU with |kConfigChanged|. Player should prepare to reconfigure |
| 1516 // the audio decoder job, and should request new demuxer configs. | 1504 // the audio decoder job, and should request new demuxer configs. |
| 1517 DemuxerData data = CreateReadFromDemuxerAckWithConfigChanged(true, 0); | 1505 DemuxerData data = CreateReadFromDemuxerAckWithConfigChanged(true, 0); |
| 1518 EXPECT_EQ(0, demuxer_->num_config_requests()); | 1506 EXPECT_EQ(0, demuxer_->num_config_requests()); |
| 1519 player_.OnDemuxerDataAvailable(data); | 1507 player_.OnDemuxerDataAvailable(data); |
| 1520 EXPECT_EQ(1, demuxer_->num_config_requests()); | 1508 EXPECT_EQ(1, demuxer_->num_config_requests()); |
| 1521 | 1509 |
| 1522 // Simulate arrival of new configs. | 1510 // Simulate arrival of new configs. |
| 1523 player_.OnDemuxerConfigsAvailable(CreateAudioDemuxerConfigs(kCodecVorbis)); | 1511 player_.OnDemuxerConfigsAvailable(CreateAudioDemuxerConfigs(kCodecVorbis)); |
| 1524 | 1512 |
| 1525 // Send some data before the seek position. | 1513 PrerollDecoderToTime( |
| 1526 for (int i = 1; i < 4; ++i) { | 1514 true, base::TimeDelta(), base::TimeDelta::FromMilliseconds(100)); |
| 1527 player_.OnDemuxerDataAvailable(CreateReadFromDemuxerAckForAudio(i)); | |
| 1528 EXPECT_TRUE(GetMediaDecoderJob(true)->is_decoding()); | |
| 1529 message_loop_.Run(); | |
| 1530 } | |
| 1531 EXPECT_EQ(100.0, player_.GetCurrentTime().InMillisecondsF()); | |
| 1532 EXPECT_TRUE(IsPrerolling(true)); | |
| 1533 | |
| 1534 // Send data after the seek position. | |
| 1535 data = CreateReadFromDemuxerAckForAudio(3); | |
| 1536 data.access_units[0].timestamp = base::TimeDelta::FromMilliseconds(100); | |
| 1537 player_.OnDemuxerDataAvailable(data); | |
| 1538 message_loop_.Run(); | |
| 1539 EXPECT_LT(100.0, player_.GetCurrentTime().InMillisecondsF()); | |
| 1540 EXPECT_FALSE(IsPrerolling(true)); | |
| 1541 } | 1515 } |
| 1542 | 1516 |
| 1543 TEST_F(MediaSourcePlayerTest, SimultaneousAudioVideoConfigChange) { | 1517 TEST_F(MediaSourcePlayerTest, SimultaneousAudioVideoConfigChange) { |
| 1544 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); | 1518 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); |
| 1545 | 1519 |
| 1546 // Test that the player allows simultaneous audio and video config change, | 1520 // Test that the player allows simultaneous audio and video config change, |
| 1547 // such as might occur during OnPrefetchDone() if next access unit for both | 1521 // such as might occur during OnPrefetchDone() if next access unit for both |
| 1548 // audio and video jobs is |kConfigChanged|. | 1522 // audio and video jobs is |kConfigChanged|. |
| 1549 CreateNextTextureAndSetVideoSurface(); | 1523 CreateNextTextureAndSetVideoSurface(); |
| 1550 Start(CreateAudioVideoDemuxerConfigs(), true); | 1524 Start(CreateAudioVideoDemuxerConfigs(), true); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1626 BrowserSeekPlayer(false); | 1600 BrowserSeekPlayer(false); |
| 1627 | 1601 |
| 1628 // Simulate browser seek is done, but to a later time than was requested. | 1602 // Simulate browser seek is done, but to a later time than was requested. |
| 1629 EXPECT_LT(player_.GetCurrentTime().InMillisecondsF(), 100); | 1603 EXPECT_LT(player_.GetCurrentTime().InMillisecondsF(), 100); |
| 1630 player_.OnDemuxerSeekDone(base::TimeDelta::FromMilliseconds(100)); | 1604 player_.OnDemuxerSeekDone(base::TimeDelta::FromMilliseconds(100)); |
| 1631 EXPECT_TRUE(GetMediaDecoderJob(false)); | 1605 EXPECT_TRUE(GetMediaDecoderJob(false)); |
| 1632 EXPECT_EQ(100.0, player_.GetCurrentTime().InMillisecondsF()); | 1606 EXPECT_EQ(100.0, player_.GetCurrentTime().InMillisecondsF()); |
| 1633 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); | 1607 EXPECT_EQ(100.0, GetPrerollTimestamp().InMillisecondsF()); |
| 1634 EXPECT_EQ(2, demuxer_->num_data_requests()); | 1608 EXPECT_EQ(2, demuxer_->num_data_requests()); |
| 1635 | 1609 |
| 1636 // Send some data with access unit timestamps before the actual browser seek | 1610 PrerollDecoderToTime( |
| 1637 // position. This is a bit unrealistic in this case where the browser seek | 1611 false, base::TimeDelta(), base::TimeDelta::FromMilliseconds(100)); |
| 1638 // jumped forward and next data from demuxer would normally begin at this | |
| 1639 // browser seek position, immediately completing preroll. For simplicity and | |
| 1640 // coverage, this test simulates the more common condition that AUs received | |
| 1641 // after browser seek begin with timestamps before the seek target, and don't | |
| 1642 // immediately complete preroll. | |
| 1643 DemuxerData data; | |
| 1644 for (int i = 1; i < 4; ++i) { | |
| 1645 data = CreateReadFromDemuxerAckForVideo(); | |
| 1646 data.access_units[0].timestamp = base::TimeDelta::FromMilliseconds(i * 30); | |
| 1647 player_.OnDemuxerDataAvailable(data); | |
| 1648 EXPECT_TRUE(GetMediaDecoderJob(false)->is_decoding()); | |
| 1649 message_loop_.Run(); | |
| 1650 EXPECT_TRUE(IsPrerolling(false)); | |
| 1651 } | |
| 1652 | |
| 1653 EXPECT_EQ(100.0, player_.GetCurrentTime().InMillisecondsF()); | |
| 1654 | |
| 1655 // Send data after the browser seek position. | |
| 1656 data = CreateReadFromDemuxerAckForVideo(); | |
| 1657 data.access_units[0].timestamp = base::TimeDelta::FromMilliseconds(120); | |
| 1658 player_.OnDemuxerDataAvailable(data); | |
| 1659 message_loop_.Run(); | |
| 1660 EXPECT_FALSE(IsPrerolling(false)); | |
| 1661 } | 1612 } |
| 1662 | 1613 |
| 1663 TEST_F(MediaSourcePlayerTest, VideoDemuxerConfigChange) { | 1614 TEST_F(MediaSourcePlayerTest, VideoDemuxerConfigChange) { |
| 1664 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); | 1615 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); |
| 1665 | 1616 |
| 1666 // Test that video config change notification results in request for demuxer | 1617 // Test that video config change notification results in request for demuxer |
| 1667 // configuration, and that a video decoder job results without any browser | 1618 // configuration, and that a video decoder job results without any browser |
| 1668 // seek necessary once the new demuxer config arrives. | 1619 // seek necessary once the new demuxer config arrives. |
| 1669 StartConfigChange(false, true, 1); | 1620 StartConfigChange(false, true, 1); |
| 1670 MediaDecoderJob* first_job = GetMediaDecoderJob(false); | 1621 MediaDecoderJob* first_job = GetMediaDecoderJob(false); |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2113 | 2064 |
| 2114 std::vector<std::string> codec_avc(1, "avc1"); | 2065 std::vector<std::string> codec_avc(1, "avc1"); |
| 2115 EXPECT_FALSE(IsTypeSupported(invalid_uuid, kL3, kVideoMp4, codec_avc)); | 2066 EXPECT_FALSE(IsTypeSupported(invalid_uuid, kL3, kVideoMp4, codec_avc)); |
| 2116 EXPECT_FALSE(IsTypeSupported(invalid_uuid, kL1, kVideoMp4, codec_avc)); | 2067 EXPECT_FALSE(IsTypeSupported(invalid_uuid, kL1, kVideoMp4, codec_avc)); |
| 2117 } | 2068 } |
| 2118 | 2069 |
| 2119 // TODO(xhwang): Are these IsTypeSupported tests device specific? | 2070 // TODO(xhwang): Are these IsTypeSupported tests device specific? |
| 2120 // TODO(xhwang): Add more IsTypeSupported tests. | 2071 // TODO(xhwang): Add more IsTypeSupported tests. |
| 2121 | 2072 |
| 2122 } // namespace media | 2073 } // namespace media |
| OLD | NEW |