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.VlcVideoPlayer Class Referencesealed

Desktop/native LibVLC 3 player. Controls are serialized; event handlers must not block on the engine thread. FrameReady runs on a decoder thread and is copy-only. More...

Inheritance diagram for Gondwana.Video.VlcVideoPlayer:
Gondwana.Video.IVideoPlayer

Public Member Functions

 VlcVideoPlayer (string[]? vlcArgs=null, int initialWidth=1280, int initialHeight=720)
 Creates a native desktop player. Native libraries are supplied by the application.
void Open (Uri source)
 Opens a video from the specified source URI.
Parameters
sourceThe URI of the video source to open.

void Open (Stream source, bool leaveOpen=false)
 Opens a readable stream. Ownership transfers on success unless leaveOpen is true. Keep a borrowed stream alive and unused until the next Open or Dispose. Seek/loop require a seekable stream. Backends without stream support throw without taking ownership.
Parameters
sourceThe source.
leaveOpenWhether to leave the supplied stream open after use.

void Play ()
 Starts or resumes playback of the video.
void Pause ()
 Pauses the video playback.
void Stop ()
 Stops the video playback and resets the position.
void Seek (TimeSpan position)
 Seeks to the specified position in the video.
Parameters
positionThe position to seek to in the video timeline.

void SetRate (double rate)
 Sets the playback rate of the video.
Parameters
rateThe playback rate multiplier (e.g., 1.0 for normal speed, 2.0 for double speed).

void Dispose ()

Properties

int MaximumFramePixels = int.MaxValue / 4 [get]
 Maximum pixels (and aligned RGBA-equivalent storage) per decoded frame. Set before playback.
bool CanControlAudio [get]
 Whether this backend exposes independent volume and mute controls.
bool CanSeek [get]
 Whether the current media supports seeking. Legacy backends retain their existing seek behavior.
float Volume [get, set]
 Audible output gain from zero to one. Legacy backends may not support setting it.
bool IsMuted [get, set]
 Mutes output without changing the retained volume.
bool Loop [get, set]
 Gets or sets a value indicating whether the video should loop when it reaches the end.
bool IsPlaying [get]
 Gets a value indicating whether the video is currently playing.
VideoMetadata Metadata [get]
 Gets an atomic snapshot of metadata availability and values for the current source.
bool IsMetadataReady [get]
 True only when metadata for the current source is available.
bool HasAudio [get]
 Gets whether the video has an audio track. Consult IsMetadataReady before interpreting false.
TimeSpan Duration [get]
 Gets the total duration of the video.
TimeSpan Position [get]
 Gets the current playback position in the video.
int int height NaturalSize [get]
Exception? LastError [get]
 The most recent native callback or playback failure, if any.

Events

EventHandler? Started
EventHandler? Paused
EventHandler? Stopped
EventHandler? Ended
EventHandler< VideoStateChangedEventArgs >? StateChanged
EventHandler< VideoFrameReadyEventArgs >? FrameReady
Events inherited from Gondwana.Video.IVideoPlayer
EventHandler Started
 Occurs when the video playback starts.
EventHandler Paused
 Occurs when the video playback is paused.
EventHandler Stopped
 Occurs when the video playback is stopped.
EventHandler Ended
 Occurs when the video playback reaches the end.
EventHandler< VideoStateChangedEventArgs > StateChanged
 Occurs when the video state changes, including MediaOpening, MediaOpened, MetadataReady, and MetadataFailed. MediaOpening must precede frames for a replacement source, after callbacks for the prior source have stopped. Events may run on background threads.
EventHandler< VideoFrameReadyEventArgs > FrameReady
 Occurs when a decoded BGRX frame is ready. The pointer is valid only during the callback. Copy it before returning. Do not call engine/render operations or player controls here.

Additional Inherited Members

Public Attributes inherited from Gondwana.Video.IVideoPlayer
int width
 Gets the natural size (width and height) of the video in pixels.

Detailed Description

Desktop/native LibVLC 3 player. Controls are serialized; event handlers must not block on the engine thread. FrameReady runs on a decoder thread and is copy-only.

Definition at line 8 of file VlcVideoPlayer.cs.

Constructor & Destructor Documentation

◆ VlcVideoPlayer()

Gondwana.Video.VlcVideoPlayer.VlcVideoPlayer ( string?[] vlcArgs = null,
int initialWidth = 1280,
int initialHeight = 720 )

Creates a native desktop player. Native libraries are supplied by the application.

Parameters
vlcArgsOptional LibVLC arguments.
initialWidthLegacy compatibility argument, validated but not used to force a decode size.
initialHeightLegacy compatibility argument; actual dimensions come from format negotiation.

Definition at line 168 of file VlcVideoPlayer.cs.

Member Function Documentation

◆ Dispose()

void Gondwana.Video.VlcVideoPlayer.Dispose ( )

Definition at line 622 of file VlcVideoPlayer.cs.

◆ Open() [1/2]

void Gondwana.Video.VlcVideoPlayer.Open ( Stream source,
bool leaveOpen = false )

Opens a readable stream. Ownership transfers on success unless leaveOpen is true. Keep a borrowed stream alive and unused until the next Open or Dispose. Seek/loop require a seekable stream. Backends without stream support throw without taking ownership.

Parameters
sourceThe source.
leaveOpenWhether to leave the supplied stream open after use.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 247 of file VlcVideoPlayer.cs.

◆ Open() [2/2]

