| Index: media/formats/mp4/box_definitions.cc
|
| diff --git a/media/formats/mp4/box_definitions.cc b/media/formats/mp4/box_definitions.cc
|
| index 82a94709f73f5572dd0f2dc6b52fe5c41080b9fb..f8d5a3edd8e5142fa1e84b5f08dac002857ae40b 100644
|
| --- a/media/formats/mp4/box_definitions.cc
|
| +++ b/media/formats/mp4/box_definitions.cc
|
| @@ -565,6 +565,44 @@ bool AVCDecoderConfigurationRecord::ParseInternal(
|
| return true;
|
| }
|
|
|
| +VPCodecConfigurationRecord::VPCodecConfigurationRecord()
|
| + : profile(VIDEO_CODEC_PROFILE_UNKNOWN) {}
|
| +
|
| +VPCodecConfigurationRecord::VPCodecConfigurationRecord(
|
| + const VPCodecConfigurationRecord& other) = default;
|
| +
|
| +VPCodecConfigurationRecord::~VPCodecConfigurationRecord() {}
|
| +
|
| +FourCC VPCodecConfigurationRecord::BoxType() const {
|
| + return FOURCC_VPCC;
|
| +}
|
| +
|
| +bool VPCodecConfigurationRecord::Parse(BoxReader* reader) {
|
| + uint8_t profile_indication = 0;
|
| + RCHECK(reader->ReadFullBoxHeader() && reader->Read1(&profile_indication));
|
| + // The remaining fields are not parsed as we don't care about them for now.
|
| +
|
| + switch (profile_indication) {
|
| + case 0:
|
| + profile = VP9PROFILE_PROFILE0;
|
| + break;
|
| + case 1:
|
| + profile = VP9PROFILE_PROFILE1;
|
| + break;
|
| + case 2:
|
| + profile = VP9PROFILE_PROFILE2;
|
| + break;
|
| + case 3:
|
| + profile = VP9PROFILE_PROFILE3;
|
| + break;
|
| + default:
|
| + MEDIA_LOG(ERROR, reader->media_log()) << "Unsupported VP9 profile: "
|
| + << profile_indication;
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
| +
|
| PixelAspectRatioBox::PixelAspectRatioBox() : h_spacing(1), v_spacing(1) {}
|
| PixelAspectRatioBox::PixelAspectRatioBox(const PixelAspectRatioBox& other) =
|
| default;
|
| @@ -646,12 +684,16 @@ bool VideoSampleEntry::Parse(BoxReader* reader) {
|
| }
|
| #endif
|
| #if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING)
|
| - case FOURCC_VP09:
|
| - frame_bitstream_converter = NULL;
|
| + case FOURCC_VP09: {
|
| + DVLOG(2) << __FUNCTION__ << " parsing VPCodecConfigurationRecord (vpcC)";
|
| + std::unique_ptr<VPCodecConfigurationRecord> vp_config(
|
| + new VPCodecConfigurationRecord());
|
| + RCHECK(reader->ReadChild(vp_config.get()));
|
| + frame_bitstream_converter = nullptr;
|
| video_codec = kCodecVP9;
|
| - // TODO(kqyang): Read VPCodecConfiguration and extract profile
|
| - // (crbug.com/604863).
|
| + video_codec_profile = vp_config->profile;
|
| break;
|
| + }
|
| #endif
|
| default:
|
| // Unknown/unsupported format
|
|
|