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

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

Issue 23702007: Render inband text tracks in the media pipeline (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: modified ffmpeg demuxer unittest Created 7 years, 1 month 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
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/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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 int initial_append_size) 214 int initial_append_size)
215 : file_path_(GetTestDataFilePath(filename)), 215 : file_path_(GetTestDataFilePath(filename)),
216 current_position_(0), 216 current_position_(0),
217 initial_append_size_(initial_append_size), 217 initial_append_size_(initial_append_size),
218 mimetype_(mimetype), 218 mimetype_(mimetype),
219 chunk_demuxer_(new ChunkDemuxer( 219 chunk_demuxer_(new ChunkDemuxer(
220 base::Bind(&MockMediaSource::DemuxerOpened, 220 base::Bind(&MockMediaSource::DemuxerOpened,
221 base::Unretained(this)), 221 base::Unretained(this)),
222 base::Bind(&MockMediaSource::DemuxerNeedKey, 222 base::Bind(&MockMediaSource::DemuxerNeedKey,
223 base::Unretained(this)), 223 base::Unretained(this)),
224 base::Bind(&MockMediaSource::OnTextTrack, 224 true, // enable inband text tracks
225 base::Unretained(this)),
226 LogCB())), 225 LogCB())),
227 owned_chunk_demuxer_(chunk_demuxer_) { 226 owned_chunk_demuxer_(chunk_demuxer_) {
228 227
229 file_data_ = ReadTestDataFile(filename); 228 file_data_ = ReadTestDataFile(filename);
230 229
231 if (initial_append_size_ == kAppendWholeFile) 230 if (initial_append_size_ == kAppendWholeFile)
232 initial_append_size_ = file_data_->data_size(); 231 initial_append_size_ = file_data_->data_size();
233 232
234 DCHECK_GT(initial_append_size_, 0); 233 DCHECK_GT(initial_append_size_, 0);
235 DCHECK_LE(initial_append_size_, file_data_->data_size()); 234 DCHECK_LE(initial_append_size_, file_data_->data_size());
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 AppendData(initial_append_size_); 316 AppendData(initial_append_size_);
318 } 317 }
319 318
320 void DemuxerNeedKey(const std::string& type, 319 void DemuxerNeedKey(const std::string& type,
321 const std::vector<uint8>& init_data) { 320 const std::vector<uint8>& init_data) {
322 DCHECK(!init_data.empty()); 321 DCHECK(!init_data.empty());
323 CHECK(!need_key_cb_.is_null()); 322 CHECK(!need_key_cb_.is_null());
324 need_key_cb_.Run(type, init_data); 323 need_key_cb_.Run(type, init_data);
325 } 324 }
326 325
327 scoped_ptr<TextTrack> OnTextTrack(TextKind kind,
328 const std::string& label,
329 const std::string& language) {
330 return scoped_ptr<TextTrack>();
331 }
332
333 private: 326 private:
334 base::FilePath file_path_; 327 base::FilePath file_path_;
335 scoped_refptr<DecoderBuffer> file_data_; 328 scoped_refptr<DecoderBuffer> file_data_;
336 int current_position_; 329 int current_position_;
337 int initial_append_size_; 330 int initial_append_size_;
338 std::string mimetype_; 331 std::string mimetype_;
339 ChunkDemuxer* chunk_demuxer_; 332 ChunkDemuxer* chunk_demuxer_;
340 scoped_ptr<Demuxer> owned_chunk_demuxer_; 333 scoped_ptr<Demuxer> owned_chunk_demuxer_;
341 Demuxer::NeedKeyCB need_key_cb_; 334 Demuxer::NeedKeyCB need_key_cb_;
342 }; 335 };
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) { 1074 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) {
1082 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber()); 1075 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber());
1083 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8a.webm"), 1076 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8a.webm"),
1084 PIPELINE_OK)); 1077 PIPELINE_OK));
1085 Play(); 1078 Play();
1086 ASSERT_TRUE(WaitUntilOnEnded()); 1079 ASSERT_TRUE(WaitUntilOnEnded());
1087 EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A); 1080 EXPECT_EQ(last_video_frame_format_, VideoFrame::YV12A);
1088 } 1081 }
1089 1082
1090 // Verify that VP8 video with inband text track can be played back. 1083 // Verify that VP8 video with inband text track can be played back.
1091 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8_WebVTT_WebM) { 1084 TEST_F(PipelineIntegrationTest,
1085 BasicPlayback_VP8_WebVTT_WebM) {
1092 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), 1086 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"),
1093 PIPELINE_OK)); 1087 PIPELINE_OK));
1094 Play(); 1088 Play();
1095 ASSERT_TRUE(WaitUntilOnEnded()); 1089 ASSERT_TRUE(WaitUntilOnEnded());
1096 } 1090 }
1097 1091
1098 } // namespace media 1092 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698