VideoStreamPlayback

package
v0.0.0-...-a66c66c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package VideoStreamPlayback provides methods for working with VideoStreamPlayback object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsVideoStreamPlayback() Instance
}

type Expanded

type Expanded [1]gdclass.VideoStreamPlayback

func (Expanded) MixAudio

func (self Expanded) MixAudio(num_frames int, buffer []float32, offset int) int

Render [param num_frames] audio frames (of [method _get_channels] floats each) from [param buffer], starting from index [param offset] in the array. Returns the number of audio frames rendered, or -1 on error.

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

func (*Extension[T]) AsVideoStreamPlayback

func (self *Extension[T]) AsVideoStreamPlayback() Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

type Instance [1]gdclass.VideoStreamPlayback

This class is intended to be overridden by video decoder extensions with custom implementations of [VideoStream].

See [Interface] for methods that can be overridden by a [Class] that extends it.
var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsVideoStreamPlayback

func (self Instance) AsVideoStreamPlayback() Instance

func (Instance) ID

func (self Instance) ID() ID

func (Instance) MixAudio

func (self Instance) MixAudio(num_frames int) int

Render [param num_frames] audio frames (of [method _get_channels] floats each) from [param buffer], starting from index [param offset] in the array. Returns the number of audio frames rendered, or -1 on error.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type Interface

type Interface interface {
	//Stops playback. May be called multiple times before [method _play], or in response to [method VideoStreamPlayer.stop]. [method _is_playing] should return [code]false[/code] once stopped.
	Stop()
	//Called in response to [member VideoStreamPlayer.autoplay] or [method VideoStreamPlayer.play]. Note that manual playback may also invoke [method _stop] multiple times before this method is called. [method _is_playing] should return [code]true[/code] once playing.
	Play()
	//Returns the playback state, as determined by calls to [method _play] and [method _stop].
	IsPlaying() bool
	//Set the paused status of video playback. [method _is_paused] must return [param paused]. Called in response to the [member VideoStreamPlayer.paused] setter.
	SetPaused(paused bool)
	//Returns the paused status, as set by [method _set_paused].
	IsPaused() bool
	//Returns the video duration in seconds, if known, or 0 if unknown.
	GetLength() Float.X
	//Return the current playback timestamp. Called in response to the [member VideoStreamPlayer.stream_position] getter.
	GetPlaybackPosition() Float.X
	//Seeks to [param time] seconds. Called in response to the [member VideoStreamPlayer.stream_position] setter.
	Seek(time Float.X)
	//Select the audio track [param idx]. Called when playback starts, and in response to the [member VideoStreamPlayer.audio_track] setter.
	SetAudioTrack(idx int)
	//Allocates a [Texture2D] in which decoded video frames will be drawn.
	GetTexture() Texture2D.Instance
	//Ticks video playback for [param delta] seconds. Called every frame as long as both [method _is_paused] and [method _is_playing] return [code]true[/code].
	Update(delta Float.X)
	//Returns the number of audio channels.
	GetChannels() int
	//Returns the audio sample rate used for mixing.
	GetMixRate() int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL