| 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 | 511 |
| 512 if (format == FOURCC_ENCV) { | 512 if (format == FOURCC_ENCV) { |
| 513 // Continue scanning until a recognized protection scheme is found, or until | 513 // Continue scanning until a recognized protection scheme is found, or until |
| 514 // we run out of protection schemes. | 514 // we run out of protection schemes. |
| 515 while (sinf.type.type != FOURCC_CENC) { | 515 while (sinf.type.type != FOURCC_CENC) { |
| 516 if (!reader->ReadChild(&sinf)) | 516 if (!reader->ReadChild(&sinf)) |
| 517 return false; | 517 return false; |
| 518 } | 518 } |
| 519 } | 519 } |
| 520 | 520 |
| 521 if (IsFormatValid()) | 521 if (IsFormatValid()) { |
| 522 RCHECK(reader->ReadChild(&avcc)); | 522 scoped_ptr<AVCDecoderConfigurationRecord> avcConfig( |
| 523 new AVCDecoderConfigurationRecord()); |
| 524 RCHECK(reader->ReadChild(avcConfig.get())); |
| 525 frame_bitstream_converter = make_scoped_refptr( |
| 526 new AVCBitstreamConverter(avcConfig.Pass())); |
| 527 } |
| 523 | 528 |
| 524 return true; | 529 return true; |
| 525 } | 530 } |
| 526 | 531 |
| 527 bool VideoSampleEntry::IsFormatValid() const { | 532 bool VideoSampleEntry::IsFormatValid() const { |
| 528 return format == FOURCC_AVC1 || format == FOURCC_AVC3 || | 533 return format == FOURCC_AVC1 || format == FOURCC_AVC3 || |
| 529 (format == FOURCC_ENCV && (sinf.format.format == FOURCC_AVC1 || | 534 (format == FOURCC_ENCV && (sinf.format.format == FOURCC_AVC1 || |
| 530 sinf.format.format == FOURCC_AVC3)); | 535 sinf.format.format == FOURCC_AVC3)); |
| 531 } | 536 } |
| 532 | 537 |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( | 1020 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( |
| 1016 size_t i) const { | 1021 size_t i) const { |
| 1017 if (i >= sample_depends_on_.size()) | 1022 if (i >= sample_depends_on_.size()) |
| 1018 return kSampleDependsOnUnknown; | 1023 return kSampleDependsOnUnknown; |
| 1019 | 1024 |
| 1020 return sample_depends_on_[i]; | 1025 return sample_depends_on_[i]; |
| 1021 } | 1026 } |
| 1022 | 1027 |
| 1023 } // namespace mp4 | 1028 } // namespace mp4 |
| 1024 } // namespace media | 1029 } // namespace media |
| OLD | NEW |