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

Unified Diff: media/formats/mp4/mp4_stream_parser_unittest.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/formats/mp2t/mp2t_stream_parser_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp4/mp4_stream_parser_unittest.cc
diff --git a/media/formats/mp4/mp4_stream_parser_unittest.cc b/media/formats/mp4/mp4_stream_parser_unittest.cc
index 7109c20ddf6ac118f815d2c4b08634574448b46b..719da04104bea12609ab5d45bda924ba71410c82 100644
--- a/media/formats/mp4/mp4_stream_parser_unittest.cc
+++ b/media/formats/mp4/mp4_stream_parser_unittest.cc
@@ -117,12 +117,24 @@ class MP4StreamParserTest : public testing::Test {
const StreamParser::TextTrackConfigMap& tc) {
configs_received_ = true;
CHECK(tracks.get());
+ DVLOG(1) << "NewConfigF: got " << tracks->tracks().size() << " tracks";
+ for (const auto& track : tracks->tracks()) {
+ const auto& track_id = track->bytestream_track_id();
+ if (track->type() == MediaTrack::Audio) {
+ audio_decoder_config_ = tracks->getAudioConfig(track_id);
+ DVLOG(1) << "Audio track " << track_id << " config="
+ << (audio_decoder_config_.IsValidConfig()
+ ? audio_decoder_config_.AsHumanReadableString()
+ : "INVALID");
+ } else if (track->type() == MediaTrack::Video) {
+ video_decoder_config_ = tracks->getVideoConfig(track_id);
+ DVLOG(1) << "Video track " << track_id << " config="
+ << (video_decoder_config_.IsValidConfig()
+ ? video_decoder_config_.AsHumanReadableString()
+ : "INVALID");
+ }
+ }
media_tracks_ = std::move(tracks);
- audio_decoder_config_ = media_tracks_->getFirstAudioConfig();
- video_decoder_config_ = media_tracks_->getFirstVideoConfig();
- DVLOG(1) << "NewConfigF: track count=" << media_tracks_->tracks().size()
- << " audio=" << audio_decoder_config_.IsValidConfig()
- << " video=" << video_decoder_config_.IsValidConfig();
return true;
}
@@ -158,7 +170,7 @@ class MP4StreamParserTest : public testing::Test {
(audio == kNoDecodeTimestamp() ||
(video != kNoDecodeTimestamp() && audio > video)) ? video : audio;
- DCHECK(second_highest_timestamp != kNoDecodeTimestamp());
+ EXPECT_NE(second_highest_timestamp, kNoDecodeTimestamp());
if (lower_bound_ != kNoDecodeTimestamp() &&
second_highest_timestamp < lower_bound_) {
« no previous file with comments | « media/formats/mp2t/mp2t_stream_parser_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698