Index: media/test/pipeline_integration_test_base.cc |
diff --git a/media/test/pipeline_integration_test_base.cc b/media/test/pipeline_integration_test_base.cc |
index 6115e472de8fe8c4af21db49b25b12d4e5cced96..66bd527a61e243d814fb3aba5320abca7b25e4e1 100644 |
--- a/media/test/pipeline_integration_test_base.cc |
+++ b/media/test/pipeline_integration_test_base.cc |
@@ -40,6 +40,32 @@ using ::testing::SaveArg; |
namespace media { |
+namespace { |
+ |
+class RendererFactoryImpl final : public PipelineTestRendererFactory { |
+ public: |
+ explicit RendererFactoryImpl(PipelineIntegrationTestBase* integration_test) |
+ : integration_test_(integration_test) {} |
+ ~RendererFactoryImpl() override {} |
+ |
+ // PipelineTestRendererFactory implementation. |
+ std::unique_ptr<Renderer> CreateRenderer( |
+ ScopedVector<VideoDecoder> prepend_video_decoders = |
+ ScopedVector<VideoDecoder>(), |
+ ScopedVector<AudioDecoder> prepend_audio_decoders = |
+ ScopedVector<AudioDecoder>()) override { |
+ return integration_test_->CreateRenderer(std::move(prepend_video_decoders), |
+ std::move(prepend_audio_decoders)); |
+ } |
+ |
+ private: |
+ PipelineIntegrationTestBase* integration_test_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(RendererFactoryImpl); |
+}; |
+ |
+} // namespace |
+ |
const char kNullVideoHash[] = "d41d8cd98f00b204e9800998ecf8427e"; |
const char kNullAudioHash[] = "0.00,0.00,0.00,0.00,0.00,0.00,"; |
@@ -51,7 +77,8 @@ PipelineIntegrationTestBase::PipelineIntegrationTestBase() |
pipeline_status_(PIPELINE_OK), |
last_video_frame_format_(PIXEL_FORMAT_UNKNOWN), |
last_video_frame_color_space_(COLOR_SPACE_UNSPECIFIED), |
- current_duration_(kInfiniteDuration) { |
+ current_duration_(kInfiniteDuration), |
+ renderer_factory_(new RendererFactoryImpl(this)) { |
ResetVideoHash(); |
} |
@@ -176,8 +203,9 @@ PipelineStatus PipelineIntegrationTestBase::StartInternal( |
EXPECT_CALL(*this, OnWaitingForDecryptionKey()).Times(0); |
pipeline_->Start( |
- demuxer_.get(), CreateRenderer(std::move(prepend_video_decoders), |
- std::move(prepend_audio_decoders)), |
+ demuxer_.get(), |
+ renderer_factory_->CreateRenderer(std::move(prepend_video_decoders), |
+ std::move(prepend_audio_decoders)), |
this, base::Bind(&PipelineIntegrationTestBase::OnStatusCallback, |
base::Unretained(this))); |
base::RunLoop().Run(); |
@@ -257,7 +285,7 @@ bool PipelineIntegrationTestBase::Resume(base::TimeDelta seek_time) { |
EXPECT_CALL(*this, OnBufferingStateChange(BUFFERING_HAVE_ENOUGH)) |
.WillOnce(InvokeWithoutArgs(&message_loop_, &base::MessageLoop::QuitNow)); |
- pipeline_->Resume(CreateRenderer(), seek_time, |
+ pipeline_->Resume(renderer_factory_->CreateRenderer(), seek_time, |
base::Bind(&PipelineIntegrationTestBase::OnSeeked, |
base::Unretained(this), seek_time)); |
base::RunLoop().Run(); |