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

Side by Side Diff: media/base/android/media_codec_decoder_unittest.cc

Issue 1254293003: MediaCodecPlayer implementation (stage 4 - preroll) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mtplayer-browserseek
Patch Set: Rebased Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « media/base/android/media_codec_decoder.cc ('k') | media/base/android/media_codec_player.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/thread_task_runner_handle.h" 7 #include "base/thread_task_runner_handle.h"
8 #include "base/timer/timer.h" 8 #include "base/timer/timer.h"
9 #include "media/base/android/media_codec_audio_decoder.h" 9 #include "media/base/android/media_codec_audio_decoder.h"
10 #include "media/base/android/media_codec_bridge.h" 10 #include "media/base/android/media_codec_bridge.h"
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 EXPECT_TRUE(decoder_->Start(base::TimeDelta::FromMilliseconds(0))); 486 EXPECT_TRUE(decoder_->Start(base::TimeDelta::FromMilliseconds(0)));
487 487
488 EXPECT_TRUE(WaitForCondition( 488 EXPECT_TRUE(WaitForCondition(
489 base::Bind(&MediaCodecDecoderTest::is_stopped, base::Unretained(this)), 489 base::Bind(&MediaCodecDecoderTest::is_stopped, base::Unretained(this)),
490 timeout)); 490 timeout));
491 491
492 EXPECT_TRUE(decoder_->IsStopped()); 492 EXPECT_TRUE(decoder_->IsStopped());
493 EXPECT_TRUE(decoder_->IsCompleted()); 493 EXPECT_TRUE(decoder_->IsCompleted());
494 494
495 // Last buffered timestamp should be no less than PTS. 495 // Last buffered timestamp should be no less than PTS.
496 EXPECT_EQ(22, pts_stat_.num_values()); 496 // The number of hits in pts_stat_ depends on the preroll implementation.
497 // We might not report the time for the first buffer after preroll that
498 // is written to the audio track. pts_stat_.num_values() is either 21 or 22.
499 EXPECT_LE(21, pts_stat_.num_values());
497 EXPECT_LE(data_factory_->last_pts(), pts_stat_.max()); 500 EXPECT_LE(data_factory_->last_pts(), pts_stat_.max());
498 501
499 DVLOG(0) << "AudioPlayTillCompletion stopping"; 502 DVLOG(0) << "AudioPlayTillCompletion stopping";
500 } 503 }
501 504
502 TEST_F(MediaCodecDecoderTest, VideoPlayTillCompletion) { 505 TEST_F(MediaCodecDecoderTest, VideoPlayTillCompletion) {
503 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE(); 506 SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE();
504 507
505 CreateVideoDecoder(); 508 CreateVideoDecoder();
506 509
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 decoder_->RequestToStop(); 650 decoder_->RequestToStop();
648 651
649 EXPECT_TRUE(WaitForCondition( 652 EXPECT_TRUE(WaitForCondition(
650 base::Bind(&MediaCodecDecoderTest::is_stopped, base::Unretained(this)))); 653 base::Bind(&MediaCodecDecoderTest::is_stopped, base::Unretained(this))));
651 654
652 EXPECT_TRUE(decoder_->IsStopped()); 655 EXPECT_TRUE(decoder_->IsStopped());
653 EXPECT_FALSE(decoder_->IsCompleted()); 656 EXPECT_FALSE(decoder_->IsCompleted());
654 } 657 }
655 658
656 } // namespace media 659 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_codec_decoder.cc ('k') | media/base/android/media_codec_player.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698