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

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

Issue 1718773002: Parse ELNG box in MP4 container Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/box_definitions.h ('k') | media/formats/mp4/box_reader.h » ('j') | 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 <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 769
770 MediaInformation::MediaInformation() {} 770 MediaInformation::MediaInformation() {}
771 MediaInformation::~MediaInformation() {} 771 MediaInformation::~MediaInformation() {}
772 FourCC MediaInformation::BoxType() const { return FOURCC_MINF; } 772 FourCC MediaInformation::BoxType() const { return FOURCC_MINF; }
773 773
774 bool MediaInformation::Parse(BoxReader* reader) { 774 bool MediaInformation::Parse(BoxReader* reader) {
775 return reader->ScanChildren() && 775 return reader->ScanChildren() &&
776 reader->ReadChild(&sample_table); 776 reader->ReadChild(&sample_table);
777 } 777 }
778 778
779 ExtendedLanguageTag::ExtendedLanguageTag() {}
780 ExtendedLanguageTag::~ExtendedLanguageTag() {}
781 FourCC ExtendedLanguageTag::BoxType() const {
782 return FOURCC_ELNG;
783 }
784
785 bool ExtendedLanguageTag::Parse(BoxReader* reader) {
786 RCHECK(reader->ReadFullBoxHeader());
787 RCHECK(reader->ReadString(&language_tag));
788 return true;
789 }
790
779 Media::Media() {} 791 Media::Media() {}
780 Media::~Media() {} 792 Media::~Media() {}
781 FourCC Media::BoxType() const { return FOURCC_MDIA; } 793 FourCC Media::BoxType() const { return FOURCC_MDIA; }
782 794
783 bool Media::Parse(BoxReader* reader) { 795 bool Media::Parse(BoxReader* reader) {
784 RCHECK(reader->ScanChildren() && 796 RCHECK(reader->ScanChildren() && reader->ReadChild(&header) &&
785 reader->ReadChild(&header) && 797 reader->MaybeReadChild(&extended_language_tag) &&
786 reader->ReadChild(&handler)); 798 reader->ReadChild(&handler));
787 799
788 // Maddeningly, the HandlerReference box specifies how to parse the 800 // Maddeningly, the HandlerReference box specifies how to parse the
789 // SampleDescription box, making the latter the only box (of those that we 801 // SampleDescription box, making the latter the only box (of those that we
790 // support) which cannot be parsed correctly on its own (or even with 802 // support) which cannot be parsed correctly on its own (or even with
791 // information from its strict ancestor tree). We thus copy the handler type 803 // information from its strict ancestor tree). We thus copy the handler type
792 // to the sample description box *before* parsing it to provide this 804 // to the sample description box *before* parsing it to provide this
793 // information while parsing. 805 // information while parsing.
794 information.sample_table.description.type = handler.type; 806 information.sample_table.description.type = handler.type;
795 RCHECK(reader->ReadChild(&information)); 807 RCHECK(reader->ReadChild(&information));
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1154 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( 1166 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on(
1155 size_t i) const { 1167 size_t i) const {
1156 if (i >= sample_depends_on_.size()) 1168 if (i >= sample_depends_on_.size())
1157 return kSampleDependsOnUnknown; 1169 return kSampleDependsOnUnknown;
1158 1170
1159 return sample_depends_on_[i]; 1171 return sample_depends_on_[i];
1160 } 1172 }
1161 1173
1162 } // namespace mp4 1174 } // namespace mp4
1163 } // namespace media 1175 } // namespace media
OLDNEW
« no previous file with comments | « media/formats/mp4/box_definitions.h ('k') | media/formats/mp4/box_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698