Issue #1820 - Part 1 : Add an extraction function to parse the RFC-6381 VP9 codec string.

This commit is contained in:
Moonchild 2022-04-26 14:49:54 +00:00 committed by roytam1
commit 55504b39bf
2 changed files with 202 additions and 1 deletions

View file

@ -258,6 +258,34 @@ ExtractH264CodecDetails(const nsAString& aCodecs,
int16_t& aProfile,
int16_t& aLevel);
struct VideoColorSpace
{
// TODO: Define the value type as strong type enum
// to better know the exact meaning corresponding to ISO/IEC 23001-8:2016.
// Default value is listed https://www.webmproject.org/vp9/mp4/#optional-fields
uint8_t mPrimaryId = 1; // Table 2
uint8_t mTransferId = 1; // Table 3
uint8_t mMatrixId = 1; // Table 4
uint8_t mRangeId = 0;
};
// Extracts the VPX codecs parameter string.
// See https://www.webmproject.org/vp9/mp4/#codecs-parameter-string
// for more details.
// Returns false on failure.
bool
ExtractVPXCodecDetails(const nsAString& aCodec,
uint8_t& aProfile,
uint8_t& aLevel,
uint8_t& aBitDepth);
bool
ExtractVPXCodecDetails(const nsAString& aCodec,
uint8_t& aProfile,
uint8_t& aLevel,
uint8_t& aBitDepth,
uint8_t& aChromaSubsampling,
VideoColorSpace& aColorSpace);
// Use a cryptographic quality PRNG to generate raw random bytes
// and convert that to a base64 string.
nsresult