Bug 1382718 - Update video encoder gtest to use appropriate image objects. r?jesup
The image objects used in the TestVideoTrackEncoder.cpp for NV12 and NV21 were
not suitable for storage of these formats. As such the new format detection
code introduced in previous changesets was not correctly be exercised.
MozReview-Commit-ID: 9Tn7Ub4GfeG
--- a/dom/media/gtest/TestVideoTrackEncoder.cpp
+++ b/dom/media/gtest/TestVideoTrackEncoder.cpp
@@ -98,17 +98,17 @@ private:
data.mCbCrSize.height = halfHeight;
image->CopyData(data);
return image;
}
Image *CreateNV12Image()
{
- PlanarYCbCrImage *image = new RecyclingPlanarYCbCrImage(new BufferRecycleBin());
+ NVImage* image = new NVImage();
PlanarYCbCrData data;
data.mPicSize = mImageSize;
const uint32_t yPlaneSize = mImageSize.width * mImageSize.height;
const uint32_t halfWidth = (mImageSize.width + 1) / 2;
const uint32_t halfHeight = (mImageSize.height + 1) / 2;
// Y plane.
@@ -129,23 +129,23 @@ private:
data.mCbChannel = cb;
data.mCbSkip = 1;
// 4:2:0.
data.mCbCrStride = mImageSize.width;
data.mCbCrSize.width = halfWidth;
data.mCbCrSize.height = halfHeight;
- image->CopyData(data);
+ image->SetData(data);
return image;
}
Image *CreateNV21Image()
{
- PlanarYCbCrImage *image = new RecyclingPlanarYCbCrImage(new BufferRecycleBin());
+ NVImage* image = new NVImage();
PlanarYCbCrData data;
data.mPicSize = mImageSize;
const uint32_t yPlaneSize = mImageSize.width * mImageSize.height;
const uint32_t halfWidth = (mImageSize.width + 1) / 2;
const uint32_t halfHeight = (mImageSize.height + 1) / 2;
// Y plane.
@@ -166,17 +166,17 @@ private:
data.mCbChannel = cb;
data.mCbSkip = 1;
// 4:2:0.
data.mCbCrStride = mImageSize.width;
data.mCbCrSize.width = halfWidth;
data.mCbCrSize.height = halfHeight;
- image->CopyData(data);
+ image->SetData(data);
return image;
}
private:
mozilla::gfx::IntSize mImageSize;
nsTArray<uint8_t> mSourceBuffer;
};