Chromium Code Reviews| 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 int initial_append_size) | 230 int initial_append_size) |
| 231 : file_path_(GetTestDataFilePath(filename)), | 231 : file_path_(GetTestDataFilePath(filename)), |
| 232 current_position_(0), | 232 current_position_(0), |
| 233 initial_append_size_(initial_append_size), | 233 initial_append_size_(initial_append_size), |
| 234 mimetype_(mimetype), | 234 mimetype_(mimetype), |
| 235 chunk_demuxer_(new ChunkDemuxer( | 235 chunk_demuxer_(new ChunkDemuxer( |
| 236 base::Bind(&MockMediaSource::DemuxerOpened, | 236 base::Bind(&MockMediaSource::DemuxerOpened, |
| 237 base::Unretained(this)), | 237 base::Unretained(this)), |
| 238 base::Bind(&MockMediaSource::DemuxerNeedKey, | 238 base::Bind(&MockMediaSource::DemuxerNeedKey, |
| 239 base::Unretained(this)), | 239 base::Unretained(this)), |
| 240 base::Bind(&MockMediaSource::OnTextTrack, | |
| 241 base::Unretained(this)), | |
| 240 LogCB())), | 242 LogCB())), |
| 241 owned_chunk_demuxer_(chunk_demuxer_) { | 243 owned_chunk_demuxer_(chunk_demuxer_) { |
| 242 | 244 |
| 243 file_data_ = ReadTestDataFile(filename); | 245 file_data_ = ReadTestDataFile(filename); |
| 244 | 246 |
| 245 if (initial_append_size_ == kAppendWholeFile) | 247 if (initial_append_size_ == kAppendWholeFile) |
| 246 initial_append_size_ = file_data_->GetDataSize(); | 248 initial_append_size_ = file_data_->GetDataSize(); |
| 247 | 249 |
| 248 DCHECK_GT(initial_append_size_, 0); | 250 DCHECK_GT(initial_append_size_, 0); |
| 249 DCHECK_LE(initial_append_size_, file_data_->GetDataSize()); | 251 DCHECK_LE(initial_append_size_, file_data_->GetDataSize()); |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 317 | 319 |
| 318 void DemuxerNeedKey(const std::string& type, | 320 void DemuxerNeedKey(const std::string& type, |
| 319 scoped_ptr<uint8[]> init_data, int init_data_size) { | 321 scoped_ptr<uint8[]> init_data, int init_data_size) { |
| 320 DCHECK(init_data.get()); | 322 DCHECK(init_data.get()); |
| 321 DCHECK_GT(init_data_size, 0); | 323 DCHECK_GT(init_data_size, 0); |
| 322 CHECK(!need_key_cb_.is_null()); | 324 CHECK(!need_key_cb_.is_null()); |
| 323 need_key_cb_.Run( | 325 need_key_cb_.Run( |
| 324 std::string(), std::string(), type, init_data.Pass(), init_data_size); | 326 std::string(), std::string(), type, init_data.Pass(), init_data_size); |
| 325 } | 327 } |
| 326 | 328 |
| 329 scoped_ptr<TextTrack> OnTextTrack(TextKind kind, | |
| 330 const std::string& label, | |
| 331 const std::string& language) { | |
| 332 // TODO(matthewjheaney): put something here | |
| 333 return scoped_ptr<TextTrack>(0); | |
|
acolwell GONE FROM CHROMIUM
2013/05/15 22:42:36
What are your plans here? At a minimum the caller
Matthew Heaney (Chromium)
2013/05/16 22:05:22
Done.
| |
| 334 } | |
| 335 | |
| 327 private: | 336 private: |
| 328 base::FilePath file_path_; | 337 base::FilePath file_path_; |
| 329 scoped_refptr<DecoderBuffer> file_data_; | 338 scoped_refptr<DecoderBuffer> file_data_; |
| 330 int current_position_; | 339 int current_position_; |
| 331 int initial_append_size_; | 340 int initial_append_size_; |
| 332 std::string mimetype_; | 341 std::string mimetype_; |
| 333 ChunkDemuxer* chunk_demuxer_; | 342 ChunkDemuxer* chunk_demuxer_; |
| 334 scoped_ptr<Demuxer> owned_chunk_demuxer_; | 343 scoped_ptr<Demuxer> owned_chunk_demuxer_; |
| 335 NeedKeyCB need_key_cb_; | 344 NeedKeyCB need_key_cb_; |
| 336 }; | 345 }; |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 924 | 933 |
| 925 // Verify that VP8 video with alpha channel can be played back. | 934 // Verify that VP8 video with alpha channel can be played back. |
| 926 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) { | 935 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) { |
| 927 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8a.webm"), | 936 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8a.webm"), |
| 928 PIPELINE_OK)); | 937 PIPELINE_OK)); |
| 929 Play(); | 938 Play(); |
| 930 ASSERT_TRUE(WaitUntilOnEnded()); | 939 ASSERT_TRUE(WaitUntilOnEnded()); |
| 931 EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A); | 940 EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A); |
| 932 } | 941 } |
| 933 | 942 |
| 943 // Verify that VP8 video with inband text track can be played back. | |
| 944 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8_WebVTT_WebM) { | |
| 945 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), | |
| 946 PIPELINE_OK)); | |
| 947 Play(); | |
| 948 ASSERT_TRUE(WaitUntilOnEnded()); | |
| 949 } | |
| 950 | |
| 934 } // namespace media | 951 } // namespace media |
| OLD | NEW |