Issue #2357 - WebM demuxer can't tell when a video wants to be transparent.

Required to have an alpha channel (which in the strange world of graphics seems to refer to transparency, and not experimental code) in WebM videos. Straight port of Firefox 53 implementation, adapted slightly for a couple of patches previously taken without this.

Ref: BZ 1320829
This commit is contained in:
Jeremy Andrews 2023-10-23 19:58:33 -05:00 committed by roytam1
commit 71cc0ef940
5 changed files with 66 additions and 6 deletions

View file

@ -340,6 +340,15 @@ MediaRawData::MediaRawData(const uint8_t* aData, size_t aSize)
{
}
MediaRawData::MediaRawData(const uint8_t* aData, size_t aSize,
const uint8_t* aAlphaData, size_t aAlphaSize)
: MediaData(RAW_DATA, 0)
, mCrypto(mCryptoInternal)
, mBuffer(aData, aSize)
, mAlphaBuffer(aAlphaData, aAlphaSize)
{
}
already_AddRefed<MediaRawData>
MediaRawData::Clone() const
{
@ -356,6 +365,9 @@ MediaRawData::Clone() const
if (!s->mBuffer.Append(mBuffer.Data(), mBuffer.Length())) {
return nullptr;
}
if (!s->mAlphaBuffer.Append(mAlphaBuffer.Data(), mAlphaBuffer.Length())) {
return nullptr;
}
return s.forget();
}