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

Side by Side Diff: media/formats/common/stream_parser_test_base.cc

Issue 1833053005: Remove MediaTracks::getFirstAudio/VideoConfig (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@track-control
Patch Set: Avoid crashes in tests 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/base/media_tracks.cc ('k') | media/formats/mp2t/mp2t_stream_parser.cc » ('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 "media/formats/common/stream_parser_test_base.h" 5 #include "media/formats/common/stream_parser_test_base.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 void StreamParserTestBase::OnInitDone( 82 void StreamParserTestBase::OnInitDone(
83 const StreamParser::InitParameters& params) { 83 const StreamParser::InitParameters& params) {
84 EXPECT_TRUE(params.auto_update_timestamp_offset); 84 EXPECT_TRUE(params.auto_update_timestamp_offset);
85 DVLOG(1) << __FUNCTION__ << "(" << params.duration.InMilliseconds() << ", " 85 DVLOG(1) << __FUNCTION__ << "(" << params.duration.InMilliseconds() << ", "
86 << params.auto_update_timestamp_offset << ")"; 86 << params.auto_update_timestamp_offset << ")";
87 } 87 }
88 88
89 bool StreamParserTestBase::OnNewConfig( 89 bool StreamParserTestBase::OnNewConfig(
90 std::unique_ptr<MediaTracks> tracks, 90 std::unique_ptr<MediaTracks> tracks,
91 const StreamParser::TextTrackConfigMap& text_config) { 91 const StreamParser::TextTrackConfigMap& text_config) {
92 DVLOG(1) << __FUNCTION__ << " media tracks count=" << tracks->tracks().size(); 92 DVLOG(1) << __FUNCTION__ << ": got " << tracks->tracks().size() << " tracks";
93 EXPECT_EQ(tracks->tracks().size(), 1u); 93 EXPECT_EQ(tracks->tracks().size(), 1u);
94 EXPECT_TRUE(tracks->getFirstAudioConfig().IsValidConfig()); 94 const auto& track = tracks->tracks()[0];
95 EXPECT_FALSE(tracks->getFirstVideoConfig().IsValidConfig()); 95 EXPECT_EQ(track->type(), MediaTrack::Audio);
96 last_audio_config_ = tracks->getFirstAudioConfig(); 96 last_audio_config_ = tracks->getAudioConfig(track->bytestream_track_id());
97 EXPECT_TRUE(last_audio_config_.IsValidConfig());
97 return true; 98 return true;
98 } 99 }
99 100
100 bool StreamParserTestBase::OnNewBuffers( 101 bool StreamParserTestBase::OnNewBuffers(
101 const StreamParser::BufferQueue& audio_buffers, 102 const StreamParser::BufferQueue& audio_buffers,
102 const StreamParser::BufferQueue& video_buffers, 103 const StreamParser::BufferQueue& video_buffers,
103 const StreamParser::TextBufferQueueMap& text_map) { 104 const StreamParser::TextBufferQueueMap& text_map) {
104 EXPECT_FALSE(audio_buffers.empty()); 105 EXPECT_FALSE(audio_buffers.empty());
105 EXPECT_TRUE(video_buffers.empty()); 106 EXPECT_TRUE(video_buffers.empty());
106 107
(...skipping 17 matching lines...) Expand all
124 DVLOG(1) << __FUNCTION__; 125 DVLOG(1) << __FUNCTION__;
125 results_stream_ << "NewSegment"; 126 results_stream_ << "NewSegment";
126 } 127 }
127 128
128 void StreamParserTestBase::OnEndOfSegment() { 129 void StreamParserTestBase::OnEndOfSegment() {
129 DVLOG(1) << __FUNCTION__; 130 DVLOG(1) << __FUNCTION__;
130 results_stream_ << "EndOfSegment"; 131 results_stream_ << "EndOfSegment";
131 } 132 }
132 133
133 } // namespace media 134 } // namespace media
OLDNEW
« no previous file with comments | « media/base/media_tracks.cc ('k') | media/formats/mp2t/mp2t_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698