Bug 1606288: Fall back to using shmem for video. r=jya

Fallback to using shmem to pass video frame if allocating GPU-backed memory fails.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Dan Glastonbury 2020-03-03 02:41:19 +00:00
Родитель d5b34cc887
Коммит 5c59d7b978
1 изменённых файлов: 15 добавлений и 7 удалений

Просмотреть файл

@ -342,17 +342,25 @@ MediaResult RemoteVideoDecoderParent::ProcessDecodedData(
mKnowsCompositor);
}
if (texture && !texture->IsAddedToCompositableClient()) {
texture->InitIPDLActor(mKnowsCompositor);
texture->SetAddedToCompositableClient();
}
if (texture) {
if (!texture->IsAddedToCompositableClient()) {
texture->InitIPDLActor(mKnowsCompositor);
texture->SetAddedToCompositableClient();
}
sd = mParent->StoreImage(video->mImage, texture);
size = texture->GetSize();
}
} else {
PlanarYCbCrImage* image =
static_cast<PlanarYCbCrImage*>(video->mImage.get());
}
// If failed to create a GPU accelerated surface descriptor, fall back to
// copying frames via shmem.
if (!IsSurfaceDescriptorValid(sd)) {
PlanarYCbCrImage* image = video->mImage->AsPlanarYCbCrImage();
if (!image) {
return MediaResult(NS_ERROR_UNEXPECTED,
"Expected Planar YCbCr image in "
"RemoteVideoDecoderParent::ProcessDecodedData");
}
SurfaceDescriptorBuffer sdBuffer;
ShmemBuffer buffer = AllocateBuffer(image->GetDataSize());