Initialize GStreamer from shell_recorder_init()
Move the GStreamer initialization from the Javascript code into shell_recorder_init(). This avoids a dependency on the GStreamer introspection information and will make it easier to drop the gir-repository module dependency.
This commit is contained in:
parent
03e0fe1e95
commit
f7746ec3f6
@ -67,11 +67,6 @@ function start() {
|
|||||||
|
|
||||||
global.screen.connect('toggle-recording', function() {
|
global.screen.connect('toggle-recording', function() {
|
||||||
if (recorder == null) {
|
if (recorder == null) {
|
||||||
// We have to initialize GStreamer first. This isn't done
|
|
||||||
// inside ShellRecorder to make it usable inside projects
|
|
||||||
// with other usage of GStreamer.
|
|
||||||
let Gst = imports.gi.Gst;
|
|
||||||
Gst.init(null, null);
|
|
||||||
recorder = new Shell.Recorder({ stage: global.stage });
|
recorder = new Shell.Recorder({ stage: global.stage });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -232,6 +232,9 @@ get_memory_target (void)
|
|||||||
static void
|
static void
|
||||||
shell_recorder_init (ShellRecorder *recorder)
|
shell_recorder_init (ShellRecorder *recorder)
|
||||||
{
|
{
|
||||||
|
/* Calling gst_init() is a no-op if GStreamer was previously initialized */
|
||||||
|
gst_init (NULL, NULL);
|
||||||
|
|
||||||
shell_recorder_src_register ();
|
shell_recorder_src_register ();
|
||||||
|
|
||||||
recorder->recording_icon = create_recording_icon ();
|
recorder->recording_icon = create_recording_icon ();
|
||||||
|
Loading…
Reference in New Issue
Block a user