| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 603 uint8_t num_sps; | 603 uint8_t num_sps; |
| 604 RCHECK(reader->Read1(&num_sps)); | 604 RCHECK(reader->Read1(&num_sps)); |
| 605 num_sps &= 0x1f; | 605 num_sps &= 0x1f; |
| 606 | 606 |
| 607 sps_list.resize(num_sps); | 607 sps_list.resize(num_sps); |
| 608 for (int i = 0; i < num_sps; i++) { | 608 for (int i = 0; i < num_sps; i++) { |
| 609 uint16_t sps_length; | 609 uint16_t sps_length; |
| 610 RCHECK(reader->Read2(&sps_length) && | 610 RCHECK(reader->Read2(&sps_length) && |
| 611 reader->ReadVec(&sps_list[i], sps_length)); | 611 reader->ReadVec(&sps_list[i], sps_length)); |
| 612 RCHECK(sps_list[i].size() > 4); | 612 RCHECK(sps_list[i].size() > 4); |
| 613 | |
| 614 if (media_log.get()) { | |
| 615 MEDIA_LOG(INFO, media_log) << "Video codec: avc1." | |
| 616 << base::HexEncode(sps_list[i].data() + 1, 3); | |
| 617 } | |
| 618 } | 613 } |
| 619 | 614 |
| 620 uint8_t num_pps; | 615 uint8_t num_pps; |
| 621 RCHECK(reader->Read1(&num_pps)); | 616 RCHECK(reader->Read1(&num_pps)); |
| 622 | 617 |
| 623 pps_list.resize(num_pps); | 618 pps_list.resize(num_pps); |
| 624 for (int i = 0; i < num_pps; i++) { | 619 for (int i = 0; i < num_pps; i++) { |
| 625 uint16_t pps_length; | 620 uint16_t pps_length; |
| 626 RCHECK(reader->Read2(&pps_length) && | 621 RCHECK(reader->Read2(&pps_length) && |
| 627 reader->ReadVec(&pps_list[i], pps_length)); | 622 reader->ReadVec(&pps_list[i], pps_length)); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 bool ElementaryStreamDescriptor::Parse(BoxReader* reader) { | 803 bool ElementaryStreamDescriptor::Parse(BoxReader* reader) { |
| 809 std::vector<uint8_t> data; | 804 std::vector<uint8_t> data; |
| 810 ESDescriptor es_desc; | 805 ESDescriptor es_desc; |
| 811 | 806 |
| 812 RCHECK(reader->ReadFullBoxHeader()); | 807 RCHECK(reader->ReadFullBoxHeader()); |
| 813 RCHECK(reader->ReadVec(&data, reader->box_size() - reader->pos())); | 808 RCHECK(reader->ReadVec(&data, reader->box_size() - reader->pos())); |
| 814 RCHECK(es_desc.Parse(data)); | 809 RCHECK(es_desc.Parse(data)); |
| 815 | 810 |
| 816 object_type = es_desc.object_type(); | 811 object_type = es_desc.object_type(); |
| 817 | 812 |
| 818 if (object_type != 0x40) { | |
| 819 MEDIA_LOG(INFO, reader->media_log()) << "Audio codec: mp4a." << std::hex | |
| 820 << static_cast<int>(object_type); | |
| 821 } | |
| 822 | |
| 823 if (es_desc.IsAAC(object_type)) | 813 if (es_desc.IsAAC(object_type)) |
| 824 RCHECK(aac.Parse(es_desc.decoder_specific_info(), reader->media_log())); | 814 RCHECK(aac.Parse(es_desc.decoder_specific_info(), reader->media_log())); |
| 825 | 815 |
| 826 return true; | 816 return true; |
| 827 } | 817 } |
| 828 | 818 |
| 829 AudioSampleEntry::AudioSampleEntry() | 819 AudioSampleEntry::AudioSampleEntry() |
| 830 : format(FOURCC_NULL), | 820 : format(FOURCC_NULL), |
| 831 data_reference_index(0), | 821 data_reference_index(0), |
| 832 channelcount(0), | 822 channelcount(0), |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1400 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( | 1390 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( |
| 1401 size_t i) const { | 1391 size_t i) const { |
| 1402 if (i >= sample_depends_on_.size()) | 1392 if (i >= sample_depends_on_.size()) |
| 1403 return kSampleDependsOnUnknown; | 1393 return kSampleDependsOnUnknown; |
| 1404 | 1394 |
| 1405 return sample_depends_on_[i]; | 1395 return sample_depends_on_[i]; |
| 1406 } | 1396 } |
| 1407 | 1397 |
| 1408 } // namespace mp4 | 1398 } // namespace mp4 |
| 1409 } // namespace media | 1399 } // namespace media |
| OLD | NEW |