Combine GStreamer GTK4 plugin with API

Ship custom gtk4glsink plugin as part of API insead of normal gstreamer plugin. This avoids gstreamer plugin registry conflicts with gtk3 plugin and allows more customization.
This commit is contained in:
Rafał Dzięgiel
2021-01-29 17:27:39 +01:00
parent 4ad2b707dd
commit 2ce44d4e63
17 changed files with 2964 additions and 30 deletions

View File

@@ -14,21 +14,9 @@ class ClapperPlayerBase extends GstClapper.Clapper
{
_init()
{
if(!Gst.is_initialized())
Gst.init(null);
const plugin = 'gtk4glsink';
const gtk4glsink = Gst.ElementFactory.make(plugin, null);
if(!gtk4glsink) {
debug(new Error(
`Could not load "${plugin}".`
+ ' Do you have gstreamer-plugins-good-gtk4 installed?'
));
}
const gtk4plugin = new GstClapper.ClapperGtk4Plugin();
const glsinkbin = Gst.ElementFactory.make('glsinkbin', null);
glsinkbin.sink = gtk4glsink;
glsinkbin.sink = gtk4plugin.video_sink;
const dispatcher = new GstClapper.ClapperGMainContextSignalDispatcher();
const renderer = new GstClapper.ClapperVideoOverlayVideoRenderer({
@@ -40,7 +28,7 @@ class ClapperPlayerBase extends GstClapper.Clapper
video_renderer: renderer
});
this.widget = gtk4glsink.widget;
this.widget = gtk4plugin.video_sink.widget;
this.widget.vexpand = true;
this.widget.hexpand = true;