Skip to main content

Crate alpha2_native_gpu

Crate alpha2_native_gpu 

Source
Expand description

Platform GPU interop for native decoded video surfaces.

FFmpeg ownership remains in alpha2-ffmpeg-bridge; this crate owns raw GPU handles, barriers, synchronization, and bounded surface accounting.

Structs§

ExternalSyncPoint
Timeline synchronization point required before sampling an image.
ImportTicketStats
Allocation counters of a context’s import tickets.
ImportedPlaneDescriptor
One opaque native plane before it is wrapped by the active GPU backend.
ImportedVulkanFrame
An imported bi-planar 4:2:0 image and its two wgpu plane views.
NativeGpuIdentity
Stable identity of a native GPU device for cache and import validation.
NativeImageState
Native image state observed while the decoder surface is locked.
SharedVulkanContext
One Vulkan logical device adopted by both the renderer and FFmpeg.
SharedVulkanError
Failure while creating a logical Vulkan device shared by wgpu and FFmpeg.
SurfaceBudget
Bounded decoder-surface allocator shared by decode sessions.
SurfaceBudgetError
A reservation exceeded either the count or byte limit.
SurfaceIdentity
Identity used to prevent imported texture reuse across decoder generations.
SurfaceReservation
A reservation released exactly once when its final owner is dropped.
SurfaceUsage
Current native surface allocation.
VideoEncodeExtent
Coded extents and coding limits one video-encode profile has on a device.
VulkanEncodeCopier
Reusable NV12 handoff from the renderer’s plane textures to encoder frames.
VulkanImportLease
Owns the imported texture, FFmpeg frame, and native transition commands.
VulkanLayerVersion
A Vulkan layer’s specification version.

Enums§

NativePlaneLayout
Supported decoded plane organizations.

Traits§

NativeSurfaceLease
Native backing retained until every sampling submission has completed.

Functions§

probe_vulkan_submission
Checks that a decoded frame can be imported: moves its planes to SHADER_READ_ONLY and back in one submission on its queue, through views like an import’s, and waits for it.
set_gpu_wait_timeout
Sets how long the platform interop helpers wait on GPU work before they give up with a timeout, instead of blocking forever on a hung device.
shared_device_index
Where the device SharedVulkanContext::create opens is in the loader’s physical-device order, for selector as ALPHA2_VULKAN_DEVICE names it (None unset): the index FFmpeg takes for a Vulkan device of its own (av_hwdevice_ctx_create’s device). A probe that opens its own device passes this, so it opens the device an export renders, decodes, and encodes on. FFmpeg reads a name that starts with a digit as an index, so passing the variable on would pick another device, or none.