void Gondwana.Video.VlcVideoPlayer.Open ( Uri source)

Opens a video from the specified source URI.

Parameters
sourceThe URI of the video source to open.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 219 of file VlcVideoPlayer.cs.

◆ Pause()

void Gondwana.Video.VlcVideoPlayer.Pause ( )

Pauses the video playback.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 533 of file VlcVideoPlayer.cs.

◆ Play()

void Gondwana.Video.VlcVideoPlayer.Play ( )

Starts or resumes playback of the video.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 521 of file VlcVideoPlayer.cs.

◆ Seek()

void Gondwana.Video.VlcVideoPlayer.Seek ( TimeSpan position)

Seeks to the specified position in the video.

Parameters
positionThe position to seek to in the video timeline.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 557 of file VlcVideoPlayer.cs.

◆ SetRate()

void Gondwana.Video.VlcVideoPlayer.SetRate ( double rate)

Sets the playback rate of the video.

Parameters
rateThe playback rate multiplier (e.g., 1.0 for normal speed, 2.0 for double speed).

Implements Gondwana.Video.IVideoPlayer.

Definition at line 567 of file VlcVideoPlayer.cs.

◆ Stop()

void Gondwana.Video.VlcVideoPlayer.Stop ( )

Stops the video playback and resets the position.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 545 of file VlcVideoPlayer.cs.

Property Documentation

◆ CanControlAudio

bool Gondwana.Video.VlcVideoPlayer.CanControlAudio
get

Whether this backend exposes independent volume and mute controls.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 39 of file VlcVideoPlayer.cs.

◆ CanSeek

bool Gondwana.Video.VlcVideoPlayer.CanSeek
get

Whether the current media supports seeking. Legacy backends retain their existing seek behavior.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 42 of file VlcVideoPlayer.cs.

◆ Duration

TimeSpan Gondwana.Video.VlcVideoPlayer.Duration
get

Gets the total duration of the video.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 121 of file VlcVideoPlayer.cs.

◆ HasAudio

bool Gondwana.Video.VlcVideoPlayer.HasAudio
get

Gets whether the video has an audio track. Consult IsMetadataReady before interpreting false.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 118 of file VlcVideoPlayer.cs.

◆ IsMetadataReady

bool Gondwana.Video.VlcVideoPlayer.IsMetadataReady
get

True only when metadata for the current source is available.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 115 of file VlcVideoPlayer.cs.

◆ IsMuted

bool Gondwana.Video.VlcVideoPlayer.IsMuted
getset

Mutes output without changing the retained volume.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 74 of file VlcVideoPlayer.cs.

◆ IsPlaying

bool Gondwana.Video.VlcVideoPlayer.IsPlaying
get

Gets a value indicating whether the video is currently playing.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 102 of file VlcVideoPlayer.cs.

◆ LastError

Exception? Gondwana.Video.VlcVideoPlayer.LastError
get

The most recent native callback or playback failure, if any.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 144 of file VlcVideoPlayer.cs.

◆ Loop

bool Gondwana.Video.VlcVideoPlayer.Loop
getset

Gets or sets a value indicating whether the video should loop when it reaches the end.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 99 of file VlcVideoPlayer.cs.

◆ MaximumFramePixels

int Gondwana.Video.VlcVideoPlayer.MaximumFramePixels = int.MaxValue / 4
get

Maximum pixels (and aligned RGBA-equivalent storage) per decoded frame. Set before playback.

Definition at line 36 of file VlcVideoPlayer.cs.

◆ Metadata

VideoMetadata Gondwana.Video.VlcVideoPlayer.Metadata
get

Gets an atomic snapshot of metadata availability and values for the current source.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 112 of file VlcVideoPlayer.cs.

◆ NaturalSize

int int height Gondwana.Video.VlcVideoPlayer.NaturalSize
get

Implements Gondwana.Video.IVideoPlayer.

Definition at line 134 of file VlcVideoPlayer.cs.

◆ Position

TimeSpan Gondwana.Video.VlcVideoPlayer.Position
get

Gets the current playback position in the video.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 124 of file VlcVideoPlayer.cs.

◆ Volume

float Gondwana.Video.VlcVideoPlayer.Volume
getset

Audible output gain from zero to one. Legacy backends may not support setting it.

Implements Gondwana.Video.IVideoPlayer.

Definition at line 52 of file VlcVideoPlayer.cs.

Event Documentation

◆ Ended

EventHandler? Gondwana.Video.VlcVideoPlayer.Ended

Definition at line 156 of file VlcVideoPlayer.cs.

◆ FrameReady

EventHandler<VideoFrameReadyEventArgs>? Gondwana.Video.VlcVideoPlayer.FrameReady

Definition at line 162 of file VlcVideoPlayer.cs.

◆ Paused

EventHandler? Gondwana.Video.VlcVideoPlayer.Paused

Definition at line 150 of file VlcVideoPlayer.cs.

◆ Started

EventHandler? Gondwana.Video.VlcVideoPlayer.Started

Definition at line 147 of file VlcVideoPlayer.cs.

◆ StateChanged

EventHandler<VideoStateChangedEventArgs>? Gondwana.Video.VlcVideoPlayer.StateChanged

Definition at line 159 of file VlcVideoPlayer.cs.

◆ Stopped

EventHandler? Gondwana.Video.VlcVideoPlayer.Stopped

Definition at line 153 of file VlcVideoPlayer.cs.