Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Unified Diff: media/base/android/media_source_player_unittest.cc

Issue 638233002: Preroll decoders when video starts playing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/android/media_source_player.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_source_player_unittest.cc
diff --git a/media/base/android/media_source_player_unittest.cc b/media/base/android/media_source_player_unittest.cc
index fe46e4fa8033c4a98092117f3c6168fcd9ff9fca..baaabf34b4596d3550f5737de656e23ba328b7d2 100644
--- a/media/base/android/media_source_player_unittest.cc
+++ b/media/base/android/media_source_player_unittest.cc
@@ -355,7 +355,10 @@ class MediaSourcePlayerTest : public testing::Test {
new_current_time.InMilliseconds());
current_time = new_current_time;
if (manager_.timestamp_updated()) {
- EXPECT_LT(start_timestamp.InMillisecondsF(),
+ // TODO(qinmin): the current time is from the decoder thread and it does
+ // not take the delay from posting the task into consideration.
+ // http://crbug.com/421616.
+ EXPECT_LE(start_timestamp.InMillisecondsF(),
new_current_time.InMillisecondsF());
return;
}
@@ -1178,9 +1181,9 @@ TEST_F(MediaSourcePlayerTest, StartTimeTicksResetAfterDecoderUnderruns) {
DecodeAudioDataUntilOutputBecomesAvailable();
- // The decoder job should finish and a new request will be sent.
- base::TimeTicks previous = StartTimeTicks();
+ // The decoder job should finish prerolling and start prefetching.
player_.OnDemuxerDataAvailable(CreateReadFromDemuxerAckForAudio(3));
+ base::TimeTicks previous = StartTimeTicks();
// Let the decoder starve.
TriggerPlayerStarvation();
@@ -1738,6 +1741,12 @@ TEST_F(MediaSourcePlayerTest, SimultaneousAudioVideoConfigChange) {
EnableAdaptiveVideoPlayback(false);
WaitForAudioVideoDecodeDone();
+ EXPECT_TRUE(IsPrerolling(true));
+ EXPECT_TRUE(IsPrerolling(false));
+ PrerollDecoderToTime(true, base::TimeDelta(), base::TimeDelta(), true);
+ PrerollDecoderToTime(false, base::TimeDelta(), base::TimeDelta(), false);
+ int expected_num_data_requests = demuxer_->num_data_requests();
+
// Simulate audio |kConfigChanged| prefetched as standalone access unit.
DemuxerConfigs audio_configs = CreateAudioDemuxerConfigs(kCodecVorbis, true);
player_.OnDemuxerDataAvailable(
@@ -1747,7 +1756,7 @@ TEST_F(MediaSourcePlayerTest, SimultaneousAudioVideoConfigChange) {
player_.OnDemuxerDataAvailable(
CreateReadFromDemuxerAckWithConfigChanged(
false, 0, CreateVideoDemuxerConfigs(true)));
- EXPECT_EQ(6, demuxer_->num_data_requests());
+ EXPECT_EQ(expected_num_data_requests + 2, demuxer_->num_data_requests());
EXPECT_TRUE(IsDrainingDecoder(true));
EXPECT_TRUE(IsDrainingDecoder(false));
« no previous file with comments | « media/base/android/media_source_player.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698