Gondwana Game Engine Development (master) - 2.7.0
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
Gondwana.Video.VideoFramePresenter Class Referencesealed

Reusable latest-frame presentation for engine drawings and desktop previews. More...

Inheritance diagram for Gondwana.Video.VideoFramePresenter:

Public Member Functions

 VideoFramePresenter (int maximumFramePixels=int.MaxValue/4)
 Creates a bounded frame presenter.
void Publish (VideoFrameReadyEventArgs frame)
 Copies a borrowed frame before its decoder callback returns.
void Reset ()
 Clears queued frames when the source changes; Update clears the displayed frame.
bool Update ()
 Consumes the latest frame on the presentation thread.
void Draw (SKCanvas canvas, RectangleF bounds, StretchMode stretch=StretchMode.Uniform)
 Draws the retained frame, fitting and clipping it to the requested bounds.
void Dispose ()
 Closes the callback mailbox and releases presentation-owned pixels.

Detailed Description

Reusable latest-frame presentation for engine drawings and desktop previews.

Publish/Reset may run on decoder threads. Update, Draw and Dispose belong to one presentation thread. Owns frame buffers, but never owns or controls a player. Dispose before joining decoder callbacks.

Definition at line 10 of file VideoFramePresenter.cs.

Constructor & Destructor Documentation

◆ VideoFramePresenter()

Gondwana.Video.VideoFramePresenter.VideoFramePresenter ( int maximumFramePixels = int::MaxValue / 4)

Creates a bounded frame presenter.

Parameters
maximumFramePixelsMaximum source pixels retained in each frame buffer.

Definition at line 18 of file VideoFramePresenter.cs.

Member Function Documentation

◆ Dispose()

void Gondwana.Video.VideoFramePresenter.Dispose ( )

Closes the callback mailbox and releases presentation-owned pixels.

Definition at line 66 of file VideoFramePresenter.cs.

◆ Draw()

void Gondwana.Video.VideoFramePresenter.Draw ( SKCanvas canvas,
RectangleF bounds,
StretchMode stretch = StretchMode::Uniform )

Draws the retained frame, fitting and clipping it to the requested bounds.

Parameters
canvasThe presentation canvas.
boundsDestination bounds in canvas coordinates.
stretchThe scaling mode.

Definition at line 45 of file VideoFramePresenter.cs.

◆ Publish()

void Gondwana.Video.VideoFramePresenter.Publish ( VideoFrameReadyEventArgs frame)

Copies a borrowed frame before its decoder callback returns.

Parameters
frameThe callback-scoped BGRX frame.

Definition at line 26 of file VideoFramePresenter.cs.

◆ Reset()

void Gondwana.Video.VideoFramePresenter.Reset ( )

Clears queued frames when the source changes; Update clears the displayed frame.

◆ Update()

bool Gondwana.Video.VideoFramePresenter.Update ( )

Consumes the latest frame on the presentation thread.

Returns
Whether the displayed frame changed and needs repainting.