feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -127,6 +127,13 @@ void VideoStreamPlayer::_mix_audio() {
|
|||
|
||||
void VideoStreamPlayer::_notification(int p_notification) {
|
||||
switch (p_notification) {
|
||||
case NOTIFICATION_ACCESSIBILITY_UPDATE: {
|
||||
RID ae = get_accessibility_element();
|
||||
ERR_FAIL_COND(ae.is_null());
|
||||
|
||||
DisplayServer::get_singleton()->accessibility_update_set_role(ae, DisplayServer::AccessibilityRole::ROLE_VIDEO);
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_ENTER_TREE: {
|
||||
AudioServer::get_singleton()->add_mix_callback(_mix_audios, this);
|
||||
|
||||
|
|
@ -136,6 +143,7 @@ void VideoStreamPlayer::_notification(int p_notification) {
|
|||
} break;
|
||||
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
stop();
|
||||
AudioServer::get_singleton()->remove_mix_callback(_mix_audios, this);
|
||||
} break;
|
||||
|
||||
|
|
@ -175,7 +183,7 @@ void VideoStreamPlayer::_notification(int p_notification) {
|
|||
return;
|
||||
}
|
||||
|
||||
Size2 s = expand ? get_size() : texture->get_size();
|
||||
Size2 s = expand ? get_size() : texture_size;
|
||||
draw_texture_rect(texture, Rect2(Point2(), s), false);
|
||||
} break;
|
||||
|
||||
|
|
@ -211,9 +219,25 @@ void VideoStreamPlayer::_notification(int p_notification) {
|
|||
}
|
||||
}
|
||||
|
||||
void VideoStreamPlayer::texture_changed(const Ref<Texture2D> &p_texture) {
|
||||
const Size2 new_texture_size = p_texture.is_valid() ? p_texture->get_size() : Size2();
|
||||
|
||||
if (new_texture_size == texture_size) {
|
||||
return;
|
||||
}
|
||||
|
||||
texture_size = new_texture_size;
|
||||
|
||||
queue_redraw();
|
||||
|
||||
if (!expand) {
|
||||
update_minimum_size();
|
||||
}
|
||||
}
|
||||
|
||||
Size2 VideoStreamPlayer::get_minimum_size() const {
|
||||
if (!expand && texture.is_valid()) {
|
||||
return texture->get_size();
|
||||
return texture_size;
|
||||
} else {
|
||||
return Size2();
|
||||
}
|
||||
|
|
@ -265,10 +289,19 @@ void VideoStreamPlayer::set_stream(const Ref<VideoStream> &p_stream) {
|
|||
stream->connect_changed(callable_mp(this, &VideoStreamPlayer::set_stream).bind(stream));
|
||||
}
|
||||
|
||||
if (texture.is_valid()) {
|
||||
texture->disconnect_changed(callable_mp(this, &VideoStreamPlayer::texture_changed));
|
||||
}
|
||||
|
||||
if (playback.is_valid()) {
|
||||
playback->set_paused(paused);
|
||||
texture = playback->get_texture();
|
||||
|
||||
if (texture.is_valid()) {
|
||||
texture_size = texture->get_size();
|
||||
texture->connect_changed(callable_mp(this, &VideoStreamPlayer::texture_changed).bind(texture));
|
||||
}
|
||||
|
||||
const int channels = playback->get_channels();
|
||||
|
||||
AudioServer::get_singleton()->lock();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue