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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 void OnKeyNeeded(EmeInitDataType type, | 179 void OnKeyNeeded(EmeInitDataType type, |
180 const std::vector<uint8_t>& init_data) { | 180 const std::vector<uint8_t>& init_data) { |
181 NOTREACHED() << "OnKeyNeeded not expected in the Mpeg2 TS parser"; | 181 NOTREACHED() << "OnKeyNeeded not expected in the Mpeg2 TS parser"; |
182 } | 182 } |
183 | 183 |
184 void OnNewSegment() { | 184 void OnNewSegment() { |
185 DVLOG(1) << "OnNewSegment"; | 185 DVLOG(1) << "OnNewSegment"; |
186 segment_count_++; | 186 segment_count_++; |
187 } | 187 } |
188 | 188 |
189 void OnEndOfSegment() { | 189 bool OnEndOfSegment() { |
190 NOTREACHED() << "OnEndOfSegment not expected in the Mpeg2 TS parser"; | 190 NOTREACHED() << "OnEndOfSegment not expected in the Mpeg2 TS parser"; |
| 191 return false; |
191 } | 192 } |
192 | 193 |
193 void InitializeParser() { | 194 void InitializeParser() { |
194 parser_->Init( | 195 parser_->Init( |
195 base::Bind(&Mp2tStreamParserTest::OnInit, base::Unretained(this)), | 196 base::Bind(&Mp2tStreamParserTest::OnInit, base::Unretained(this)), |
196 base::Bind(&Mp2tStreamParserTest::OnNewConfig, base::Unretained(this)), | 197 base::Bind(&Mp2tStreamParserTest::OnNewConfig, base::Unretained(this)), |
197 base::Bind(&Mp2tStreamParserTest::OnNewBuffers, base::Unretained(this)), | 198 base::Bind(&Mp2tStreamParserTest::OnNewBuffers, base::Unretained(this)), |
198 true, | 199 true, |
199 base::Bind(&Mp2tStreamParserTest::OnKeyNeeded, base::Unretained(this)), | 200 base::Bind(&Mp2tStreamParserTest::OnKeyNeeded, base::Unretained(this)), |
200 base::Bind(&Mp2tStreamParserTest::OnNewSegment, base::Unretained(this)), | 201 base::Bind(&Mp2tStreamParserTest::OnNewSegment, base::Unretained(this)), |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 parser_->Flush(); | 291 parser_->Flush(); |
291 EXPECT_EQ(audio_frame_count_, 40); | 292 EXPECT_EQ(audio_frame_count_, 40); |
292 EXPECT_EQ(video_frame_count_, 0); | 293 EXPECT_EQ(video_frame_count_, 0); |
293 // This stream has no mid-stream configuration change. | 294 // This stream has no mid-stream configuration change. |
294 EXPECT_EQ(config_count_, 1); | 295 EXPECT_EQ(config_count_, 1); |
295 EXPECT_EQ(segment_count_, 1); | 296 EXPECT_EQ(segment_count_, 1); |
296 } | 297 } |
297 | 298 |
298 } // namespace mp2t | 299 } // namespace mp2t |
299 } // namespace media | 300 } // namespace media |
OLD | NEW |