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

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: Created 4 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 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..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
« 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