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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 if (type.type == FOURCC_CENC) | 279 if (type.type == FOURCC_CENC) |
280 RCHECK(reader->ReadChild(&info)); | 280 RCHECK(reader->ReadChild(&info)); |
281 // Other protection schemes are silently ignored. Since the protection scheme | 281 // Other protection schemes are silently ignored. Since the protection scheme |
282 // type can't be determined until this box is opened, we return 'true' for | 282 // type can't be determined until this box is opened, we return 'true' for |
283 // non-CENC protection scheme types. It is the parent box's responsibility to | 283 // non-CENC protection scheme types. It is the parent box's responsibility to |
284 // ensure that this scheme type is a supported one. | 284 // ensure that this scheme type is a supported one. |
285 return true; | 285 return true; |
286 } | 286 } |
287 | 287 |
288 MovieHeader::MovieHeader() | 288 MovieHeader::MovieHeader() |
289 : creation_time(0), | 289 : version(0), |
| 290 creation_time(0), |
290 modification_time(0), | 291 modification_time(0), |
291 timescale(0), | 292 timescale(0), |
292 duration(0), | 293 duration(0), |
293 rate(-1), | 294 rate(-1), |
294 volume(-1), | 295 volume(-1), |
295 next_track_id(0) {} | 296 next_track_id(0) {} |
296 MovieHeader::MovieHeader(const MovieHeader& other) = default; | 297 MovieHeader::MovieHeader(const MovieHeader& other) = default; |
297 MovieHeader::~MovieHeader() {} | 298 MovieHeader::~MovieHeader() {} |
298 FourCC MovieHeader::BoxType() const { return FOURCC_MVHD; } | 299 FourCC MovieHeader::BoxType() const { return FOURCC_MVHD; } |
299 | 300 |
300 bool MovieHeader::Parse(BoxReader* reader) { | 301 bool MovieHeader::Parse(BoxReader* reader) { |
301 RCHECK(reader->ReadFullBoxHeader()); | 302 RCHECK(reader->ReadFullBoxHeader()); |
| 303 version = reader->version(); |
302 | 304 |
303 if (reader->version() == 1) { | 305 if (version == 1) { |
304 RCHECK(reader->Read8(&creation_time) && | 306 RCHECK(reader->Read8(&creation_time) && |
305 reader->Read8(&modification_time) && | 307 reader->Read8(&modification_time) && |
306 reader->Read4(×cale) && | 308 reader->Read4(×cale) && |
307 reader->Read8(&duration)); | 309 reader->Read8(&duration)); |
308 } else { | 310 } else { |
309 RCHECK(reader->Read4Into8(&creation_time) && | 311 RCHECK(reader->Read4Into8(&creation_time) && |
310 reader->Read4Into8(&modification_time) && | 312 reader->Read4Into8(&modification_time) && |
311 reader->Read4(×cale) && | 313 reader->Read4(×cale) && |
312 reader->Read4Into8(&duration)); | 314 reader->Read4Into8(&duration)); |
313 } | 315 } |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1275 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( | 1277 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( |
1276 size_t i) const { | 1278 size_t i) const { |
1277 if (i >= sample_depends_on_.size()) | 1279 if (i >= sample_depends_on_.size()) |
1278 return kSampleDependsOnUnknown; | 1280 return kSampleDependsOnUnknown; |
1279 | 1281 |
1280 return sample_depends_on_[i]; | 1282 return sample_depends_on_[i]; |
1281 } | 1283 } |
1282 | 1284 |
1283 } // namespace mp4 | 1285 } // namespace mp4 |
1284 } // namespace media | 1286 } // namespace media |
OLD | NEW |