Class VideoStreamPlayback
- Namespace
- Godot
- Assembly
- GodotSharp.dll
This class is intended to be overridden by video decoder extensions with custom implementations of VideoStream.
public class VideoStreamPlayback : Resource, IDisposable
- Inheritance
-
VideoStreamPlayback
- Implements
- Inherited Members
Constructors
VideoStreamPlayback()
public VideoStreamPlayback()
Methods
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
MixAudio(int, float[], int)
Render numFrames
audio frames (of _GetChannels() floats each) from buffer
, starting from index offset
in the array. Returns the number of audio frames rendered, or -1 on error.
public int MixAudio(int numFrames, float[] buffer = null, int offset = 0)
Parameters
numFrames
intbuffer
float[]If the parameter is null, then the default value is
Array.Empty<float>()
.offset
int
Returns
_GetChannels()
Returns the number of audio channels.
public virtual int _GetChannels()
Returns
_GetLength()
Returns the video duration in seconds, if known, or 0 if unknown.
public virtual double _GetLength()
Returns
_GetMixRate()
Returns the audio sample rate used for mixing.
public virtual int _GetMixRate()
Returns
_GetPlaybackPosition()
Return the current playback timestamp. Called in response to the StreamPosition getter.
public virtual double _GetPlaybackPosition()
Returns
_GetTexture()
Allocates a Texture2D in which decoded video frames will be drawn.
public virtual Texture2D _GetTexture()
Returns
_IsPaused()
Returns the paused status, as set by _SetPaused(bool).
public virtual bool _IsPaused()
Returns
_IsPlaying()
public virtual bool _IsPlaying()
Returns
_Play()
Called in response to Autoplay or Play(). Note that manual playback may also invoke _Stop() multiple times before this method is called. _IsPlaying() should return true once playing.
public virtual void _Play()
_Seek(double)
Seeks to time
seconds. Called in response to the StreamPosition setter.
public virtual void _Seek(double time)
Parameters
time
double
_SetAudioTrack(int)
Select the audio track idx
. Called when playback starts, and in response to the AudioTrack setter.
public virtual void _SetAudioTrack(int idx)
Parameters
idx
int
_SetPaused(bool)
Set the paused status of video playback. _IsPaused() must return paused
. Called in response to the Paused setter.
public virtual void _SetPaused(bool paused)
Parameters
paused
bool
_Stop()
Stops playback. May be called multiple times before _Play(), or in response to Stop(). _IsPlaying() should return false once stopped.
public virtual void _Stop()
_Update(double)
Ticks video playback for delta
seconds. Called every frame as long as _IsPaused() and _IsPlaying() return true.
public virtual void _Update(double delta)
Parameters
delta
double