OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |