Skip to main content

Crate xgpui_media

Crate xgpui_media 

Source
Expand description

Opt-in source-sized SDR images. Existing GPUI images keep their atlas path.

Modules§

pipeline
Linear SDR image adjustments and pipeline contracts for issue #26.

Structs§

FilteredImage
Filtered placement shares the source’s upload cache and lifetime.
FrameUploadLimits
Hard limits for newly adopted sources in one scene frame, shared by images using the same loader. A source must fit in one frame; chunking is not implicit.
ImageFilter
Ordered affine RGB adjustments in encoded sRGB, preserving source alpha. Calls compose in order. Factors clamp to 0..8; nonfinite factors use identity. An overflowing composition is ignored. Values clamp to the SDR target range after the combined transform, not per step.
ImageJob
Poll from a GPUI task or host view; no blocking join is performed on drop. Dropping/cancelling a job suppresses publication. Codec decoding is bounded but is not forcibly interrupted; the worker releases its slot on return.
MediaImage
Immutable decoded image with bounded background GPU staging. Clones share CPU data, a source-payload reservation and one backend/queue cache.
MediaImageView
Styled image viewport with native background, opacity, and corner coverage.
MediaLimits
Conservative admission limits shared by all clones of a loader. Payload budgets cover retained mip bytes and custom metadata, not decoder scratch or driver allocations.
MediaLoader
Bounded native background image loading. Admission returns an error instead of creating an unbounded task queue. Keep one shared loader per application.
UploadLimits
Shared upload admission. Metal/wgpu leases include in-flight staging until GPU completion; D3D11 currently releases at observed submission. Idle pool resources have a separate equal capacity. These are not total VRAM bounds.
UploadStats
VideoFrame
Immutable producer content. Native producers must return a source-sized backend output and keep external allocations stable through their lifetime.
VideoSender
One producer endpoint. Dropping it closes the stream; the last presented frame remains visible. Publish replaces at most one pending snapshot.
VideoStats
VideoStream
Shared presentation state. Clones display the same snapshot and share pause. There is one pending frame plus one displayed frame; GPU in-flight lifetimes are separate and managed by the backend. No unbounded frame FIFO is built.
VideoView

Enums§

LoadStatus
UploadStatus
CPU preparation, host submission and GPU completion are distinct stages.

Functions§

image_view
A styled image viewport. Construct once-loaded images with MediaLoader and retain the image in the host view. Uses a direct source texture, not the atlas. The image stretches to this element’s bounds; set an appropriate aspect ratio.
mipmapped_rgba8
Build a complete alpha-aware, linear-light RGBA8 mip chain synchronously. Intended for already-decoded small fixtures and hosts with their own task scheduling. Large images should use native MediaLoader workers; this call does not move CPU work off the calling thread or reserve loader budgets.
video
A styled latest-frame viewport. Explicit bounds stretch the frame; provide source-aspect dimensions. Live visible elements poll at host animation cadence. Paused/closed, fully clipped, empty and zero-opacity elements request no frames.
video_frame
Paint one immutable snapshot without requesting live presentation frames. Hosts can capture one stream snapshot and reuse it across several placements.