OLD | NEW |
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 "media/base/android/media_codec_player.h" | 5 #include "media/base/android/media_codec_player.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 } | 637 } |
638 } | 638 } |
639 | 639 |
640 void MediaCodecPlayerTest::CreatePlayer() { | 640 void MediaCodecPlayerTest::CreatePlayer() { |
641 DCHECK(demuxer_); | 641 DCHECK(demuxer_); |
642 player_ = new MediaCodecPlayer( | 642 player_ = new MediaCodecPlayer( |
643 0, // player_id | 643 0, // player_id |
644 manager_.GetWeakPtr(), | 644 manager_.GetWeakPtr(), |
645 base::Bind(&MockMediaPlayerManager::OnMediaResourcesRequested, | 645 base::Bind(&MockMediaPlayerManager::OnMediaResourcesRequested, |
646 base::Unretained(&manager_)), | 646 base::Unretained(&manager_)), |
647 scoped_ptr<MockDemuxerAndroid>(demuxer_), GURL()); | 647 scoped_ptr<MockDemuxerAndroid>(demuxer_), GURL(), 0); |
648 | 648 |
649 DCHECK(player_); | 649 DCHECK(player_); |
650 } | 650 } |
651 | 651 |
652 void MediaCodecPlayerTest::SetVideoSurface() { | 652 void MediaCodecPlayerTest::SetVideoSurface() { |
653 surface_texture_a_ = gfx::SurfaceTexture::Create(0); | 653 surface_texture_a_ = gfx::SurfaceTexture::Create(0); |
654 gfx::ScopedJavaSurface surface(surface_texture_a_.get()); | 654 gfx::ScopedJavaSurface surface(surface_texture_a_.get()); |
655 | 655 |
656 ASSERT_NE(nullptr, player_); | 656 ASSERT_NE(nullptr, player_); |
657 player_->SetVideoSurface(std::move(surface)); | 657 player_->SetVideoSurface(std::move(surface)); |
(...skipping 1615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2273 // TODO(timav): maybe we should not call the testing callback for | 2273 // TODO(timav): maybe we should not call the testing callback for |
2274 // kRenderAfterPreroll for video (for audio we already do not call). | 2274 // kRenderAfterPreroll for video (for audio we already do not call). |
2275 // EXPECT_TRUE(AlmostEqual(manager_.FirstFrameTime(DemuxerStream::AUDIO), | 2275 // EXPECT_TRUE(AlmostEqual(manager_.FirstFrameTime(DemuxerStream::AUDIO), |
2276 // manager_.FirstFrameTime(DemuxerStream::VIDEO), 50)); | 2276 // manager_.FirstFrameTime(DemuxerStream::VIDEO), 50)); |
2277 | 2277 |
2278 // The playback should start at |seek_position| | 2278 // The playback should start at |seek_position| |
2279 EXPECT_TRUE(AlmostEqual(seek_position, manager_.pts_stat_.min(), 25)); | 2279 EXPECT_TRUE(AlmostEqual(seek_position, manager_.pts_stat_.min(), 25)); |
2280 } | 2280 } |
2281 | 2281 |
2282 } // namespace media | 2282 } // namespace media |
OLD | NEW |