summaryrefslogtreecommitdiffstats
path: root/chromecast
diff options
context:
space:
mode:
authorkmackay <kmackay@chromium.org>2016-03-03 11:45:53 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-03 19:48:20 +0000
commit1abb4e18527d003909c12a529a03f332a22b47ee (patch)
tree3bfde283c8200e123d78a452cb0a459438fd51c2 /chromecast
parent13b8e77d00895fd3d24aaef7f32eeb4adb68a080 (diff)
downloadchromium_src-1abb4e18527d003909c12a529a03f332a22b47ee.zip
chromium_src-1abb4e18527d003909c12a529a03f332a22b47ee.tar.gz
chromium_src-1abb4e18527d003909c12a529a03f332a22b47ee.tar.bz2
[Chromecast] Fix some more media unit test issues
* Don't set playback rate on "ignore PTS" streams. * Don't check PTS tracking on "ignore PTS" streams. * Sound effects streams must be "ignore PTS". BUG= internal b/27168097 Review URL: https://codereview.chromium.org/1762703003 Cr-Commit-Position: refs/heads/master@{#379061}
Diffstat (limited to 'chromecast')
-rw-r--r--chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc48
1 files changed, 29 insertions, 19 deletions
diff --git a/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc b/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
index d5a93d6..7fd2d1d 100644
--- a/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
+++ b/chromecast/media/cma/backend/audio_video_pipeline_device_unittest.cc
@@ -719,6 +719,8 @@ void AudioVideoPipelineDeviceTest::RunStoppedChecks() {
}
void AudioVideoPipelineDeviceTest::RunPlaybackChecks() {
+ if (sync_type_ != MediaPipelineDeviceParams::kModeSyncPts)
+ return;
RunStoppedChecks();
EXPECT_TRUE(backend_->SetPlaybackRate(1.0f));
@@ -760,25 +762,29 @@ void AudioVideoPipelineDeviceTest::MonitorLoop() {
int64_t pts = backend_->GetCurrentPts();
base::TimeDelta media_time = base::TimeDelta::FromMicroseconds(pts);
-
- // Check that the current PTS is no more than 100ms past the last pushed PTS.
- if (audio_feeder_ &&
- audio_feeder_->last_pushed_pts() != std::numeric_limits<int64_t>::min()) {
- EXPECT_LE(pts, audio_feeder_->last_pushed_pts() + 100 * 1000);
- }
- if (video_feeder_ &&
- video_feeder_->last_pushed_pts() != std::numeric_limits<int64_t>::min()) {
- EXPECT_LE(pts, video_feeder_->last_pushed_pts() + 100 * 1000);
- }
- // PTS is allowed to move backwards once to allow for updates when the first
- // buffers are pushed.
- if (!backwards_pts_change_) {
- if (pts < last_pts_)
- backwards_pts_change_ = true;
- } else {
- EXPECT_GE(pts, last_pts_);
+ if (sync_type_ == MediaPipelineDeviceParams::kModeSyncPts) {
+ // Check that the current PTS is no more than 100ms past the last pushed
+ // PTS.
+ if (audio_feeder_ &&
+ audio_feeder_->last_pushed_pts() !=
+ std::numeric_limits<int64_t>::min()) {
+ EXPECT_LE(pts, audio_feeder_->last_pushed_pts() + 100 * 1000);
+ }
+ if (video_feeder_ &&
+ video_feeder_->last_pushed_pts() !=
+ std::numeric_limits<int64_t>::min()) {
+ EXPECT_LE(pts, video_feeder_->last_pushed_pts() + 100 * 1000);
+ }
+ // PTS is allowed to move backwards once to allow for updates when the first
+ // buffers are pushed.
+ if (!backwards_pts_change_) {
+ if (pts < last_pts_)
+ backwards_pts_change_ = true;
+ } else {
+ EXPECT_GE(pts, last_pts_);
+ }
+ last_pts_ = pts;
}
- last_pts_ = pts;
if (!pause_pattern_.empty() &&
pause_pattern_[pause_pattern_idx_].delay >= base::TimeDelta() &&
@@ -843,6 +849,10 @@ void AudioVideoPipelineDeviceTest::TestBackendStates() {
base::MessageLoop::current()->RunUntilIdle();
RunPlaybackChecks();
+ ASSERT_TRUE(backend()->Resume());
+ base::MessageLoop::current()->RunUntilIdle();
+ RunPlaybackChecks();
+
ASSERT_TRUE(backend()->Stop());
base::MessageLoop::current()->RunUntilIdle();
@@ -991,11 +1001,11 @@ TEST_F(AudioVideoPipelineDeviceTest, AudioBackendStates) {
TEST_F(AudioVideoPipelineDeviceTest, AudioEffectsBackendStates) {
scoped_ptr<base::MessageLoop> message_loop(new base::MessageLoop());
set_audio_type(MediaPipelineDeviceParams::kAudioStreamSoundEffects);
+ set_sync_type(MediaPipelineDeviceParams::kModeIgnorePts);
Initialize();
MediaPipelineBackend::AudioDecoder* audio_decoder =
backend()->CreateAudioDecoder();
- // Test setting config before Initialize().
scoped_ptr<BufferFeeder> feeder(new BufferFeeder(base::Bind(&IgnoreEos)));
feeder->Initialize(backend(), audio_decoder, BufferList());
feeder->SetAudioConfig(DefaultAudioConfig());