| 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 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 bool IndependentAndDisposableSamples::Parse(BoxReader* reader) { | 794 bool IndependentAndDisposableSamples::Parse(BoxReader* reader) { |
| 795 RCHECK(reader->ReadFullBoxHeader()); | 795 RCHECK(reader->ReadFullBoxHeader()); |
| 796 RCHECK(reader->version() == 0); | 796 RCHECK(reader->version() == 0); |
| 797 RCHECK(reader->flags() == 0); | 797 RCHECK(reader->flags() == 0); |
| 798 | 798 |
| 799 int sample_count = reader->size() - reader->pos(); | 799 int sample_count = reader->size() - reader->pos(); |
| 800 sample_depends_on_.resize(sample_count); | 800 sample_depends_on_.resize(sample_count); |
| 801 for (int i = 0; i < sample_count; ++i) { | 801 for (int i = 0; i < sample_count; ++i) { |
| 802 uint8 sample_info; | 802 uint8 sample_info; |
| 803 RCHECK(reader->Read1(&sample_info)); | 803 RCHECK(reader->Read1(&sample_info)); |
| 804 RCHECK((sample_info >> 6) == 0); // reserved. | |
| 805 | 804 |
| 806 sample_depends_on_[i] = | 805 sample_depends_on_[i] = |
| 807 static_cast<SampleDependsOn>((sample_info >> 4) & 0x3); | 806 static_cast<SampleDependsOn>((sample_info >> 4) & 0x3); |
| 808 | 807 |
| 809 RCHECK(sample_depends_on_[i] != kSampleDependsOnReserved); | 808 RCHECK(sample_depends_on_[i] != kSampleDependsOnReserved); |
| 810 } | 809 } |
| 811 | 810 |
| 812 return true; | 811 return true; |
| 813 } | 812 } |
| 814 | 813 |
| 815 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( | 814 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( |
| 816 size_t i) const { | 815 size_t i) const { |
| 817 if (i >= sample_depends_on_.size()) | 816 if (i >= sample_depends_on_.size()) |
| 818 return kSampleDependsOnUnknown; | 817 return kSampleDependsOnUnknown; |
| 819 | 818 |
| 820 return sample_depends_on_[i]; | 819 return sample_depends_on_[i]; |
| 821 } | 820 } |
| 822 | 821 |
| 823 } // namespace mp4 | 822 } // namespace mp4 |
| 824 } // namespace media | 823 } // namespace media |
| OLD | NEW |