1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Updates VideoDecoder plugin API to GDExtension.

Adds VideoStream and relevant resource loaders to migrate
external GDNative plugins to GDExtension.

Adds a VideoStreamLoader as a specialization of ResourceFormatLoader
as ClassDB::is_parent_class is inaccessible from GDExtension currently.

Using Object* instead of Ref<T> in order to avoid the refcount bug
(godotengine/godot-cpp#652)
Also another bug is in ResourceLoader in use on the extension side that
requires fixing.
This commit is contained in:
anish bhobe
2022-07-29 00:23:11 +02:00
committed by Lyuma
parent e9de988020
commit 42a9c33fad
10 changed files with 383 additions and 81 deletions

View File

@@ -236,7 +236,6 @@ void VideoStreamPlayer::set_stream(const Ref<VideoStream> &p_stream) {
AudioServer::get_singleton()->unlock();
if (!playback.is_null()) {
playback->set_loop(loops);
playback->set_paused(paused);
texture = playback->get_texture();
@@ -344,6 +343,12 @@ int VideoStreamPlayer::get_buffering_msec() const {
void VideoStreamPlayer::set_audio_track(int p_track) {
audio_track = p_track;
if (stream.is_valid()) {
stream->set_audio_track(audio_track);
}
if (playback.is_valid()) {
playback->set_audio_track(audio_track);
}
}
int VideoStreamPlayer::get_audio_track() const {