You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug 1979100 - Add infrastructure for importing video frames into wgpu textures. r=webgpu-reviewers,webidl,teoxoy,smaug
In order to support webgpu's GPUExternalTexture we must first be able
to import video frames into wgpu. To do so we introduce the concept of
an external texture "source". This consists of between 1 and 3
textures and texture views, in order to support single-plane RGBA or
multiplanar YCbCr data. The source is implemented as a distinct
concept from the external texture itself so that multiple external
textures can be created from the same source.
An external texture source has both a client-side and host-side
representation. The client side is responsible for managing the
lifecycle of the host side. It obtains a SurfaceDescriptor from the
current layers::Image of the video element or frame it was imported
from, and sends this to the host side. The host side is responsible
for creating the wgpu Textures and TextureViews it needs from the
SurfaceDescriptor. It also holds various pieces of information derived
from the imported frames that will be required to construct the
wgpu::ExternalTextureDescriptor required to create a
wgpu::ExternalTexture.
For now, we always call Image::BuildSurfaceDescriptorBuffer to obtain
the surface descriptor, and therefore only have to handle
SurfaceDescriptorBuffers. In subsequent patches we will handle
GPUVideo surface descriptors to directly import hardware decoded video
frames without requiring a readback.
Differential Revision: https://phabricator.services.mozilla.com/D259819
0 commit comments