VlcjVideoTexture

class VlcjVideoTexture(val mediaUrl: String, width: Int, height: Int) : CallbackVideoTexture, VideoPlayback

JVM video texture driven by VLCJ (libVLC bindings). VLCJ's CallbackVideoSurface decodes frames in BGRA (RV32) into a native ByteBuffer; on every render callback we copy them into the CallbackVideoTexture base and the GL thread uploads on bind.

Runtime requirement: VLC 3.0+ installed and discoverable by VLCJ (system-wide install is simplest; VLCJ also accepts -Djna.library.path=…). Without VLC, MediaPlayerFactory construction fails — the tutorial wraps that in try/catch.

Constructors

Link copied to clipboard
constructor(mediaUrl: String, width: Int, height: Int)

Properties

Link copied to clipboard
Link copied to clipboard
val coordTransform: Matrix3
Link copied to clipboard

Caller opt-out for mipmap generation.

Link copied to clipboard
val height: Int
Link copied to clipboard

True once libVLC has parsed the media and is decoding.

Link copied to clipboard

URL or filesystem path to the media (e.g. "C:/.../drone.mp4").

Link copied to clipboard
val target: Int
Link copied to clipboard
open override val timeMs: Long

Current playback time in milliseconds, or -1 when no media is loaded.

Link copied to clipboard
val width: Int

Functions

Link copied to clipboard
open override fun bindTexture(dc: DrawContext): Boolean
Link copied to clipboard
fun getTexParameter(name: Int): Int
Link copied to clipboard
fun getTextureName(dc: DrawContext): KglTexture
Link copied to clipboard
open override fun pause()

Pause playback. The current frame stays on the texture; resumable via play.

Link copied to clipboard
open override fun play()

Start (or resume) playback. Re-entrant: the first call prepares the media and starts playing; subsequent calls just resume after pause.

Link copied to clipboard
open override fun release(dc: DrawContext)

Frees any resources associated with this instance. After this method returns the rendering resource is invalid, and any associated GL object is deleted.

open override fun release()

Free decoder + native resources. After release the texture is unusable.

Link copied to clipboard
fun setTexParameter(name: Int, param: Int)
Link copied to clipboard
open override fun stop()

Stop playback and rewind to the start.