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

Unified Diff: media/formats/mp4/box_definitions.cc

Issue 1933793003: Parse VPCodecConfiguration and extract VP9 profile (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: vpcC should inherit from FullBox instead of Box Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/formats/mp4/box_definitions.h ('k') | media/formats/mp4/fourccs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « media/formats/mp4/box_definitions.h ('k') | media/formats/mp4/fourccs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698