Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: media/formats/mp4/box_definitions.cc

Issue 1874413003: Convert media/formats to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <utility> 8 #include <utility>
8 9
9 #include "base/logging.h" 10 #include "base/logging.h"
10 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
11 #include "media/base/video_types.h" 12 #include "media/base/video_types.h"
12 #include "media/base/video_util.h" 13 #include "media/base/video_util.h"
13 #include "media/formats/mp4/avc.h" 14 #include "media/formats/mp4/avc.h"
14 #include "media/formats/mp4/es_descriptor.h" 15 #include "media/formats/mp4/es_descriptor.h"
15 #include "media/formats/mp4/rcheck.h" 16 #include "media/formats/mp4/rcheck.h"
16 #include "media/media_features.h" 17 #include "media/media_features.h"
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 // we run out of protection schemes. 631 // we run out of protection schemes.
631 while (sinf.type.type != FOURCC_CENC) { 632 while (sinf.type.type != FOURCC_CENC) {
632 if (!reader->ReadChild(&sinf)) 633 if (!reader->ReadChild(&sinf))
633 return false; 634 return false;
634 } 635 }
635 } 636 }
636 637
637 if (IsFormatValidH264(format, sinf)) { 638 if (IsFormatValidH264(format, sinf)) {
638 DVLOG(2) << __FUNCTION__ 639 DVLOG(2) << __FUNCTION__
639 << " reading AVCDecoderConfigurationRecord (avcC)"; 640 << " reading AVCDecoderConfigurationRecord (avcC)";
640 scoped_ptr<AVCDecoderConfigurationRecord> avcConfig( 641 std::unique_ptr<AVCDecoderConfigurationRecord> avcConfig(
641 new AVCDecoderConfigurationRecord()); 642 new AVCDecoderConfigurationRecord());
642 RCHECK(reader->ReadChild(avcConfig.get())); 643 RCHECK(reader->ReadChild(avcConfig.get()));
643 frame_bitstream_converter = 644 frame_bitstream_converter =
644 make_scoped_refptr(new AVCBitstreamConverter(std::move(avcConfig))); 645 make_scoped_refptr(new AVCBitstreamConverter(std::move(avcConfig)));
645 video_codec = kCodecH264; 646 video_codec = kCodecH264;
646 video_codec_profile = H264PROFILE_MAIN; 647 video_codec_profile = H264PROFILE_MAIN;
647 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) 648 #if BUILDFLAG(ENABLE_HEVC_DEMUXING)
648 } else if (IsFormatValidHEVC(format, sinf)) { 649 } else if (IsFormatValidHEVC(format, sinf)) {
649 DVLOG(2) << __FUNCTION__ 650 DVLOG(2) << __FUNCTION__
650 << " parsing HEVCDecoderConfigurationRecord (hvcC)"; 651 << " parsing HEVCDecoderConfigurationRecord (hvcC)";
651 scoped_ptr<HEVCDecoderConfigurationRecord> hevcConfig( 652 std::unique_ptr<HEVCDecoderConfigurationRecord> hevcConfig(
652 new HEVCDecoderConfigurationRecord()); 653 new HEVCDecoderConfigurationRecord());
653 RCHECK(reader->ReadChild(hevcConfig.get())); 654 RCHECK(reader->ReadChild(hevcConfig.get()));
654 frame_bitstream_converter = 655 frame_bitstream_converter =
655 make_scoped_refptr(new HEVCBitstreamConverter(std::move(hevcConfig))); 656 make_scoped_refptr(new HEVCBitstreamConverter(std::move(hevcConfig)));
656 video_codec = kCodecHEVC; 657 video_codec = kCodecHEVC;
657 #endif 658 #endif
658 } else { 659 } else {
659 // Unknown/unsupported format 660 // Unknown/unsupported format
660 MEDIA_LOG(ERROR, reader->media_log()) << __FUNCTION__ 661 MEDIA_LOG(ERROR, reader->media_log()) << __FUNCTION__
661 << " unsupported video format " 662 << " unsupported video format "
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( 1216 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on(
1216 size_t i) const { 1217 size_t i) const {
1217 if (i >= sample_depends_on_.size()) 1218 if (i >= sample_depends_on_.size())
1218 return kSampleDependsOnUnknown; 1219 return kSampleDependsOnUnknown;
1219 1220
1220 return sample_depends_on_[i]; 1221 return sample_depends_on_[i];
1221 } 1222 }
1222 1223
1223 } // namespace mp4 1224 } // namespace mp4
1224 } // namespace media 1225 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698