Keep a ref to main context

Might help with GJS toggling down object bug. Needs some testing.
This commit is contained in:
Rafostar
2020-11-03 17:18:37 +01:00
parent 02afe2b06d
commit ba54a36058

View File

@@ -1,4 +1,4 @@
const { Gio, GObject, Gst, GstPlayer, Gtk } = imports.gi;
const { Gio, GLib, GObject, Gst, GstPlayer, Gtk } = imports.gi;
const Debug = imports.clapper_src.debug;
let { debug } = Debug;
@@ -24,7 +24,13 @@ class ClapperPlayerBase extends GstPlayer.Player
let glsinkbin = Gst.ElementFactory.make('glsinkbin', null);
glsinkbin.sink = gtkglsink;
let dispatcher = new GstPlayer.PlayerGMainContextSignalDispatcher();
let context = GLib.MainContext.ref_thread_default();
let acquired = context.acquire();
debug(`default context acquired: ${acquired}`);
let dispatcher = new GstPlayer.PlayerGMainContextSignalDispatcher({
application_context: context,
});
let renderer = new GstPlayer.PlayerVideoOverlayVideoRenderer({
video_sink: glsinkbin
});