OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/filters/pipeline_integration_test_base.h" | 5 #include "media/filters/pipeline_integration_test_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "media/base/decoder_buffer.h" | 8 #include "media/base/decoder_buffer.h" |
9 #include "media/base/decryptor_client.h" | 9 #include "media/base/decryptor_client.h" |
10 #include "media/base/test_data_util.h" | 10 #include "media/base/test_data_util.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 std::string current_key_system_; | 180 std::string current_key_system_; |
181 std::string current_session_id_; | 181 std::string current_session_id_; |
182 }; | 182 }; |
183 | 183 |
184 class PipelineIntegrationTest | 184 class PipelineIntegrationTest |
185 : public testing::Test, | 185 : public testing::Test, |
186 public PipelineIntegrationTestBase { | 186 public PipelineIntegrationTestBase { |
187 public: | 187 public: |
188 void StartPipelineWithMediaSource(MockMediaSource* source) { | 188 void StartPipelineWithMediaSource(MockMediaSource* source) { |
189 pipeline_->Start( | 189 pipeline_->Start( |
190 CreateFilterCollection(source), | 190 CreateFilterCollection(source, NULL), |
191 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), | 191 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), |
192 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), | 192 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), |
193 QuitOnStatusCB(PIPELINE_OK)); | 193 QuitOnStatusCB(PIPELINE_OK)); |
194 | 194 |
195 ASSERT_TRUE(decoder_.get()); | 195 ASSERT_TRUE(decoder_.get()); |
196 | 196 |
197 message_loop_.Run(); | 197 message_loop_.Run(); |
198 } | 198 } |
199 | 199 |
200 void StartPipelineWithEncryptedMedia( | 200 void StartPipelineWithEncryptedMedia( |
201 MockMediaSource* source, | 201 MockMediaSource* source, |
202 FakeDecryptorClient* encrypted_media) { | 202 FakeDecryptorClient* encrypted_media) { |
203 pipeline_->Start( | 203 pipeline_->Start( |
204 CreateFilterCollection(source), | 204 CreateFilterCollection(source, encrypted_media->decryptor()), |
205 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), | 205 base::Bind(&PipelineIntegrationTest::OnEnded, base::Unretained(this)), |
206 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), | 206 base::Bind(&PipelineIntegrationTest::OnError, base::Unretained(this)), |
207 QuitOnStatusCB(PIPELINE_OK)); | 207 QuitOnStatusCB(PIPELINE_OK)); |
208 | 208 |
209 ASSERT_TRUE(decoder_.get()); | 209 ASSERT_TRUE(decoder_.get()); |
210 decoder_->set_decryptor(encrypted_media->decryptor()); | |
211 source->set_decryptor_client(encrypted_media); | 210 source->set_decryptor_client(encrypted_media); |
212 | 211 |
213 message_loop_.Run(); | 212 message_loop_.Run(); |
214 } | 213 } |
215 | 214 |
216 // Verifies that seeking works properly for ChunkDemuxer when the | 215 // Verifies that seeking works properly for ChunkDemuxer when the |
217 // seek happens while there is a pending read on the ChunkDemuxer | 216 // seek happens while there is a pending read on the ChunkDemuxer |
218 // and no data is available. | 217 // and no data is available. |
219 bool TestSeekDuringRead(const std::string& filename, | 218 bool TestSeekDuringRead(const std::string& filename, |
220 int initial_append_size, | 219 int initial_append_size, |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 360 |
362 // Verify video decoder & renderer can handle aborted demuxer reads. | 361 // Verify video decoder & renderer can handle aborted demuxer reads. |
363 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { | 362 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { |
364 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768, | 363 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", 32768, |
365 base::TimeDelta::FromMilliseconds(200), | 364 base::TimeDelta::FromMilliseconds(200), |
366 base::TimeDelta::FromMilliseconds(1668), | 365 base::TimeDelta::FromMilliseconds(1668), |
367 0x1C896, 65536, false, true)); | 366 0x1C896, 65536, false, true)); |
368 } | 367 } |
369 | 368 |
370 } // namespace media | 369 } // namespace media |
OLD | NEW |