Skip to main content

Crate alpha2_engine

Crate alpha2_engine 

Source
Expand description

Player and exporter public API.

§wgpu interop

The default API names no wgpu type: hosts lend frames as alpha2_render::SourceViews through FrameProvider and get back alpha2_render::RenderedTextures and readbacks. Items taking wgpu textures (such as rendering into hardware encoder NV12 planes) are documented only with the wgpu-interop feature and follow wgpu’s major version.

Re-exports§

pub use frame::Following;
pub use frame::FollowingFrame;
pub use frame::FrameGraph;
pub use frame::FrameProvider;
pub use frame::FrameRender;
pub use frame::FrameRenderer;
pub use frame::FrameYuv420pRender;
pub use frame::GpuFrameRenderer;
pub use frame::RenderReport;
pub use frame::check_frame_effects;

Modules§

extract
The extractor contract. Code outside the engine is supplied frames or audio and returns primitives that a project records as data sets.
frame_store
A cache of prepared source frames, keyed by source and time, bounded by count and bytes: what a player or an exporter renders from (FrameProvider for entries that are StoredFrames).
loudness
Loudness reports and normalization plans as the JSON every surface reads (alpha2/loudness).

Structs§

AudioNeed
A source interval a host decodes before a render reads it.
AudioRenderStatus
Outcome of mixing one block.
AudioRenderer
Mixes a project’s audio tracks into one project-rate block.
AudioTap
A track’s or bus’s signal that a host reads beside the mix, sample for sample in line with it. On the wire { "node": { "track": id }, "tap": "post_fader" }, tap optional.
Baselines
A text’s first and last alphabetic baselines, as fractions of the canvas (or picture) height, y down.
CanvasRect
A rectangle as fractions of the canvas, y down.
CapabilityReport
What a runtime can do.
ClockStep
What the clock asks for at one moment.
ColorReport
How color is handled.
EngineProject
An immutable project snapshot and its reusable evaluation index.
EvaluatedLayer
One clip a frame places, as the compositor places it.
ExportAudioWindow
The project-rate samples an export’s audio covers.
ExportFrameNeeds
Decode requirements for one scheduled export frame.
ExportProgress
Completed and total frame counts for deterministic export.
ExportStepTimings
Where one Exporter::render_next_timed step spent its time.
Exporter
Deterministic, retryable frame-sequence runner.
Feature
One feature: whether it is available, and why not.
FollowingFrame
A frame and when it and the frame before it are presented.
FrameGraph
One evaluated frame compiled into a render graph, not yet submitted.
FrameRender
Result of attempting to render one evaluated timeline frame.
FrameYuv420pRender
Result of rendering and scheduling one frame for planar YUV420 readback.
FramesWithText
A host’s frame provider combined with its text store.
GpuMemoryReport
The device memory the adapter may use.
GpuReport
The GPU the renderer drives.
LayoutBounds
Where a layout’s nodes lie (measure_layout), in preorder.
NodeBounds
Where one layout node’s boxes lie, before its clip’s transform and node visuals.
NodeLevels
The level of one track, one bus or the master output over one block. Serializes with camel case keys.
PassthroughPlan
What an export range copies: its segments in timeline order, and its audio.
PassthroughSegment
One clip’s share of a copied range.
PictureSize
The size in pixels of a picture text and layouts are placed on. Never empty, and within the largest frame the engine draws (alpha2_media::MAX_FRAME_DIMENSION, alpha2_media::MAX_FRAME_PIXELS).
PlaybackClock
The clock for one playback run, asked each display refresh which time to show.
PlaybackFrame
Result of one real-time presentation attempt; I is FrameRenderer::Image.
PlaybackReport
How real-time playback behaves.
Player
Stateful real-time runner holding the last picture drawn. I is FrameRenderer::Image: a RenderedTexture on the GPU or an Arc<CpuImage> on the alpha2_render::CpuRenderer.
PreparedLayout
A layout resolved at one render size: its paint list and each text node’s texture key.
QualityProfile
Runtime quality controls shared by real-time playback and export.
RenderReport
Outcome of one render attempt when sources may arrive asynchronously.
TextBounds
Where a text lies, as fractions of the canvas from (0, 0) top-left to (1, 1) bottom-right. For a text generator this is on its picture, before the clip’s transform and effects; for a caption it is on the canvas.
TextPixels
The pixels of one prepared text.
TextTexture
One prepared text: its texture, pixel size and layout box position.
TextTextures
Fonts and the texts rasterized with them, keyed by content and render size.

