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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
283 scoped_refptr<DecoderBuffer> buffer = | 283 scoped_refptr<DecoderBuffer> buffer = |
284 ReadTestDataFile("bear-1280x720-av_frag.mp4"); | 284 ReadTestDataFile("bear-1280x720-av_frag.mp4"); |
285 EXPECT_TRUE(AppendDataInPieces(buffer->data(), | 285 EXPECT_TRUE(AppendDataInPieces(buffer->data(), |
286 buffer->data_size(), | 286 buffer->data_size(), |
287 512)); | 287 512)); |
288 EXPECT_TRUE(AppendDataInPieces(buffer->data(), | 288 EXPECT_TRUE(AppendDataInPieces(buffer->data(), |
289 buffer->data_size(), | 289 buffer->data_size(), |
290 512)); | 290 512)); |
291 } | 291 } |
292 | 292 |
293 TEST_F(MP4StreamParserTest, UnknownDuration_V0_AllBitsSet) { | |
294 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.64001F")); | |
295 EXPECT_MEDIA_LOG(AudioCodecLog("mp4a.40.2")); | |
296 InitializeParser(); | |
297 // 32 bit duration field in mvhd box, all bits set. | |
298 ParseMP4File( | |
299 "bear-1280x720-av_frag-initsegment-mvhd_version_0-mvhd_duration_bits_all_" | |
xhwang
2016/09/24 06:01:19
Could you please update media/test/data/README to
wolenetz
2016/09/26 19:35:24
Done.
| |
300 "set.mp4", | |
301 512); | |
302 } | |
303 | |
293 TEST_F(MP4StreamParserTest, MPEG2_AAC_LC) { | 304 TEST_F(MP4StreamParserTest, MPEG2_AAC_LC) { |
294 InSequence s; | 305 InSequence s; |
295 std::set<int> audio_object_types; | 306 std::set<int> audio_object_types; |
296 audio_object_types.insert(kISO_13818_7_AAC_LC); | 307 audio_object_types.insert(kISO_13818_7_AAC_LC); |
297 parser_.reset(new MP4StreamParser(audio_object_types, false)); | 308 parser_.reset(new MP4StreamParser(audio_object_types, false)); |
298 EXPECT_MEDIA_LOG(AudioCodecLog("mp4a.67")); | 309 EXPECT_MEDIA_LOG(AudioCodecLog("mp4a.67")); |
299 EXPECT_MEDIA_LOG(AudioCodecLog("mp4a.40.2")); | 310 EXPECT_MEDIA_LOG(AudioCodecLog("mp4a.40.2")); |
300 auto params = GetDefaultInitParametersExpectations(); | 311 auto params = GetDefaultInitParametersExpectations(); |
301 params.detected_video_track_count = 0; | 312 params.detected_video_track_count = 0; |
302 InitializeParserWithInitParametersExpectations(params); | 313 InitializeParserWithInitParametersExpectations(params); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
570 const MediaTrack& audio_track2 = *(media_tracks_->tracks()[3]); | 581 const MediaTrack& audio_track2 = *(media_tracks_->tracks()[3]); |
571 EXPECT_EQ(audio_track2.type(), MediaTrack::Audio); | 582 EXPECT_EQ(audio_track2.type(), MediaTrack::Audio); |
572 EXPECT_EQ(audio_track2.bytestream_track_id(), 4); | 583 EXPECT_EQ(audio_track2.bytestream_track_id(), 4); |
573 EXPECT_EQ(audio_track2.kind(), ""); | 584 EXPECT_EQ(audio_track2.kind(), ""); |
574 EXPECT_EQ(audio_track2.label(), "SoundHandler"); | 585 EXPECT_EQ(audio_track2.label(), "SoundHandler"); |
575 EXPECT_EQ(audio_track2.language(), "und"); | 586 EXPECT_EQ(audio_track2.language(), "und"); |
576 } | 587 } |
577 | 588 |
578 } // namespace mp4 | 589 } // namespace mp4 |
579 } // namespace media | 590 } // namespace media |
OLD | NEW |