Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Side by Side Diff: media/filters/pipeline_integration_test.cc

Issue 13419002: Media Source dispatches inband text tracks (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 int initial_append_size) 231 int initial_append_size)
232 : file_path_(GetTestDataFilePath(filename)), 232 : file_path_(GetTestDataFilePath(filename)),
233 current_position_(0), 233 current_position_(0),
234 initial_append_size_(initial_append_size), 234 initial_append_size_(initial_append_size),
235 mimetype_(mimetype), 235 mimetype_(mimetype),
236 chunk_demuxer_(new ChunkDemuxer( 236 chunk_demuxer_(new ChunkDemuxer(
237 base::Bind(&MockMediaSource::DemuxerOpened, 237 base::Bind(&MockMediaSource::DemuxerOpened,
238 base::Unretained(this)), 238 base::Unretained(this)),
239 base::Bind(&MockMediaSource::DemuxerNeedKey, 239 base::Bind(&MockMediaSource::DemuxerNeedKey,
240 base::Unretained(this)), 240 base::Unretained(this)),
241 base::Bind(&MockMediaSource::OnTextTrack,
242 base::Unretained(this)),
241 LogCB())), 243 LogCB())),
242 owned_chunk_demuxer_(chunk_demuxer_) { 244 owned_chunk_demuxer_(chunk_demuxer_) {
243 245
244 file_data_ = ReadTestDataFile(filename); 246 file_data_ = ReadTestDataFile(filename);
245 247
246 if (initial_append_size_ == kAppendWholeFile) 248 if (initial_append_size_ == kAppendWholeFile)
247 initial_append_size_ = file_data_->GetDataSize(); 249 initial_append_size_ = file_data_->GetDataSize();
248 250
249 DCHECK_GT(initial_append_size_, 0); 251 DCHECK_GT(initial_append_size_, 0);
250 DCHECK_LE(initial_append_size_, file_data_->GetDataSize()); 252 DCHECK_LE(initial_append_size_, file_data_->GetDataSize());
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 320
319 void DemuxerNeedKey(const std::string& type, 321 void DemuxerNeedKey(const std::string& type,
320 scoped_ptr<uint8[]> init_data, int init_data_size) { 322 scoped_ptr<uint8[]> init_data, int init_data_size) {
321 DCHECK(init_data.get()); 323 DCHECK(init_data.get());
322 DCHECK_GT(init_data_size, 0); 324 DCHECK_GT(init_data_size, 0);
323 CHECK(!need_key_cb_.is_null()); 325 CHECK(!need_key_cb_.is_null());
324 need_key_cb_.Run( 326 need_key_cb_.Run(
325 std::string(), std::string(), type, init_data.Pass(), init_data_size); 327 std::string(), std::string(), type, init_data.Pass(), init_data_size);
326 } 328 }
327 329
330 scoped_ptr<TextTrack> OnTextTrack(TextKind kind,
331 const std::string& label,
332 const std::string& language) {
333 return scoped_ptr<TextTrack>();
334 }
335
328 private: 336 private:
329 base::FilePath file_path_; 337 base::FilePath file_path_;
330 scoped_refptr<DecoderBuffer> file_data_; 338 scoped_refptr<DecoderBuffer> file_data_;
331 int current_position_; 339 int current_position_;
332 int initial_append_size_; 340 int initial_append_size_;
333 std::string mimetype_; 341 std::string mimetype_;
334 ChunkDemuxer* chunk_demuxer_; 342 ChunkDemuxer* chunk_demuxer_;
335 scoped_ptr<Demuxer> owned_chunk_demuxer_; 343 scoped_ptr<Demuxer> owned_chunk_demuxer_;
336 NeedKeyCB need_key_cb_; 344 NeedKeyCB need_key_cb_;
337 }; 345 };
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 948
941 // Verify that VP8 video with alpha channel can be played back. 949 // Verify that VP8 video with alpha channel can be played back.
942 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) { 950 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) {
943 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8a.webm"), 951 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8a.webm"),
944 PIPELINE_OK)); 952 PIPELINE_OK));
945 Play(); 953 Play();
946 ASSERT_TRUE(WaitUntilOnEnded()); 954 ASSERT_TRUE(WaitUntilOnEnded());
947 EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A); 955 EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A);
948 } 956 }
949 957
958 // Verify that VP8 video with inband text track can be played back.
959 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8_WebVTT_WebM) {
960 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"),
961 PIPELINE_OK));
962 Play();
963 ASSERT_TRUE(WaitUntilOnEnded());
964 }
965
950 } // namespace media 966 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698