Inherits: Resource < RefCounted < Object
Internal class used by VideoStream to manage playback state when played from a VideoStreamPlayer.
This class is intended to be overridden by video decoder extensions with custom implementations of VideoStream.
_get_channels ( ) virtual const | |
_get_length ( ) virtual const | |
_get_mix_rate ( ) virtual const | |
_get_playback_position ( ) virtual const | |
_get_texture ( ) virtual const | |
_is_paused ( ) virtual const | |
_is_playing ( ) virtual const | |
void | _play ( ) virtual |
void | |
void | _set_audio_track ( int idx ) virtual |
void | _set_paused ( bool paused ) virtual |
void | _stop ( ) virtual |
void | |
mix_audio ( int num_frames, PackedFloat32Array buffer=PackedFloat32Array(), int offset=0 ) |
Returns the number of audio channels.
Returns the video duration in seconds, if known, or 0 if unknown.
Returns the audio sample rate used for mixing.
Return the current playback timestamp. Called in response to the VideoStreamPlayer.stream_position getter.
Allocates a Texture2D in which decoded video frames will be drawn.
Returns the paused status, as set by _set_paused.
Returns the playback state, as determined by calls to _play and _stop.
Called in response to VideoStreamPlayer.autoplay or VideoStreamPlayer.play. Note that manual playback may also invoke _stop multiple times before this method is called. _is_playing should return true once playing.
Seeks to time seconds. Called in response to the VideoStreamPlayer.stream_position setter.
Select the audio track idx. Called when playback starts, and in response to the VideoStreamPlayer.audio_track setter.
Set the paused status of video playback. _is_paused must return paused. Called in response to the VideoStreamPlayer.paused setter.
Stops playback. May be called multiple times before _play, or in response to VideoStreamPlayer.stop. _is_playing should return false once stopped.
Ticks video playback for delta seconds. Called every frame as long as _is_paused and _is_playing return true.
Render num_frames audio frames (of _get_channels floats each) from buffer, starting from index offset in the array. Returns the number of audio frames rendered, or -1 on error.
© 2014–present Juan Linietsky, Ariel Manzur and the Godot community
Licensed under the Creative Commons Attribution Unported License v3.0.
https://docs.godotengine.org/en/4.2/classes/class_videostreamplayback.html