mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 08:13:35 +00:00
Bug 785339 - Restore BasicPlanarYCbCrImage::SetDelayedConversion. r=roc
This commit is contained in:
parent
ac89c3d827
commit
da002e7c2d
@ -233,6 +233,7 @@ VideoData* VideoData::Create(nsVideoInfo& aInfo,
|
||||
data.mPicSize = gfxIntSize(aPicture.width, aPicture.height);
|
||||
data.mStereoMode = aInfo.mStereoMode;
|
||||
|
||||
videoImage->SetDelayedConversion(true);
|
||||
videoImage->SetData(data);
|
||||
return v.forget();
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ public:
|
||||
BasicPlanarYCbCrImage(const gfxIntSize& aScaleHint, gfxImageFormat aOffscreenFormat, BufferRecycleBin *aRecycleBin)
|
||||
: PlanarYCbCrImage(aRecycleBin)
|
||||
, mScaleHint(aScaleHint)
|
||||
, mDelayedConversion(false)
|
||||
{
|
||||
SetOffscreenFormat(aOffscreenFormat);
|
||||
}
|
||||
@ -44,12 +45,15 @@ public:
|
||||
}
|
||||
|
||||
virtual void SetData(const Data& aData);
|
||||
virtual void SetDelayedConversion(bool aDelayed) { mDelayedConversion = aDelayed; }
|
||||
|
||||
already_AddRefed<gfxASurface> GetAsSurface();
|
||||
|
||||
private:
|
||||
nsAutoArrayPtr<uint8_t> mDecodedBuffer;
|
||||
gfxIntSize mScaleHint;
|
||||
int mStride;
|
||||
nsAutoArrayPtr<uint8_t> mDecodedBuffer;
|
||||
bool mDelayedConversion;
|
||||
};
|
||||
|
||||
class BasicImageFactory : public ImageFactory
|
||||
@ -81,6 +85,10 @@ BasicPlanarYCbCrImage::SetData(const Data& aData)
|
||||
{
|
||||
PlanarYCbCrImage::SetData(aData);
|
||||
|
||||
if (mDelayedConversion) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do some sanity checks to prevent integer overflow
|
||||
if (aData.mYSize.width > PlanarYCbCrImage::MAX_DIMENSION ||
|
||||
aData.mYSize.height > PlanarYCbCrImage::MAX_DIMENSION) {
|
||||
|
Loading…
Reference in New Issue
Block a user