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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 bool sample_size_present = (flags & 0x200) != 0; | 754 bool sample_size_present = (flags & 0x200) != 0; |
755 bool sample_flags_present = (flags & 0x400) != 0; | 755 bool sample_flags_present = (flags & 0x400) != 0; |
756 bool sample_composition_time_offsets_present = (flags & 0x800) != 0; | 756 bool sample_composition_time_offsets_present = (flags & 0x800) != 0; |
757 | 757 |
758 if (data_offset_present) { | 758 if (data_offset_present) { |
759 RCHECK(reader->Read4(&data_offset)); | 759 RCHECK(reader->Read4(&data_offset)); |
760 } else { | 760 } else { |
761 data_offset = 0; | 761 data_offset = 0; |
762 } | 762 } |
763 | 763 |
764 uint32 first_sample_flags; | 764 uint32 first_sample_flags = 0; |
765 if (first_sample_flags_present) | 765 if (first_sample_flags_present) |
766 RCHECK(reader->Read4(&first_sample_flags)); | 766 RCHECK(reader->Read4(&first_sample_flags)); |
767 | 767 |
768 int fields = sample_duration_present + sample_size_present + | 768 int fields = sample_duration_present + sample_size_present + |
769 sample_flags_present + sample_composition_time_offsets_present; | 769 sample_flags_present + sample_composition_time_offsets_present; |
770 RCHECK(reader->HasBytes(fields * sample_count)); | 770 RCHECK(reader->HasBytes(fields * sample_count)); |
771 | 771 |
772 if (sample_duration_present) | 772 if (sample_duration_present) |
773 sample_durations.resize(sample_count); | 773 sample_durations.resize(sample_count); |
774 if (sample_size_present) | 774 if (sample_size_present) |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( | 950 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( |
951 size_t i) const { | 951 size_t i) const { |
952 if (i >= sample_depends_on_.size()) | 952 if (i >= sample_depends_on_.size()) |
953 return kSampleDependsOnUnknown; | 953 return kSampleDependsOnUnknown; |
954 | 954 |
955 return sample_depends_on_[i]; | 955 return sample_depends_on_[i]; |
956 } | 956 } |
957 | 957 |
958 } // namespace mp4 | 958 } // namespace mp4 |
959 } // namespace media | 959 } // namespace media |
OLD | NEW |