diff options
author | dalecurtis <dalecurtis@chromium.org> | 2015-04-14 21:03:32 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-15 04:04:05 +0000 |
commit | e7f41df2541aea7c99f7965874f9c5ce901899e5 (patch) | |
tree | 1801687e950811fed2ec4bac9da58f8ab856a825 /media/test | |
parent | b46eeca5f6b2a8840836586503440a8f8d9f6605 (diff) | |
download | chromium_src-e7f41df2541aea7c99f7965874f9c5ce901899e5.zip chromium_src-e7f41df2541aea7c99f7965874f9c5ce901899e5.tar.gz chromium_src-e7f41df2541aea7c99f7965874f9c5ce901899e5.tar.bz2 |
Prime the landing pad for the new video rendering pipeline.
This is not a functional change, it only updates the interfaces and
call sites in preparation for switching to a vsync based video
rendering pipeline.
Some notes:
- Plumbs a VideoRendererSink into the the rendering pipeline; similar to
how we have an AudioRendererSink.
- A couple VideoRendererSink mocks are introduced which will be short
lived. Like audio, we will need fakes which can pump consumption tasks.
- The "PaintCB" callback has been temporarily placed on the new sink
interface such that in the field experiments can be run comparing the
performance of the video rendering approaches.
- Finally nukes Player_X11 since setting up a vsync renderer just for
unused tool code isn't worth the effort.
- Since compositor callbacks may stop due to visibility changes, the
new VideoRendererImpl will use a countdown timer to pump video playback
as frames expire; expired frames will not count as dropped.
- Since canvas/WebGL requires frame updates in the background a new
method has been added to VideoFrameCompositor to return the current
frame if it was updated with 250ms, or to request a new one and return
the updated one.
Subsequent work:
- sunnyps@ will be switching VideoFrameProviderClientImpl over to using
a BeginFrameObserver, which will ultimately drive the Render() callbacks.
- dalecurtis@ will land the VideoRendererAlgorithm which powers the new
rendering pipeline.
BUG=439548
TEST=everything works as is.
Review URL: https://codereview.chromium.org/1053113002
Cr-Commit-Position: refs/heads/master@{#325183}
Diffstat (limited to 'media/test')
-rw-r--r-- | media/test/pipeline_integration_test.cc | 10 | ||||
-rw-r--r-- | media/test/pipeline_integration_test_base.cc | 12 | ||||
-rw-r--r-- | media/test/pipeline_integration_test_base.h | 15 |
3 files changed, 25 insertions, 12 deletions
diff --git a/media/test/pipeline_integration_test.cc b/media/test/pipeline_integration_test.cc index ead238c..6ce35f0 100644 --- a/media/test/pipeline_integration_test.cc +++ b/media/test/pipeline_integration_test.cc @@ -631,12 +631,8 @@ class PipelineIntegrationTestHost : public mojo::test::ApplicationTestBase, void SetUp() override { ApplicationTestBase::SetUp(); - - // TODO(dalecurtis): For some reason this isn't done... - if (!base::CommandLine::InitializedForCurrentProcess()) { - base::CommandLine::Init(0, NULL); + if (!IsMediaLibraryInitialized()) InitializeMediaLibraryForTesting(); - } } protected: @@ -681,8 +677,6 @@ class PipelineIntegrationTest : public PipelineIntegrationTestHost { base::Unretained(this)), base::Bind(&PipelineIntegrationTest::OnBufferingStateChanged, base::Unretained(this)), - base::Bind(&PipelineIntegrationTest::OnVideoFramePaint, - base::Unretained(this)), base::Closure(), base::Bind(&PipelineIntegrationTest::OnAddTextTrack, base::Unretained(this)), base::Bind(&PipelineIntegrationTest::OnWaitingForDecryptionKey, @@ -727,8 +721,6 @@ class PipelineIntegrationTest : public PipelineIntegrationTestHost { base::Unretained(this)), base::Bind(&PipelineIntegrationTest::OnBufferingStateChanged, base::Unretained(this)), - base::Bind(&PipelineIntegrationTest::OnVideoFramePaint, - base::Unretained(this)), base::Closure(), base::Bind(&PipelineIntegrationTest::OnAddTextTrack, base::Unretained(this)), base::Bind(&PipelineIntegrationTest::OnWaitingForDecryptionKey, diff --git a/media/test/pipeline_integration_test_base.cc b/media/test/pipeline_integration_test_base.cc index da3a9f8..c17431a 100644 --- a/media/test/pipeline_integration_test_base.cc +++ b/media/test/pipeline_integration_test_base.cc @@ -26,6 +26,7 @@ using ::testing::_; using ::testing::AnyNumber; using ::testing::AtMost; +using ::testing::Invoke; using ::testing::InvokeWithoutArgs; using ::testing::SaveArg; @@ -34,6 +35,9 @@ namespace media { const char kNullVideoHash[] = "d41d8cd98f00b204e9800998ecf8427e"; const char kNullAudioHash[] = "0.00,0.00,0.00,0.00,0.00,0.00,"; +MockVideoRendererSink::MockVideoRendererSink() {} +MockVideoRendererSink::~MockVideoRendererSink() {} + PipelineIntegrationTestBase::PipelineIntegrationTestBase() : hashing_enabled_(false), clockless_playback_(false), @@ -135,8 +139,6 @@ PipelineStatus PipelineIntegrationTestBase::Start(const std::string& filename, base::Unretained(this)), base::Bind(&PipelineIntegrationTestBase::OnBufferingStateChanged, base::Unretained(this)), - base::Bind(&PipelineIntegrationTestBase::OnVideoFramePaint, - base::Unretained(this)), base::Closure(), base::Bind(&PipelineIntegrationTestBase::OnAddTextTrack, base::Unretained(this)), base::Bind(&PipelineIntegrationTestBase::OnWaitingForDecryptionKey, @@ -238,9 +240,13 @@ scoped_ptr<Renderer> PipelineIntegrationTestBase::CreateRenderer() { new FFmpegVideoDecoder(message_loop_.message_loop_proxy())); #endif + EXPECT_CALL(video_sink_, PaintFrameUsingOldRenderingPath(_)) + .WillRepeatedly( + Invoke(this, &PipelineIntegrationTestBase::OnVideoFramePaint)); + // Disable frame dropping if hashing is enabled. scoped_ptr<VideoRenderer> video_renderer( - new VideoRendererImpl(message_loop_.message_loop_proxy(), + new VideoRendererImpl(message_loop_.message_loop_proxy(), &video_sink_, video_decoders.Pass(), false, new MediaLog())); if (!clockless_playback_) { diff --git a/media/test/pipeline_integration_test_base.h b/media/test/pipeline_integration_test_base.h index c8ca915..aa41337 100644 --- a/media/test/pipeline_integration_test_base.h +++ b/media/test/pipeline_integration_test_base.h @@ -45,6 +45,20 @@ class DummyTickClock : public base::TickClock { base::TimeTicks now_; }; +// TODO(dalecurtis): Mocks won't be useful for the new rendering path, we'll +// need fake callback generators like we have for the audio path. +// http://crbug.com/473424 +class MockVideoRendererSink : public VideoRendererSink { + public: + MockVideoRendererSink(); + ~MockVideoRendererSink() override; + + MOCK_METHOD1(Start, void(VideoRendererSink::RenderCallback*)); + MOCK_METHOD0(Stop, void()); + MOCK_METHOD1(PaintFrameUsingOldRenderingPath, + void(const scoped_refptr<VideoFrame>&)); +}; + // Integration tests for Pipeline. Real demuxers, real decoders, and // base renderer implementations are used to verify pipeline functionality. The // renderers used in these tests rely heavily on the AudioRendererBase & @@ -105,6 +119,7 @@ class PipelineIntegrationTestBase { scoped_ptr<Pipeline> pipeline_; scoped_refptr<NullAudioSink> audio_sink_; scoped_refptr<ClocklessAudioSink> clockless_audio_sink_; + testing::NiceMock<MockVideoRendererSink> video_sink_; bool ended_; PipelineStatus pipeline_status_; Demuxer::EncryptedMediaInitDataCB encrypted_media_init_data_cb_; |