зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1577336: Part 4 - Refactor some things in RemoteDecoderManager r=mattwoodrow,jolin
In anticipation of the rest of this patch series, we make 2 changes to the RemoteDecoderManager: 1. Rename RemoteDecoderManagerChild::DeallocateSurfaceDescriptorGPUVideo to DeallocateSurfaceDescriptor 2. Move call to RemoteDecoderManager::GetSource() from GPUVideoTextureClient to RemoteVideoDecoder. Differential Revision: https://phabricator.services.mozilla.com/D52396 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
446170c593
Коммит
78fbd97e70
|
@ -294,13 +294,13 @@ already_AddRefed<SourceSurface> RemoteDecoderManagerChild::Readback(
|
|||
return source.forget();
|
||||
}
|
||||
|
||||
void RemoteDecoderManagerChild::DeallocateSurfaceDescriptorGPUVideo(
|
||||
void RemoteDecoderManagerChild::DeallocateSurfaceDescriptor(
|
||||
const SurfaceDescriptorGPUVideo& aSD) {
|
||||
RefPtr<RemoteDecoderManagerChild> ref = this;
|
||||
SurfaceDescriptorGPUVideo sd = std::move(aSD);
|
||||
sRemoteDecoderManagerChildThread->Dispatch(
|
||||
NS_NewRunnableFunction(
|
||||
"RemoteDecoderManagerChild::DeallocateSurfaceDescriptorGPUVideo",
|
||||
"RemoteDecoderManagerChild::DeallocateSurfaceDescriptor",
|
||||
[ref, sd]() {
|
||||
if (ref->CanSend()) {
|
||||
ref->SendDeallocateSurfaceDescriptorGPUVideo(sd);
|
||||
|
|
|
@ -29,7 +29,7 @@ class RemoteDecoderManagerChild final : public PRemoteDecoderManagerChild,
|
|||
// internally and will be ignored if the IPDL actor has been destroyed.
|
||||
already_AddRefed<gfx::SourceSurface> Readback(
|
||||
const SurfaceDescriptorGPUVideo& aSD);
|
||||
void DeallocateSurfaceDescriptorGPUVideo(
|
||||
void DeallocateSurfaceDescriptor(
|
||||
const SurfaceDescriptorGPUVideo& aSD);
|
||||
|
||||
bool AllocShmem(size_t aSize,
|
||||
|
|
|
@ -155,6 +155,7 @@ MediaResult RemoteVideoDecoderChild::ProcessOutput(
|
|||
// The Image here creates a TextureData object that takes ownership
|
||||
// of the SurfaceDescriptor, and is responsible for making sure that
|
||||
// it gets deallocated.
|
||||
data.sd().get_SurfaceDescriptorGPUVideo().source() = Some(GetManager()->GetSource());
|
||||
image = new GPUVideoImage(GetManager(), data.sd(), data.frameSize());
|
||||
}
|
||||
|
||||
|
|
|
@ -17,11 +17,10 @@ GPUVideoTextureData::GPUVideoTextureData(RemoteDecoderManagerChild* aManager,
|
|||
const SurfaceDescriptorGPUVideo& aSD,
|
||||
const gfx::IntSize& aSize)
|
||||
: mManager(aManager),
|
||||
mSD(aSD), mSize(aSize) {
|
||||
mSD.source() = Some(mManager->GetSource());
|
||||
}
|
||||
mSD(aSD), mSize(aSize)
|
||||
{}
|
||||
|
||||
GPUVideoTextureData::~GPUVideoTextureData() {}
|
||||
GPUVideoTextureData::~GPUVideoTextureData() {}
|
||||
|
||||
bool GPUVideoTextureData::Serialize(SurfaceDescriptor& aOutDescriptor) {
|
||||
aOutDescriptor = mSD;
|
||||
|
@ -45,7 +44,7 @@ already_AddRefed<SourceSurface> GPUVideoTextureData::GetAsSourceSurface() {
|
|||
}
|
||||
|
||||
void GPUVideoTextureData::Deallocate(LayersIPCChannel* aAllocator) {
|
||||
mManager->DeallocateSurfaceDescriptorGPUVideo(mSD);
|
||||
mManager->DeallocateSurfaceDescriptor(mSD);
|
||||
mSD = SurfaceDescriptorGPUVideo();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче