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/box_definitions.h" | 5 #include "media/formats/mp4/box_definitions.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/formats/mp4/es_descriptor.h" | 8 #include "media/formats/mp4/es_descriptor.h" |
9 #include "media/formats/mp4/rcheck.h" | 9 #include "media/formats/mp4/rcheck.h" |
10 | 10 |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 num_sps &= 0x1f; | 386 num_sps &= 0x1f; |
387 | 387 |
388 sps_list.resize(num_sps); | 388 sps_list.resize(num_sps); |
389 for (int i = 0; i < num_sps; i++) { | 389 for (int i = 0; i < num_sps; i++) { |
390 uint16 sps_length; | 390 uint16 sps_length; |
391 RCHECK(reader->Read2(&sps_length) && | 391 RCHECK(reader->Read2(&sps_length) && |
392 reader->ReadVec(&sps_list[i], sps_length)); | 392 reader->ReadVec(&sps_list[i], sps_length)); |
393 RCHECK(sps_list[i].size() > 4); | 393 RCHECK(sps_list[i].size() > 4); |
394 | 394 |
395 if (!log_cb.is_null()) { | 395 if (!log_cb.is_null()) { |
396 MEDIA_LOG(log_cb) << "Video codec: avc1." << std::hex | 396 MEDIA_LOG(INFO, log_cb) << "Video codec: avc1." << std::hex |
397 << static_cast<int>(sps_list[i][1]) | 397 << static_cast<int>(sps_list[i][1]) |
398 << static_cast<int>(sps_list[i][2]) | 398 << static_cast<int>(sps_list[i][2]) |
399 << static_cast<int>(sps_list[i][3]); | 399 << static_cast<int>(sps_list[i][3]); |
400 } | 400 } |
401 } | 401 } |
402 | 402 |
403 uint8 num_pps; | 403 uint8 num_pps; |
404 RCHECK(reader->Read1(&num_pps)); | 404 RCHECK(reader->Read1(&num_pps)); |
405 | 405 |
406 pps_list.resize(num_pps); | 406 pps_list.resize(num_pps); |
407 for (int i = 0; i < num_pps; i++) { | 407 for (int i = 0; i < num_pps; i++) { |
408 uint16 pps_length; | 408 uint16 pps_length; |
409 RCHECK(reader->Read2(&pps_length) && | 409 RCHECK(reader->Read2(&pps_length) && |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 std::vector<uint8> data; | 482 std::vector<uint8> data; |
483 ESDescriptor es_desc; | 483 ESDescriptor es_desc; |
484 | 484 |
485 RCHECK(reader->ReadFullBoxHeader()); | 485 RCHECK(reader->ReadFullBoxHeader()); |
486 RCHECK(reader->ReadVec(&data, reader->size() - reader->pos())); | 486 RCHECK(reader->ReadVec(&data, reader->size() - reader->pos())); |
487 RCHECK(es_desc.Parse(data)); | 487 RCHECK(es_desc.Parse(data)); |
488 | 488 |
489 object_type = es_desc.object_type(); | 489 object_type = es_desc.object_type(); |
490 | 490 |
491 if (object_type != 0x40) { | 491 if (object_type != 0x40) { |
492 MEDIA_LOG(reader->log_cb()) << "Audio codec: mp4a." | 492 MEDIA_LOG(INFO, reader->log_cb()) << "Audio codec: mp4a." << std::hex |
493 << std::hex << static_cast<int>(object_type); | 493 << static_cast<int>(object_type); |
494 } | 494 } |
495 | 495 |
496 if (es_desc.IsAAC(object_type)) | 496 if (es_desc.IsAAC(object_type)) |
497 RCHECK(aac.Parse(es_desc.decoder_specific_info(), reader->log_cb())); | 497 RCHECK(aac.Parse(es_desc.decoder_specific_info(), reader->log_cb())); |
498 | 498 |
499 return true; | 499 return true; |
500 } | 500 } |
501 | 501 |
502 AudioSampleEntry::AudioSampleEntry() | 502 AudioSampleEntry::AudioSampleEntry() |
503 : format(FOURCC_NULL), | 503 : format(FOURCC_NULL), |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
947 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( | 947 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( |
948 size_t i) const { | 948 size_t i) const { |
949 if (i >= sample_depends_on_.size()) | 949 if (i >= sample_depends_on_.size()) |
950 return kSampleDependsOnUnknown; | 950 return kSampleDependsOnUnknown; |
951 | 951 |
952 return sample_depends_on_[i]; | 952 return sample_depends_on_[i]; |
953 } | 953 } |
954 | 954 |
955 } // namespace mp4 | 955 } // namespace mp4 |
956 } // namespace media | 956 } // namespace media |
OLD | NEW |