Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: media/formats/mp4/box_definitions.cc

Issue 2702803002: media-internals: Remove audio/video codec reporting from mp4 parser (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/formats/mp4/aac.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
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) { 813 if (object_type != 0x40) {
819 MEDIA_LOG(INFO, reader->media_log()) << "Audio codec: mp4a." << std::hex 814 MEDIA_LOG(INFO, reader->media_log()) << "Audio codec: mp4a." << std::hex
wolenetz 2017/02/17 19:48:38 you'll probably want to be consistent and remove t
xhwang 2017/02/17 21:13:59 Done.
820 << static_cast<int>(object_type); 815 << static_cast<int>(object_type);
821 } 816 }
822 817
823 if (es_desc.IsAAC(object_type)) 818 if (es_desc.IsAAC(object_type))
824 RCHECK(aac.Parse(es_desc.decoder_specific_info(), reader->media_log())); 819 RCHECK(aac.Parse(es_desc.decoder_specific_info(), reader->media_log()));
825 820
826 return true; 821 return true;
827 } 822 }
828 823
829 AudioSampleEntry::AudioSampleEntry() 824 AudioSampleEntry::AudioSampleEntry()
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
1400 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( 1395 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on(
1401 size_t i) const { 1396 size_t i) const {
1402 if (i >= sample_depends_on_.size()) 1397 if (i >= sample_depends_on_.size())
1403 return kSampleDependsOnUnknown; 1398 return kSampleDependsOnUnknown;
1404 1399
1405 return sample_depends_on_[i]; 1400 return sample_depends_on_[i];
1406 } 1401 }
1407 1402
1408 } // namespace mp4 1403 } // namespace mp4
1409 } // namespace media 1404 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp4/aac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698