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/mp4/mp4_stream_parser.h" | 5 #include "media/formats/mp4/mp4_stream_parser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 true, | 207 true, |
208 base::Bind(&MP4StreamParserTest::KeyNeededF, base::Unretained(this)), | 208 base::Bind(&MP4StreamParserTest::KeyNeededF, base::Unretained(this)), |
209 base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this)), | 209 base::Bind(&MP4StreamParserTest::NewSegmentF, base::Unretained(this)), |
210 base::Bind(&MP4StreamParserTest::EndOfSegmentF, base::Unretained(this)), | 210 base::Bind(&MP4StreamParserTest::EndOfSegmentF, base::Unretained(this)), |
211 media_log_); | 211 media_log_); |
212 } | 212 } |
213 | 213 |
214 StreamParser::InitParameters GetDefaultInitParametersExpectations() { | 214 StreamParser::InitParameters GetDefaultInitParametersExpectations() { |
215 // Most unencrypted test mp4 files have zero duration and are treated as | 215 // Most unencrypted test mp4 files have zero duration and are treated as |
216 // live streams. | 216 // live streams. |
217 StreamParser::InitParameters params(kInfiniteDuration()); | 217 StreamParser::InitParameters params(kInfiniteDuration); |
218 params.liveness = DemuxerStream::LIVENESS_LIVE; | 218 params.liveness = DemuxerStream::LIVENESS_LIVE; |
219 params.detected_audio_track_count = 1; | 219 params.detected_audio_track_count = 1; |
220 params.detected_video_track_count = 1; | 220 params.detected_video_track_count = 1; |
221 params.detected_text_track_count = 0; | 221 params.detected_text_track_count = 0; |
222 return params; | 222 return params; |
223 } | 223 } |
224 | 224 |
225 void InitializeParserAndExpectLiveness(DemuxerStream::Liveness liveness) { | 225 void InitializeParserAndExpectLiveness(DemuxerStream::Liveness liveness) { |
226 auto params = GetDefaultInitParametersExpectations(); | 226 auto params = GetDefaultInitParametersExpectations(); |
227 params.liveness = liveness; | 227 params.liveness = liveness; |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
532 scoped_refptr<DecoderBuffer> buffer = | 532 scoped_refptr<DecoderBuffer> buffer = |
533 ReadTestDataFile("bear-1280x720-avt_subt_frag.mp4"); | 533 ReadTestDataFile("bear-1280x720-avt_subt_frag.mp4"); |
534 | 534 |
535 EXPECT_MEDIA_LOG(AudioCodecLog("mp4a.40.2")); | 535 EXPECT_MEDIA_LOG(AudioCodecLog("mp4a.40.2")); |
536 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.64001F")); | 536 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.64001F")); |
537 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); | 537 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); |
538 } | 538 } |
539 | 539 |
540 } // namespace mp4 | 540 } // namespace mp4 |
541 } // namespace media | 541 } // namespace media |
OLD | NEW |