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 <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 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 } | 1197 } |
1198 return true; | 1198 return true; |
1199 } | 1199 } |
1200 | 1200 |
1201 TrackFragment::TrackFragment() {} | 1201 TrackFragment::TrackFragment() {} |
1202 TrackFragment::TrackFragment(const TrackFragment& other) = default; | 1202 TrackFragment::TrackFragment(const TrackFragment& other) = default; |
1203 TrackFragment::~TrackFragment() {} | 1203 TrackFragment::~TrackFragment() {} |
1204 FourCC TrackFragment::BoxType() const { return FOURCC_TRAF; } | 1204 FourCC TrackFragment::BoxType() const { return FOURCC_TRAF; } |
1205 | 1205 |
1206 bool TrackFragment::Parse(BoxReader* reader) { | 1206 bool TrackFragment::Parse(BoxReader* reader) { |
1207 RCHECK(reader->ScanChildren() && | 1207 RCHECK(reader->ScanChildren() && reader->ReadChild(&header) && |
1208 reader->ReadChild(&header) && | |
1209 // Media Source specific: 'tfdt' required | 1208 // Media Source specific: 'tfdt' required |
1210 reader->ReadChild(&decode_time) && | 1209 reader->ReadChild(&decode_time) && reader->MaybeReadChildren(&runs) && |
1211 reader->MaybeReadChildren(&runs) && | |
1212 reader->MaybeReadChild(&auxiliary_offset) && | 1210 reader->MaybeReadChild(&auxiliary_offset) && |
1213 reader->MaybeReadChild(&auxiliary_size) && | 1211 reader->MaybeReadChild(&auxiliary_size) && |
1214 reader->MaybeReadChild(&sdtp)); | 1212 reader->MaybeReadChild(&sdtp) && |
| 1213 reader->MaybeReadChild(&sample_encryption)); |
1215 | 1214 |
1216 // There could be multiple SampleGroupDescription and SampleToGroup boxes with | 1215 // There could be multiple SampleGroupDescription and SampleToGroup boxes with |
1217 // different grouping types. For common encryption, the relevant grouping type | 1216 // different grouping types. For common encryption, the relevant grouping type |
1218 // is 'seig'. Continue reading until 'seig' is found, or until running out of | 1217 // is 'seig'. Continue reading until 'seig' is found, or until running out of |
1219 // child boxes. | 1218 // child boxes. |
1220 while (reader->HasChild(&sample_group_description)) { | 1219 while (reader->HasChild(&sample_group_description)) { |
1221 RCHECK(reader->ReadChild(&sample_group_description)); | 1220 RCHECK(reader->ReadChild(&sample_group_description)); |
1222 if (sample_group_description.grouping_type == FOURCC_SEIG) | 1221 if (sample_group_description.grouping_type == FOURCC_SEIG) |
1223 break; | 1222 break; |
1224 sample_group_description.entries.clear(); | 1223 sample_group_description.entries.clear(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( | 1273 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( |
1275 size_t i) const { | 1274 size_t i) const { |
1276 if (i >= sample_depends_on_.size()) | 1275 if (i >= sample_depends_on_.size()) |
1277 return kSampleDependsOnUnknown; | 1276 return kSampleDependsOnUnknown; |
1278 | 1277 |
1279 return sample_depends_on_[i]; | 1278 return sample_depends_on_[i]; |
1280 } | 1279 } |
1281 | 1280 |
1282 } // namespace mp4 | 1281 } // namespace mp4 |
1283 } // namespace media | 1282 } // namespace media |
OLD | NEW |