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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 EXPECT_FALSE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); | 287 EXPECT_FALSE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); |
288 } | 288 } |
289 | 289 |
290 // Test a file where all video samples start with an Access Unit | 290 // Test a file where all video samples start with an Access Unit |
291 // Delimiter (AUD) NALU. | 291 // Delimiter (AUD) NALU. |
292 TEST_F(MP4StreamParserTest, VideoSamplesStartWithAUDs) { | 292 TEST_F(MP4StreamParserTest, VideoSamplesStartWithAUDs) { |
293 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.4d4028")); | 293 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.4d4028")); |
294 ParseMP4File("bear-1280x720-av_with-aud-nalus_frag.mp4", 512); | 294 ParseMP4File("bear-1280x720-av_with-aud-nalus_frag.mp4", 512); |
295 } | 295 } |
296 | 296 |
| 297 #if defined(ENABLE_HEVC_DEMUXING) |
| 298 TEST_F(MP4StreamParserTest, HEVC_in_MP4_container) { |
| 299 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED); |
| 300 scoped_refptr<DecoderBuffer> buffer = ReadTestDataFile("bear-hevc-frag.mp4"); |
| 301 EXPECT_MEDIA_LOG(VideoCodecLog("hevc")); |
| 302 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); |
| 303 } |
| 304 #endif |
| 305 |
297 TEST_F(MP4StreamParserTest, CENC) { | 306 TEST_F(MP4StreamParserTest, CENC) { |
298 // Encrypted test mp4 files have non-zero duration and are treated as | 307 // Encrypted test mp4 files have non-zero duration and are treated as |
299 // recorded streams. | 308 // recorded streams. |
300 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED); | 309 InitializeParserAndExpectLiveness(DemuxerStream::LIVENESS_RECORDED); |
301 | 310 |
302 scoped_refptr<DecoderBuffer> buffer = | 311 scoped_refptr<DecoderBuffer> buffer = |
303 ReadTestDataFile("bear-1280x720-v_frag-cenc.mp4"); | 312 ReadTestDataFile("bear-1280x720-v_frag-cenc.mp4"); |
304 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.6401f")); | 313 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.6401f")); |
305 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); | 314 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); |
306 } | 315 } |
(...skipping 15 matching lines...) Expand all Loading... |
322 scoped_refptr<DecoderBuffer> buffer = | 331 scoped_refptr<DecoderBuffer> buffer = |
323 ReadTestDataFile("bear-640x360-non_square_pixel-with_pasp.mp4"); | 332 ReadTestDataFile("bear-640x360-non_square_pixel-with_pasp.mp4"); |
324 | 333 |
325 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.6401e")); | 334 EXPECT_MEDIA_LOG(VideoCodecLog("avc1.6401e")); |
326 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); | 335 EXPECT_TRUE(AppendDataInPieces(buffer->data(), buffer->data_size(), 512)); |
327 EXPECT_EQ(gfx::Size(639, 360), video_decoder_config_.natural_size()); | 336 EXPECT_EQ(gfx::Size(639, 360), video_decoder_config_.natural_size()); |
328 } | 337 } |
329 | 338 |
330 } // namespace mp4 | 339 } // namespace mp4 |
331 } // namespace media | 340 } // namespace media |
OLD | NEW |