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

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

Issue 2050043002: Generate and assign media track ids in demuxers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use-streamparser-trackid
Patch Set: rebase to ToT Created 4 years, 6 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/ffmpeg_demuxer.cc ('k') | media/filters/media_source_state.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 read_callback_called_ = true; 284 read_callback_called_ = true;
285 last_read_status_ = status; 285 last_read_status_ = status;
286 last_read_buffer_ = buffer; 286 last_read_buffer_ = buffer;
287 } 287 }
288 288
289 void CreateAndConfigureStream(DemuxerStream::Type type) { 289 void CreateAndConfigureStream(DemuxerStream::Type type) {
290 // TODO(wolenetz/dalecurtis): Also test with splicing disabled? 290 // TODO(wolenetz/dalecurtis): Also test with splicing disabled?
291 switch (type) { 291 switch (type) {
292 case DemuxerStream::AUDIO: { 292 case DemuxerStream::AUDIO: {
293 ASSERT_FALSE(audio_); 293 ASSERT_FALSE(audio_);
294 audio_.reset(new ChunkDemuxerStream(DemuxerStream::AUDIO, true)); 294 audio_.reset(new ChunkDemuxerStream(DemuxerStream::AUDIO, true, "1"));
295 AudioDecoderConfig decoder_config(kCodecVorbis, kSampleFormatPlanarF32, 295 AudioDecoderConfig decoder_config(kCodecVorbis, kSampleFormatPlanarF32,
296 CHANNEL_LAYOUT_STEREO, 1000, 296 CHANNEL_LAYOUT_STEREO, 1000,
297 EmptyExtraData(), Unencrypted()); 297 EmptyExtraData(), Unencrypted());
298 frame_processor_->OnPossibleAudioConfigUpdate(decoder_config); 298 frame_processor_->OnPossibleAudioConfigUpdate(decoder_config);
299 ASSERT_TRUE(audio_->UpdateAudioConfig(decoder_config, new MediaLog())); 299 ASSERT_TRUE(audio_->UpdateAudioConfig(decoder_config, new MediaLog()));
300 break; 300 break;
301 } 301 }
302 case DemuxerStream::VIDEO: { 302 case DemuxerStream::VIDEO: {
303 ASSERT_FALSE(video_); 303 ASSERT_FALSE(video_);
304 video_.reset(new ChunkDemuxerStream(DemuxerStream::VIDEO, true)); 304 video_.reset(new ChunkDemuxerStream(DemuxerStream::VIDEO, true, "2"));
305 ASSERT_TRUE(video_->UpdateVideoConfig(TestVideoConfig::Normal(), 305 ASSERT_TRUE(video_->UpdateVideoConfig(TestVideoConfig::Normal(),
306 new MediaLog())); 306 new MediaLog()));
307 break; 307 break;
308 } 308 }
309 // TODO(wolenetz): Test text coded frame processing. 309 // TODO(wolenetz): Test text coded frame processing.
310 case DemuxerStream::TEXT: 310 case DemuxerStream::TEXT:
311 case DemuxerStream::UNKNOWN: 311 case DemuxerStream::UNKNOWN:
312 case DemuxerStream::NUM_TYPES: { 312 case DemuxerStream::NUM_TYPES: {
313 ASSERT_FALSE(true); 313 ASSERT_FALSE(true);
314 } 314 }
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 StreamParserBuffer* last_read_parser_buffer = 792 StreamParserBuffer* last_read_parser_buffer =
793 static_cast<StreamParserBuffer*>(last_read_buffer_.get()); 793 static_cast<StreamParserBuffer*>(last_read_buffer_.get());
794 ASSERT_EQ(base::TimeDelta::FromMilliseconds(0), 794 ASSERT_EQ(base::TimeDelta::FromMilliseconds(0),
795 last_read_parser_buffer->preroll_buffer()->duration()); 795 last_read_parser_buffer->preroll_buffer()->duration());
796 } 796 }
797 797
798 INSTANTIATE_TEST_CASE_P(SequenceMode, FrameProcessorTest, Values(true)); 798 INSTANTIATE_TEST_CASE_P(SequenceMode, FrameProcessorTest, Values(true));
799 INSTANTIATE_TEST_CASE_P(SegmentsMode, FrameProcessorTest, Values(false)); 799 INSTANTIATE_TEST_CASE_P(SegmentsMode, FrameProcessorTest, Values(false));
800 800
801 } // namespace media 801 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_demuxer.cc ('k') | media/filters/media_source_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698