Enums§

AudioContinuity
What AudioRenderer::render does with a block that does not start where the previous one ended.
EngineError
Failure produced by an engine runner.
ErrorCode
A failure’s protocol code.
ExportPlaneStep
One step of an export that packs its picture straight into caller-owned planes.
ExportStep
Outcome of one non-blocking exporter step.
ExportTextureStep
One step of an export that leaves its picture as a rendered texture.
Following
The frame after the one presented at a source time (FrameProvider::following_for).
MissingFramePolicy
The action a host should take after its renderer reports missing frames.
PassthroughAudio
What an export’s audio is over a copied range: copied too, or encoded from the mix.
PictureSizeError
Why a size is not a PictureSize.
PlaybackPolicy
Which frame real-time playback shows, and whether sound plays.
Runtime
Where the engine runs.
StalePresentations
Presentation frames a replacement project invalidates beyond stale_sources.
TapPoint
Where a tap reads a track or bus. On the wire pre_fader or post_fader.
TextError
Why text could not be prepared.

Constants§

CAPABILITY_SCHEMA
The report’s schema name.
CAPABILITY_VERSION
The report’s schema version.
LAYOUT_WRAP_SLACK
Pixels added to a text node’s wrapping width so float summation order cannot re-break a text sized to its own max-content width. Lines and heights may overflow the box by less than this.
MAX_AUDIO_BLOCK
Largest block a renderer will mix in one call.
MAX_AUDIO_TAPS
Most taps one renderer holds.
MAX_EXPORT_FRAMES
Largest frame schedule accepted by one export operation.
MAX_SETTLING_SECONDS
Longest a stage replays to settle before a seek target, in seconds.

Traits§

FrameProvider
Supplies decoded source frames as GPU textures to the renderer.
FrameRenderer
Timeline-frame rendering on the GPU Renderer or the alpha2_render::CpuRenderer. GPU-only readback and encoder paths are in GpuFrameRenderer.
GpuFrameRenderer
GPU frame paths that end on the GPU: an unmapped YUV420 readback or encoder NV12 planes.
TextUpload
Where TextTextures keeps rasterized pixels: a GPU texture or CPU memory.

Functions§

check_frame_effects
Checks that renderer draws every effect frame uses, naming the first missing one (unlike the RenderError that FrameRenderer returns).
color_policy
The renderer’s color policy: tone-map HDR sources from the project peak, or refuse them.
export_audio_window
The audio samples an export over range writes: each end is the nearest sample, halves rounding up.
export_effective_range
Exporter::effective_range of an export of range at frame_rate, for an export that draws no frame: the range its audio covers is the one it would cover with video.
gpu_error_of
The GPU error class of the first RenderError::Gpu in error’s source chain. Out of memory and validation have no protocol code; failure reports classify them with this.
gpu_fault_of
The device fault reported for the first failed GPU call in error’s source chain (renderer synchronization, decoder or encoder). Failure reports classify memory faults with this.
layout_key
A layout’s identity at a render size. Equal keys draw alike with the same fonts.
measure_layout
Where each node of a valid layout tree lies on a picture of size at picture time time, laid out with rasterizer’s fonts exactly as a frame is.
measure_text
Where text in style lies on a canvas of size, laid out with rasterizer’s fonts and placed exactly as a frame places it, without drawing it.
passthrough_plan
Whether range of project shows its sources untouched.
stale_presentations
The presentation frames next invalidates.
stale_sources
Sources whose uploaded audio and frames a replacement project invalidates.
text_key
A text’s identity at a render size: the text, its runs’ styles and sampled scales, its style and the size, hashed with FNV-1a. A text without run styles keys as its plain string. Never zero.

Type Aliases§

Corners
Four points on the canvas in pixels, [x, y] each: where the top left, top right, bottom left and bottom right of a rectangle land.