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 "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 int initial_append_size) | 211 int initial_append_size) |
212 : file_path_(GetTestDataFilePath(filename)), | 212 : file_path_(GetTestDataFilePath(filename)), |
213 current_position_(0), | 213 current_position_(0), |
214 initial_append_size_(initial_append_size), | 214 initial_append_size_(initial_append_size), |
215 mimetype_(mimetype), | 215 mimetype_(mimetype), |
216 chunk_demuxer_(new ChunkDemuxer( | 216 chunk_demuxer_(new ChunkDemuxer( |
217 base::Bind(&MockMediaSource::DemuxerOpened, | 217 base::Bind(&MockMediaSource::DemuxerOpened, |
218 base::Unretained(this)), | 218 base::Unretained(this)), |
219 base::Bind(&MockMediaSource::DemuxerNeedKey, | 219 base::Bind(&MockMediaSource::DemuxerNeedKey, |
220 base::Unretained(this)), | 220 base::Unretained(this)), |
221 base::Bind(&MockMediaSource::OnTextTrack, | |
222 base::Unretained(this)), | |
223 LogCB())), | 221 LogCB())), |
224 owned_chunk_demuxer_(chunk_demuxer_) { | 222 owned_chunk_demuxer_(chunk_demuxer_) { |
225 | 223 |
226 file_data_ = ReadTestDataFile(filename); | 224 file_data_ = ReadTestDataFile(filename); |
227 | 225 |
228 if (initial_append_size_ == kAppendWholeFile) | 226 if (initial_append_size_ == kAppendWholeFile) |
229 initial_append_size_ = file_data_->data_size(); | 227 initial_append_size_ = file_data_->data_size(); |
230 | 228 |
231 DCHECK_GT(initial_append_size_, 0); | 229 DCHECK_GT(initial_append_size_, 0); |
232 DCHECK_LE(initial_append_size_, file_data_->data_size()); | 230 DCHECK_LE(initial_append_size_, file_data_->data_size()); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 AppendData(initial_append_size_); | 312 AppendData(initial_append_size_); |
315 } | 313 } |
316 | 314 |
317 void DemuxerNeedKey(const std::string& type, | 315 void DemuxerNeedKey(const std::string& type, |
318 const std::vector<uint8>& init_data) { | 316 const std::vector<uint8>& init_data) { |
319 DCHECK(!init_data.empty()); | 317 DCHECK(!init_data.empty()); |
320 CHECK(!need_key_cb_.is_null()); | 318 CHECK(!need_key_cb_.is_null()); |
321 need_key_cb_.Run(type, init_data); | 319 need_key_cb_.Run(type, init_data); |
322 } | 320 } |
323 | 321 |
324 scoped_ptr<TextTrack> OnTextTrack(TextKind kind, | |
325 const std::string& label, | |
326 const std::string& language) { | |
327 return scoped_ptr<TextTrack>(); | |
328 } | |
329 | |
330 private: | 322 private: |
331 base::FilePath file_path_; | 323 base::FilePath file_path_; |
332 scoped_refptr<DecoderBuffer> file_data_; | 324 scoped_refptr<DecoderBuffer> file_data_; |
333 int current_position_; | 325 int current_position_; |
334 int initial_append_size_; | 326 int initial_append_size_; |
335 std::string mimetype_; | 327 std::string mimetype_; |
336 ChunkDemuxer* chunk_demuxer_; | 328 ChunkDemuxer* chunk_demuxer_; |
337 scoped_ptr<Demuxer> owned_chunk_demuxer_; | 329 scoped_ptr<Demuxer> owned_chunk_demuxer_; |
338 Demuxer::NeedKeyCB need_key_cb_; | 330 Demuxer::NeedKeyCB need_key_cb_; |
339 }; | 331 }; |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) { | 1050 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) { |
1059 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber()); | 1051 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber()); |
1060 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8a.webm"), | 1052 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8a.webm"), |
1061 PIPELINE_OK)); | 1053 PIPELINE_OK)); |
1062 Play(); | 1054 Play(); |
1063 ASSERT_TRUE(WaitUntilOnEnded()); | 1055 ASSERT_TRUE(WaitUntilOnEnded()); |
1064 EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A); | 1056 EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A); |
1065 } | 1057 } |
1066 | 1058 |
1067 // Verify that VP8 video with inband text track can be played back. | 1059 // Verify that VP8 video with inband text track can be played back. |
1068 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8_WebVTT_WebM) { | 1060 TEST_F(PipelineIntegrationTest, |
| 1061 BasicPlayback_VP8_WebVTT_WebM) { |
1069 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), | 1062 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), |
1070 PIPELINE_OK)); | 1063 PIPELINE_OK)); |
1071 Play(); | 1064 Play(); |
1072 ASSERT_TRUE(WaitUntilOnEnded()); | 1065 ASSERT_TRUE(WaitUntilOnEnded()); |
1073 } | 1066 } |
1074 | 1067 |
1075 } // namespace media | 1068 } // namespace media |
OLD | NEW |