Chromium Code Reviews| 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..6fcd0e561d6d926fd5ea70ddc543d41026027e3b 100644 |
| --- a/media/formats/mp4/box_definitions.cc |
| +++ b/media/formats/mp4/box_definitions.cc |
| @@ -565,6 +565,41 @@ bool AVCDecoderConfigurationRecord::ParseInternal( |
| return true; |
| } |
| +VPCodecConfigurationRecord::VPCodecConfigurationRecord() |
| + : profile(VIDEO_CODEC_PROFILE_UNKNOWN) {} |
| + |
| +VPCodecConfigurationRecord::VPCodecConfigurationRecord( |
|
tinskip
2016/06/06 20:13:34
If using the default copy constructor, why bother
kqyang
2016/06/06 20:30:18
The box methods are declared using macro: https://
|
| + 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. |
| + |
| + RCHECK(profile_indication < 4); |
|
tinskip
2016/06/06 20:13:34
There are, and will only be 2 VP9 profiles: 0 and
kqyang
2016/06/06 20:30:18
There are actually four profiles: https://en.wikip
|
| + 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; |
| + } |
|
ddorwin
2016/06/14 18:58:22
maybe DVLOG(WARNING) all other cases.
kqyang
2016/06/14 21:02:32
Removed line 585 and add a default case here.
|
| + return true; |
| +} |
| + |
| PixelAspectRatioBox::PixelAspectRatioBox() : h_spacing(1), v_spacing(1) {} |
| PixelAspectRatioBox::PixelAspectRatioBox(const PixelAspectRatioBox& other) = |
| default; |
| @@ -646,12 +681,17 @@ bool VideoSampleEntry::Parse(BoxReader* reader) { |
| } |
| #endif |
| #if BUILDFLAG(ENABLE_MP4_VP9_DEMUXING) |
| - case FOURCC_VP09: |
| + case FOURCC_VP09: { |
| frame_bitstream_converter = NULL; |
| video_codec = kCodecVP9; |
| - // TODO(kqyang): Read VPCodecConfiguration and extract profile |
| - // (crbug.com/604863). |
| + |
| + DVLOG(2) << __FUNCTION__ << " parsing VPCodecConfigurationRecord (vpcC)"; |
|
ddorwin
2016/06/14 18:58:22
nit: Log at the top of the block for consistency.
kqyang
2016/06/14 21:02:32
Done.
|
| + std::unique_ptr<VPCodecConfigurationRecord> vp_config( |
| + new VPCodecConfigurationRecord()); |
| + RCHECK(reader->ReadChild(vp_config.get())); |
| + video_codec_profile = vp_config->profile; |
| break; |
| + } |
| #endif |
| default: |
| // Unknown/unsupported format |