зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1066410 - Serious color distortion happened when plays WebRTC. r=jesup
This commit is contained in:
Родитель
3f5f586cae
Коммит
32eb592ef2
|
@ -197,6 +197,7 @@ public:
|
|||
void StopImpl();
|
||||
void SnapshotImpl();
|
||||
void RotateImage(layers::Image* aImage, uint32_t aWidth, uint32_t aHeight);
|
||||
uint32_t ConvertPixexFormatToFOURCC(int aFormat);
|
||||
void Notify(const mozilla::hal::ScreenConfiguration& aConfiguration);
|
||||
|
||||
nsresult TakePhoto(PhotoCallback* aCallback) MOZ_OVERRIDE;
|
||||
|
|
|
@ -968,6 +968,22 @@ MediaEngineWebRTCVideoSource::OnTakePictureComplete(uint8_t* aData, uint32_t aLe
|
|||
}
|
||||
}
|
||||
|
||||
uint32_t
|
||||
MediaEngineWebRTCVideoSource::ConvertPixexFormatToFOURCC(int aFormat)
|
||||
{
|
||||
switch (aFormat) {
|
||||
case HAL_PIXEL_FORMAT_YCrCb_420_SP:
|
||||
return libyuv::FOURCC_NV21;
|
||||
case HAL_PIXEL_FORMAT_YV12:
|
||||
return libyuv::FOURCC_YV12;
|
||||
default: {
|
||||
LOG((" xxxxx Unknown pixel format %d", aFormat));
|
||||
MOZ_ASSERT(false, "Unknown pixel format.");
|
||||
return libyuv::FOURCC_ANY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MediaEngineWebRTCVideoSource::RotateImage(layers::Image* aImage, uint32_t aWidth, uint32_t aHeight) {
|
||||
layers::GrallocImage *nativeImage = static_cast<layers::GrallocImage*>(aImage);
|
||||
|
@ -1003,7 +1019,7 @@ MediaEngineWebRTCVideoSource::RotateImage(layers::Image* aImage, uint32_t aWidth
|
|||
aWidth, aHeight,
|
||||
aWidth, aHeight,
|
||||
static_cast<libyuv::RotationMode>(mRotation),
|
||||
libyuv::FOURCC_NV21);
|
||||
ConvertPixexFormatToFOURCC(graphicBuffer->getPixelFormat()));
|
||||
graphicBuffer->unlock();
|
||||
|
||||
const uint8_t lumaBpp = 8;
|
||||
|
|
Загрузка…
Ссылка в новой задаче