diff --git a/packager/media/formats/webm/webm_constants.h b/packager/media/formats/webm/webm_constants.h index e5e5f35e89..d36f662172 100644 --- a/packager/media/formats/webm/webm_constants.h +++ b/packager/media/formats/webm/webm_constants.h @@ -159,6 +159,8 @@ const int kWebMIdPosition = 0xA7; const int kWebMIdPrevFilename = 0x3C83AB; const int kWebMIdPrevSize = 0xAB; const int kWebMIdPrevUID = 0x3CB923; +const int kWebMIdProjection = 0x7670; +const int kWebMIdProjectionType = 0x7671; const int kWebMIdReferenceBlock = 0xFB; const int kWebMIdReferencePriority = 0xFA; const int kWebMIdSamplingFrequency = 0xB5; diff --git a/packager/media/formats/webm/webm_parser.cc b/packager/media/formats/webm/webm_parser.cc index 62c66de39c..ffebf9f8e1 100644 --- a/packager/media/formats/webm/webm_parser.cc +++ b/packager/media/formats/webm/webm_parser.cc @@ -198,6 +198,7 @@ static const ElementIdInfo kVideoIds[] = { {BINARY, kWebMIdColorSpace}, {FLOAT, kWebMIdFrameRate}, {LIST, kWebMIdColor}, + {LIST, kWebMIdProjection}, }; static const ElementIdInfo kColorIds[] = { @@ -217,6 +218,10 @@ static const ElementIdInfo kColorIds[] = { {LIST, kWebMIdColorMasteringMetadata}, }; +static const ElementIdInfo kProjectionIds[] = { + {UINT, kWebMIdProjectionType}, +}; + static const ElementIdInfo kAudioIds[] = { {FLOAT, kWebMIdSamplingFrequency}, {FLOAT, kWebMIdOutputSamplingFrequency}, @@ -401,6 +406,7 @@ static const ListElementInfo kListElementInfo[] = { LIST_ELEMENT_INFO(kWebMIdTrackTranslate, 3, kTrackTranslateIds), LIST_ELEMENT_INFO(kWebMIdVideo, 3, kVideoIds), LIST_ELEMENT_INFO(kWebMIdColor, 4, kColorIds), + LIST_ELEMENT_INFO(kWebMIdProjection, 4, kProjectionIds), LIST_ELEMENT_INFO(kWebMIdAudio, 3, kAudioIds), LIST_ELEMENT_INFO(kWebMIdTrackOperation, 3, kTrackOperationIds), LIST_ELEMENT_INFO(kWebMIdTrackCombinePlanes, 4, kTrackCombinePlanesIds), diff --git a/packager/media/formats/webm/webm_video_client.cc b/packager/media/formats/webm/webm_video_client.cc index 4177477def..48486a5a55 100644 --- a/packager/media/formats/webm/webm_video_client.cc +++ b/packager/media/formats/webm/webm_video_client.cc @@ -161,11 +161,15 @@ VPCodecConfigurationRecord WebMVideoClient::GetVpCodecConfig( } WebMParserClient* WebMVideoClient::OnListStart(int id) { - return id == kWebMIdColor ? this : WebMParserClient::OnListStart(id); + return id == kWebMIdColor || id == kWebMIdProjection + ? this + : WebMParserClient::OnListStart(id); } bool WebMVideoClient::OnListEnd(int id) { - return id == kWebMIdColor ? true : WebMParserClient::OnListEnd(id); + return id == kWebMIdColor || id == kWebMIdProjection + ? true + : WebMParserClient::OnListEnd(id); } bool WebMVideoClient::OnUInt(int id, int64_t val) { @@ -233,6 +237,9 @@ bool WebMVideoClient::OnUInt(int id, int64_t val) { case kWebMIdColorMaxFALL: NOTIMPLEMENTED() << "HDR is not supported yet."; return true; + case kWebMIdProjectionType: + LOG(WARNING) << "Ignoring ProjectionType with value " << val; + return true; default: return true; }