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

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

Issue 2928873002: Enable VP9 in MP4 by default (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « media/filters/stream_parser_factory.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 make_scoped_refptr(new HEVCBitstreamConverter(std::move(hevcConfig))); 797 make_scoped_refptr(new HEVCBitstreamConverter(std::move(hevcConfig)));
798 DVLOG(2) << __func__ << " reading DolbyVisionConfiguration (dvcC)"; 798 DVLOG(2) << __func__ << " reading DolbyVisionConfiguration (dvcC)";
799 DolbyVisionConfiguration dvccConfig; 799 DolbyVisionConfiguration dvccConfig;
800 RCHECK(reader->ReadChild(&dvccConfig)); 800 RCHECK(reader->ReadChild(&dvccConfig));
801 video_codec = kCodecDolbyVision; 801 video_codec = kCodecDolbyVision;
802 video_codec_profile = dvccConfig.codec_profile; 802 video_codec_profile = dvccConfig.codec_profile;
803 break; 803 break;
804 } 804 }
805 #endif // BUILDFLAG(ENABLE_HEVC_DEMUXING) 805 #endif // BUILDFLAG(ENABLE_HEVC_DEMUXING)
806 #endif // BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) 806 #endif // BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING)
807 case FOURCC_VP09: 807 case FOURCC_VP09: {
808 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 808 DVLOG(2) << __func__ << " parsing VPCodecConfigurationRecord (vpcC)";
809 switches::kEnableVp9InMp4)) { 809 std::unique_ptr<VPCodecConfigurationRecord> vp_config(
810 DVLOG(2) << __func__ << " parsing VPCodecConfigurationRecord (vpcC)"; 810 new VPCodecConfigurationRecord());
811 std::unique_ptr<VPCodecConfigurationRecord> vp_config( 811 RCHECK(reader->ReadChild(vp_config.get()));
812 new VPCodecConfigurationRecord()); 812 frame_bitstream_converter = nullptr;
813 RCHECK(reader->ReadChild(vp_config.get())); 813 video_codec = kCodecVP9;
814 frame_bitstream_converter = nullptr; 814 video_codec_profile = vp_config->profile;
815 video_codec = kCodecVP9;
816 video_codec_profile = vp_config->profile;
817 } else {
818 MEDIA_LOG(ERROR, reader->media_log()) << "VP9 in MP4 is not enabled.";
819 return false;
820 }
821 break; 815 break;
816 }
822 default: 817 default:
823 // Unknown/unsupported format 818 // Unknown/unsupported format
824 MEDIA_LOG(ERROR, reader->media_log()) << __func__ 819 MEDIA_LOG(ERROR, reader->media_log()) << __func__
825 << " unsupported video format " 820 << " unsupported video format "
826 << FourCCToString(actual_format); 821 << FourCCToString(actual_format);
827 return false; 822 return false;
828 } 823 }
829 824
830 return true; 825 return true;
831 } 826 }
832 827
833 bool VideoSampleEntry::IsFormatValid() const { 828 bool VideoSampleEntry::IsFormatValid() const {
834 const FourCC actual_format = 829 const FourCC actual_format =
835 format == FOURCC_ENCV ? sinf.format.format : format; 830 format == FOURCC_ENCV ? sinf.format.format : format;
836 switch (actual_format) { 831 switch (actual_format) {
837 case FOURCC_AVC1: 832 case FOURCC_AVC1:
838 case FOURCC_AVC3: 833 case FOURCC_AVC3:
839 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) 834 #if BUILDFLAG(ENABLE_HEVC_DEMUXING)
840 case FOURCC_HEV1: 835 case FOURCC_HEV1:
841 case FOURCC_HVC1: 836 case FOURCC_HVC1:
842 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) 837 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING)
843 case FOURCC_DVH1: 838 case FOURCC_DVH1:
844 case FOURCC_DVHE: 839 case FOURCC_DVHE:
845 #endif // BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) 840 #endif // BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING)
846 #endif // BUILDFLAG(ENABLE_HEVC_DEMUXING) 841 #endif // BUILDFLAG(ENABLE_HEVC_DEMUXING)
847 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) 842 #if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING)
848 case FOURCC_DVA1: 843 case FOURCC_DVA1:
849 case FOURCC_DVAV: 844 case FOURCC_DVAV:
850 #endif // BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) 845 #endif // BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING)
846 case FOURCC_VP09:
851 return true; 847 return true;
852 case FOURCC_VP09:
853 return base::CommandLine::ForCurrentProcess()->HasSwitch(
854 switches::kEnableVp9InMp4);
855 default: 848 default:
856 return false; 849 return false;
857 } 850 }
858 } 851 }
859 852
860 ElementaryStreamDescriptor::ElementaryStreamDescriptor() 853 ElementaryStreamDescriptor::ElementaryStreamDescriptor()
861 : object_type(kForbidden) {} 854 : object_type(kForbidden) {}
862 855
863 ElementaryStreamDescriptor::ElementaryStreamDescriptor( 856 ElementaryStreamDescriptor::ElementaryStreamDescriptor(
864 const ElementaryStreamDescriptor& other) = default; 857 const ElementaryStreamDescriptor& other) = default;
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
1462 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on( 1455 SampleDependsOn IndependentAndDisposableSamples::sample_depends_on(
1463 size_t i) const { 1456 size_t i) const {
1464 if (i >= sample_depends_on_.size()) 1457 if (i >= sample_depends_on_.size())
1465 return kSampleDependsOnUnknown; 1458 return kSampleDependsOnUnknown;
1466 1459
1467 return sample_depends_on_[i]; 1460 return sample_depends_on_[i];
1468 } 1461 }
1469 1462
1470 } // namespace mp4 1463 } // namespace mp4
1471 } // namespace media 1464 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/stream_parser_factory.cc ('k') | media/test/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698