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 <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
289 EXPECT_FALSE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); | 289 EXPECT_FALSE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); |
290 } | 290 } |
291 | 291 |
292 // Test a file where all video samples start with an Access Unit | 292 // Test a file where all video samples start with an Access Unit |
293 // Delimiter (AUD) NALU. | 293 // Delimiter (AUD) NALU. |
294 TEST_F(MP4StreamParserTest, VideoSamplesStartWithAUDs) { | 294 TEST_F(MP4StreamParserTest, VideoSamplesStartWithAUDs) { |
295 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.4d4028")); | 295 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.4d4028")); |
296 ParseMP4File("bear-1280x720-av_with-aud-nalus_frag.mp4", 512); | 296 ParseMP4File("bear-1280x720-av_with-aud-nalus_frag.mp4", 512); |
297 } | 297 } |
298 | 298 |
299 #if defined(ENABLE_HEVC_DEMUXING) | 299 #if defined(ENABLE_HEVC_DEMUXING) |
ddorwin
2016/01/04 23:22:18
Ditto (below).
servolk
2016/01/07 02:30:04
Acknowledged.
| |
300 TEST_F(MP4StreamParserTest, HEVC_in_MP4_container) { | 300 TEST_F(MP4StreamParserTest, HEVC_in_MP4_container) { |
301 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED); | 301 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED); |
302 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile("bear-hevc-frag.mp4"); | 302 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile("bear-hevc-frag.mp4"); |
303 EXPECT_MEDIA_LOG(VideoCodecLog("hevc")); | 303 EXPECT_MEDIA_LOG(VideoCodecLog("hevc")); |
304 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); | 304 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); |
305 } | 305 } |
306 #endif | 306 #endif |
307 | 307 |
308 TEST_F(MP4StreamParserTest, CENC) { | 308 TEST_F(MP4StreamParserTest, CENC) { |
309 // Encrypted test mp4 files have non-zero duration and are treated as | 309 // Encrypted test mp4 files have non-zero duration and are treated as |
(...skipping 21 matching lines...) Expand all Loading... | |
331 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED); | 331 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED); |
332 | 332 |
333 scoped_refptr<DecoderBuffer> buffer = | 333 scoped_refptr<DecoderBuffer> buffer = |
334 ReadTestDataFile("bear-640x360-non_square_pixel-with_pasp.mp4"); | 334 ReadTestDataFile("bear-640x360-non_square_pixel-with_pasp.mp4"); |
335 | 335 |
336 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.6401e")); | 336 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.6401e")); |
337 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); | 337 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); |
338 EXPECT_EQ(gfx::Size(639, 360), video_decoder_config_.natural_size()); | 338 EXPECT_EQ(gfx::Size(639, 360), video_decoder_config_.natural_size()); |
339 } | 339 } |
340 | 340 |
341 #if defined(ENABLE_AC3_EAC3_AUDIO_DEMUXING) | |
ddorwin
2016/01/04 23:22:18
As before, can we expect a graceful failure when n
servolk
2016/01/07 02:30:04
No other tests do that, so currently the helper cl
ddorwin
2016/01/07 19:12:43
Failure without crashing or hanging (timeout).
servolk
2016/01/07 21:17:36
Ok, I'll see if we can do this easily here.
servolk
2016/01/08 00:53:33
I guess we could do something like this
https://co
| |
342 TEST_F(MP4StreamParserTest, DemuxingAC3) { | |
343 std::set<int> audio_object_types; | |
344 audio_object_types.insert(kAC3); | |
345 parser_.reset(new MP4StreamParser(audio_object_types, false)); | |
346 ParseMP4File("bear-ac3-frag.mp4", 512); | |
ddorwin
2016/01/04 23:22:18
Comments on test files:
* Do these files have vid
servolk
2016/01/07 02:30:04
No, these are audio-only files, renamed. Also upda
| |
347 } | |
348 | |
349 TEST_F(MP4StreamParserTest, DemuxingEAC3) { | |
350 std::set<int> audio_object_types; | |
351 audio_object_types.insert(kEAC3); | |
352 parser_.reset(new MP4StreamParser(audio_object_types, false)); | |
353 ParseMP4File("bear-eac3-frag.mp4", 512); | |
354 } | |
355 #endif | |
356 | |
341 } // namespace mp4 | 357 } // namespace mp4 |
342 } // namespace media | 358 } // namespace media |
OLD | NEW |