Skip to main content

Crate alpha2_media

Crate alpha2_media 

Source
Expand description

Host-independent media vocabulary and I/O contracts.

These types describe media itself, not any application built on it: source identity and color, decoded frames and audio blocks, the decoder and encoder traits that platform bindings implement, and output rate control. The renderer, the timeline model, and the platform bindings all speak them, and none of those owns them.

Structs§

AudioBlock
Planar floating-point audio at the project sample rate.
AudioSpan
A provider’s answer to one request: source samples, and what the source holds on either side of them.
CancelToken
Cancellation flag shared across adapter operations.
ColorMetadata
Host-independent video color description.
DecodeRequest
One idempotent decoder request. Hosts discard results with an old generation.
DecodeResult
Result correlated to a decoder request, safe for out-of-order completion.
DecodedVideoFrame
Host-independent decoded video frame.
HostTexture
Generic image/video/text texture descriptor owned by a host.
HostTexturePixels
RGBA8 pixels returned by an image, video, or text rasterization host.
Orientation
How to show a decoded picture upright: mirror it left to right when mirror is set, then turn it clockwise by rotation.
Plane
One decoded image plane.
Rect
Rectangle inside a coded video frame.
SampleAspectRatio
Reduced pixel-width to pixel-height ratio.
SourceId
A stable media-source identifier.
SpeakerLayout
The speakers an AudioBlock’s planes feed, in plane order: 1 to MAX_AUDIO_CHANNELS of them.
StreamInfo
Platform-neutral probe result for one stream.
TextTexture
Layout facts attached to a host-rasterized text texture.
VideoRateControl
A resolved video rate control: what a sink encodes with.
YcbcrLevels
Where a YCbCr range puts a bit depth’s codes (ITU-T H.273).
YuvEncoding
How rendered RGB is written as 8-bit 4:2:0 YUV: its color coding, and where its chroma samples sit relative to the luma grid.
YuvFormat
How a planar or semi-planar YCbCr frame stores its samples.

Enums§

AudioCodec
Audio codecs the engine resolves a rate for.
BitrateMode
How an encoder is asked to hold its bitrate.
ChromaLocation
Chroma sample location for subsampled YUV.
ColorMatrix
Coefficients used to decode source components.
ColorPrimaries
RGB primary chromaticities a source or export declares.
ColorRange
Nominal encoded component range.
Container
The file format an export is written in.
ContainerError
Why a container request cannot be resolved.
DecodeError
Typed decoder failure.
DecodeEvent
Decoder output and terminal states.
DecodeRequestKind
Kind of decoder cache/refill operation.
DynamicRange
Whether a signal is standard or high dynamic range. It follows the transfer: hdr exactly when the transfer is PQ or HLG, and a color whose two fields disagree is refused.
EmojiPolicy
How a text host draws emoji and other color glyphs.
EncodeError
Typed encoding failure.
EncodeEvent
One input accepted by an encoding/mux adapter.
GpuFault
What a failed GPU call says about the device it ran on, read from the platform’s own status for that call (a VkResult, HRESULT, or CVReturn) where it failed, not from any message.
IdError
An error returned when an identifier cannot be constructed.
PixelFormat
Plane organization delivered by a decoder.
Premultiplication
Alpha representation of host pixels.
QualityLevel
The five qualitative output levels.
RasterColorSpace
Generic color declaration for a host-rasterized texture.
RateControlError
Why a rate-control request is not one the engine can resolve.
Rotation
Clockwise rotation to apply when displaying a frame.
Speaker
The loudspeaker one plane of an AudioBlock feeds.
StreamKind
Media stream domain.
TextAlign
Horizontal alignment applied by a host text layout engine.
TransferFunction
Encoded transfer curve.
VideoCodec
Video codecs the engine resolves a rate for.

Constants§

FRAME_RATE_EXPONENT
How bitrate grows with frame rate at equal quality: (fps / 30) ^ k.
GPU_TIMEOUT_MESSAGE
The sentence every wait on GPU work that timed out carries, wherever it was waited on (the renderer, a native interop helper, an encoder input), so a host that sees only error text tells a hung GPU from a generic failure. Hosts classify it as GPU_TIMEOUT.
MAX_AUDIO_CHANNELS
Most planes an AudioBlock carries: a 22.2 layout’s 24, the most of any layout FFmpeg names.
MAX_FRAME_DIMENSION
Largest frame edge, in pixels, anything in alpha2 decodes, renders, or composes a project at.
MAX_FRAME_PIXELS
Largest frame area, in pixels, anything in alpha2 decodes, renders, or composes a project at: a decoder refuses a larger frame before it allocates one.
MIN_VIDEO_BITRATE
No level resolves below this. Below about 300 kbps the measured encoders stopped holding their target at all (asked for 84 kbps they wrote 170 to 260), so a lower number would describe a file the encoder does not make.
REFERENCE_FPS
Frame rate the level table is stated at.
REFERENCE_PIXELS
Luma samples of the reference output the level table is stated at.
RESOLUTION_EXPONENT
How bitrate grows with pixel count at equal quality.

Traits§

AudioBlockProvider
Retrieves project-rate planar audio without exposing its backing cache.
AudioBlockSink
Receives project-rate planar audio from offline or realtime graph hosts.
Decoder
Stateful media decoder implemented by a platform binding.
EncodeSink
Host encoding and muxing boundary.

Functions§

codec_factor
Bits a codec needs, relative to H.264, for the same quality.
frame_size_supported
Whether a width x height frame is within MAX_FRAME_DIMENSION and MAX_FRAME_PIXELS.
level_quantizer
The constant quantizer a level resolves to for codec, where the engine has measured one.
resolve_audio_bitrate
Resolves a quality level into a stereo audio bitrate in bits per second.
resolve_export_format
The export’s container and codecs, resolved once at a host’s edge.
resolve_video_rate_control
Resolves a quality level into the rate control every sink encodes with.
sample_ticks_floor
The tick at or before sample sample at sample_rate.