api: Introduce custom gstreamer init function

Initializes GStreamer library and tweaks some of its defaults to our liking.
This also allows usage of GstClapper API alone without importing GStreamer on the implementation side.

It changes preferred hardware acceleration order (depending on plugins versions) into:
v4l2sl -> nv -> va -> vaapi -> v4l2
This commit is contained in:
Rafał Dzięgiel
2021-08-24 13:10:25 +02:00
parent 87a0dd473e
commit 5874db45ea
3 changed files with 101 additions and 3 deletions

View File

@@ -2,9 +2,9 @@ imports.gi.versions.Gdk = '4.0';
imports.gi.versions.Gtk = '4.0';
imports.gi.versions.Soup = '2.4';
const { Gst, Gtk, Adw } = imports.gi;
const { GstClapper, Gtk, Adw } = imports.gi;
Gst.init(null);
GstClapper.Clapper.gst_init(null);
Gtk.init();
Adw.init();