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 <utility> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "media/base/video_types.h" | 10 #include "media/base/video_types.h" |
9 #include "media/base/video_util.h" | 11 #include "media/base/video_util.h" |
10 #include "media/formats/mp4/avc.h" | 12 #include "media/formats/mp4/avc.h" |
11 #include "media/formats/mp4/es_descriptor.h" | 13 #include "media/formats/mp4/es_descriptor.h" |
12 #include "media/formats/mp4/rcheck.h" | 14 #include "media/formats/mp4/rcheck.h" |
13 | 15 |
14 #if defined(ENABLE_HEVC_DEMUXING) | 16 #if defined(ENABLE_HEVC_DEMUXING) |
15 #include "media/formats/mp4/hevc.h" | 17 #include "media/formats/mp4/hevc.h" |
16 #endif | 18 #endif |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 return false; | 515 return false; |
514 } | 516 } |
515 } | 517 } |
516 | 518 |
517 if (IsFormatValidH264(format, sinf)) { | 519 if (IsFormatValidH264(format, sinf)) { |
518 DVLOG(2) << __FUNCTION__ | 520 DVLOG(2) << __FUNCTION__ |
519 << " reading AVCDecoderConfigurationRecord (avcC)"; | 521 << " reading AVCDecoderConfigurationRecord (avcC)"; |
520 scoped_ptr<AVCDecoderConfigurationRecord> avcConfig( | 522 scoped_ptr<AVCDecoderConfigurationRecord> avcConfig( |
521 new AVCDecoderConfigurationRecord()); | 523 new AVCDecoderConfigurationRecord()); |
522 RCHECK(reader->ReadChild(avcConfig.get())); | 524 RCHECK(reader->ReadChild(avcConfig.get())); |
523 frame_bitstream_converter = make_scoped_refptr( | 525 frame_bitstream_converter = |
524 new AVCBitstreamConverter(avcConfig.Pass())); | 526 make_scoped_refptr(new AVCBitstreamConverter(std::move(avcConfig))); |
525 video_codec = kCodecH264; | 527 video_codec = kCodecH264; |
526 video_codec_profile = H264PROFILE_MAIN; | 528 video_codec_profile = H264PROFILE_MAIN; |
527 #if defined(ENABLE_HEVC_DEMUXING) | 529 #if defined(ENABLE_HEVC_DEMUXING) |
528 } else if (IsFormatValidHEVC(format, sinf)) { | 530 } else if (IsFormatValidHEVC(format, sinf)) { |
529 DVLOG(2) << __FUNCTION__ | 531 DVLOG(2) << __FUNCTION__ |
530 << " parsing HEVCDecoderConfigurationRecord (hvcC)"; | 532 << " parsing HEVCDecoderConfigurationRecord (hvcC)"; |
531 scoped_ptr<HEVCDecoderConfigurationRecord> hevcConfig( | 533 scoped_ptr<HEVCDecoderConfigurationRecord> hevcConfig( |
532 new HEVCDecoderConfigurationRecord()); | 534 new HEVCDecoderConfigurationRecord()); |
533 RCHECK(reader->ReadChild(hevcConfig.get())); | 535 RCHECK(reader->ReadChild(hevcConfig.get())); |
534 frame_bitstream_converter = make_scoped_refptr( | 536 frame_bitstream_converter = |
535 new HEVCBitstreamConverter(hevcConfig.Pass())); | 537 make_scoped_refptr(new HEVCBitstreamConverter(std::move(hevcConfig))); |
536 video_codec = kCodecHEVC; | 538 video_codec = kCodecHEVC; |
537 #endif | 539 #endif |
538 } else { | 540 } else { |
539 // Unknown/unsupported format | 541 // Unknown/unsupported format |
540 MEDIA_LOG(ERROR, reader->media_log()) << __FUNCTION__ | 542 MEDIA_LOG(ERROR, reader->media_log()) << __FUNCTION__ |
541 << " unsupported video format " | 543 << " unsupported video format " |
542 << FourCCToString(format); | 544 << FourCCToString(format); |
543 return false; | 545 return false; |
544 } | 546 } |
545 | 547 |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( | 1041 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( |
1040 size_t i) const { | 1042 size_t i) const { |
1041 if (i >= sample_depends_on_.size()) | 1043 if (i >= sample_depends_on_.size()) |
1042 return kSampleDependsOnUnknown; | 1044 return kSampleDependsOnUnknown; |
1043 | 1045 |
1044 return sample_depends_on_[i]; | 1046 return sample_depends_on_[i]; |
1045 } | 1047 } |
1046 | 1048 |
1047 } // namespace mp4 | 1049 } // namespace mp4 |
1048 } // namespace media | 1050 } // namespace media |
OLD | NEW |