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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 } | 372 } |
373 | 373 |
374 bool AVCDecoderConfigurationRecord::ParseInternal(BufferReader* reader, | 374 bool AVCDecoderConfigurationRecord::ParseInternal(BufferReader* reader, |
375 const LogCB& log_cb) { | 375 const LogCB& log_cb) { |
376 RCHECK(reader->Read1(&version) && version == 1 && | 376 RCHECK(reader->Read1(&version) && version == 1 && |
377 reader->Read1(&profile_indication) && | 377 reader->Read1(&profile_indication) && |
378 reader->Read1(&profile_compatibility) && | 378 reader->Read1(&profile_compatibility) && |
379 reader->Read1(&avc_level)); | 379 reader->Read1(&avc_level)); |
380 | 380 |
381 uint8 length_size_minus_one; | 381 uint8 length_size_minus_one; |
382 RCHECK(reader->Read1(&length_size_minus_one) && | 382 RCHECK(reader->Read1(&length_size_minus_one)); |
383 (length_size_minus_one & 0xfc) == 0xfc); | |
384 length_size = (length_size_minus_one & 0x3) + 1; | 383 length_size = (length_size_minus_one & 0x3) + 1; |
385 | 384 |
386 RCHECK(length_size != 3); // Only values of 1, 2, and 4 are valid. | 385 RCHECK(length_size != 3); // Only values of 1, 2, and 4 are valid. |
387 | 386 |
388 uint8 num_sps; | 387 uint8 num_sps; |
389 RCHECK(reader->Read1(&num_sps) && (num_sps & 0xe0) == 0xe0); | 388 RCHECK(reader->Read1(&num_sps)); |
390 num_sps &= 0x1f; | 389 num_sps &= 0x1f; |
391 | 390 |
392 sps_list.resize(num_sps); | 391 sps_list.resize(num_sps); |
393 for (int i = 0; i < num_sps; i++) { | 392 for (int i = 0; i < num_sps; i++) { |
394 uint16 sps_length; | 393 uint16 sps_length; |
395 RCHECK(reader->Read2(&sps_length) && | 394 RCHECK(reader->Read2(&sps_length) && |
396 reader->ReadVec(&sps_list[i], sps_length)); | 395 reader->ReadVec(&sps_list[i], sps_length)); |
397 RCHECK(sps_list[i].size() > 4); | 396 RCHECK(sps_list[i].size() > 4); |
398 | 397 |
399 if (!log_cb.is_null()) { | 398 if (!log_cb.is_null()) { |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( | 950 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( |
952 size_t i) const { | 951 size_t i) const { |
953 if (i >= sample_depends_on_.size()) | 952 if (i >= sample_depends_on_.size()) |
954 return kSampleDependsOnUnknown; | 953 return kSampleDependsOnUnknown; |
955 | 954 |
956 return sample_depends_on_[i]; | 955 return sample_depends_on_[i]; |
957 } | 956 } |
958 | 957 |
959 } // namespace mp4 | 958 } // namespace mp4 |
960 } // namespace media | 959 } // namespace media |
OLD | NEW |