From 14f0f80cd121bc67ac181a9bff7a1db977546a9e Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 27 Apr 2022 11:13:34 +0000 Subject: [PATCH] Issue #1820 - Part 6: Extract bit depth information from codec parameter string into VideoInfo::mBitDepth. --- dom/media/fmp4/MP4Decoder.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dom/media/fmp4/MP4Decoder.cpp b/dom/media/fmp4/MP4Decoder.cpp index fd40aea86b..0bdbccd59e 100644 --- a/dom/media/fmp4/MP4Decoder.cpp +++ b/dom/media/fmp4/MP4Decoder.cpp @@ -143,9 +143,16 @@ MP4Decoder::CanHandleMediaType(const MediaContentType& aType, continue; } if (IsVP9CodecString(codec)) { - trackInfos.AppendElement( - CreateTrackInfoWithMIMETypeAndContainerTypeExtraParameters( - NS_LITERAL_CSTRING("video/vp9"), aType)); + auto trackInfo = + CreateTrackInfoWithMIMETypeAndContentTypeExtraParameters( + NS_LITERAL_CSTRING("video/vp9"), aType); + uint8_t profile = 0; + uint8_t level = 0; + uint8_t bitDepth = 0; + if (ExtractVPXCodecDetails(codec, profile, level, bitDepth)) { + trackInfo->GetAsVideoInfo()->mBitDepth = bitDepth; + } + trackInfos.AppendElement(Move(trackInfo)); continue; } #ifdef MOZ_AV1