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 <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 Loading... |
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 Loading... |
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 |
OLD | NEW |