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

@ -215,6 +215,7 @@ public:
, mRotation(aOther.mRotation)
, mBitDepth(aOther.mBitDepth)
, mImageRect(aOther.mImageRect)
, mAlphaPresent(aOther.mAlphaPresent)
{
}
@ -238,6 +239,16 @@ public:
return MakeUnique<VideoInfo>(*this);
}
void SetAlpha(bool aAlphaPresent)
{
mAlphaPresent = aAlphaPresent;
}
bool HasAlpha() const
{
return mAlphaPresent;
}
nsIntRect ImageRect() const
{
if (mImageRect.width < 0 || mImageRect.height < 0) {
@ -312,6 +323,9 @@ private:
// mImage may be cropped; currently only used with the WebM container.
// A negative width or height indicate that no cropping is to occur.
nsIntRect mImageRect;
// Indicates whether or not frames may contain alpha information.
bool mAlphaPresent = false;
};
class AudioInfo : public TrackInfo {