mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Flatpak: add more black rendering improvements to patch
This commit is contained in:
10
clapper_src/controls.js
vendored
10
clapper_src/controls.js
vendored
@@ -204,10 +204,8 @@ class ClapperControls extends Gtk.Box
|
||||
}
|
||||
|
||||
if(checkButton.activeId < 0) {
|
||||
/* Disabling video leaves last frame frozen,
|
||||
* so we hide it by making it transparent */
|
||||
//if(checkButton.type === 'video')
|
||||
// clapperWidget.player.widget.set_opacity(0);
|
||||
if(checkButton.type === 'video')
|
||||
clapperWidget.player.draw_black(true);
|
||||
|
||||
return clapperWidget.player[
|
||||
`set_${checkButton.type}_track_enabled`
|
||||
@@ -219,8 +217,8 @@ class ClapperControls extends Gtk.Box
|
||||
clapperWidget.player[setTrack](checkButton.activeId);
|
||||
clapperWidget.player[`${setTrack}_enabled`](true);
|
||||
|
||||
//if(checkButton.type === 'video' && !clapperWidget.player.widget.opacity)
|
||||
// clapperWidget.player.widget.set_opacity(1);
|
||||
if(checkButton.type === 'video')
|
||||
clapperWidget.player.draw_black(false);
|
||||
}
|
||||
|
||||
_handleVisualizationChange(checkButton)
|
||||
|
@@ -14,7 +14,6 @@ class ClapperPlayer extends PlayerBase
|
||||
{
|
||||
super._init();
|
||||
|
||||
this.state = GstPlayer.PlayerState.STOPPED;
|
||||
this.cursorInPlayer = false;
|
||||
this.is_local_file = false;
|
||||
this.seek_done = true;
|
||||
|
@@ -39,6 +39,7 @@ class ClapperPlayerBase extends GstPlayer.Player
|
||||
+ ' Do you have gstreamer-plugins-good-gtk4 installed?'
|
||||
));
|
||||
}
|
||||
gtkglsink.show_preroll_frame = false;
|
||||
|
||||
let glsinkbin = Gst.ElementFactory.make('glsinkbin', null);
|
||||
glsinkbin.sink = gtkglsink;
|
||||
@@ -59,10 +60,11 @@ class ClapperPlayerBase extends GstPlayer.Player
|
||||
video_renderer: renderer
|
||||
});
|
||||
|
||||
this.widget = gtkglsink.widget;
|
||||
this.gtkglsink = gtkglsink;
|
||||
this.widget.vexpand = true;
|
||||
this.widget.hexpand = true;
|
||||
|
||||
this.state = GstPlayer.PlayerState.STOPPED;
|
||||
this.visualization_enabled = false;
|
||||
|
||||
this.set_all_plugins_ranks();
|
||||
@@ -72,6 +74,11 @@ class ClapperPlayerBase extends GstPlayer.Player
|
||||
settings.connect('changed', this._onSettingsKeyChanged.bind(this));
|
||||
}
|
||||
|
||||
get widget()
|
||||
{
|
||||
return this.gtkglsink.widget;
|
||||
}
|
||||
|
||||
set_and_bind_settings()
|
||||
{
|
||||
let settingsToSet = [
|
||||
@@ -160,6 +167,14 @@ class ClapperPlayerBase extends GstPlayer.Player
|
||||
debug(`changed rank: ${oldRank} -> ${rank} for ${name}`);
|
||||
}
|
||||
|
||||
draw_black(isEnabled)
|
||||
{
|
||||
this.gtkglsink.ignore_textures = isEnabled;
|
||||
|
||||
if(this.state !== GstPlayer.PlayerState.PLAYING)
|
||||
this.widget.queue_render();
|
||||
}
|
||||
|
||||
_onSettingsKeyChanged(settings, key)
|
||||
{
|
||||
switch(key) {
|
||||
|
Reference in New Issue
Block a user