Bug 1543359 - P4. Add YUV Full Range info to AppleVTDecoder. r=bryce

Differential Revision: https://phabricator.services.mozilla.com/D27212

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jean-Yves Avenard 2019-07-26 06:13:18 +00:00
parent aec72edb84
commit 216eed81e9
2 changed files with 7 additions and 1 deletions

View File

@ -36,6 +36,7 @@ AppleVTDecoder::AppleVTDecoder(const VideoInfo& aConfig, TaskQueue* aTaskQueue,
mDisplayWidth(aConfig.mDisplay.width),
mDisplayHeight(aConfig.mDisplay.height),
mColorSpace(aConfig.mColorSpace),
mColorRange(aConfig.mColorRange),
mTaskQueue(aTaskQueue),
mMaxRefFrames(aOptions.contains(CreateDecoderParams::Option::LowLatency)
? 0
@ -375,6 +376,7 @@ void AppleVTDecoder::OutputFrame(CVPixelBufferRef aImage,
buffer.mPlanes[2].mSkip = 0;
buffer.mYUVColorSpace = mColorSpace;
buffer.mColorRange = mColorRange;
gfx::IntRect visible = gfx::IntRect(0, 0, mPictureWidth, mPictureHeight);
@ -546,7 +548,10 @@ CFDictionaryRef AppleVTDecoder::CreateOutputConfiguration() {
#ifndef MOZ_WIDGET_UIKIT
// Output format type:
SInt32 PixelFormatTypeValue = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
SInt32 PixelFormatTypeValue =
mColorRange == gfx::ColorRange::FULL
? kCVPixelFormatType_420YpCbCr8BiPlanarFullRange
: kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange;
AutoCFRelease<CFNumberRef> PixelFormatTypeNumber = CFNumberCreate(
kCFAllocatorDefault, kCFNumberSInt32Type, &PixelFormatTypeValue);
// Construct IOSurface Properties

View File

@ -89,6 +89,7 @@ class AppleVTDecoder : public MediaDataDecoder,
const uint32_t mDisplayWidth;
const uint32_t mDisplayHeight;
const gfx::YUVColorSpace mColorSpace;
const gfx::ColorRange mColorRange;
// Method to set up the decompression session.
MediaResult InitializeSession();