[gnome-shell] Initialize GStreamer from shell_recorder_init()



commit f7746ec3f668566e7c9fc429ce0070508b74f41a
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Thu Aug 6 15:07:55 2009 -0400

    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.

 js/ui/main.js        |    5 -----
 src/shell-recorder.c |    3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/main.js b/js/ui/main.js
index d22d523..4e20007 100644
--- a/js/ui/main.js
+++ b/js/ui/main.js
@@ -67,11 +67,6 @@ function start() {
     
     global.screen.connect('toggle-recording', function() {
         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 });
         }
 
diff --git a/src/shell-recorder.c b/src/shell-recorder.c
index 134c0e5..2ff7d5a 100644
--- a/src/shell-recorder.c
+++ b/src/shell-recorder.c
@@ -232,6 +232,9 @@ get_memory_target (void)
 static void
 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 ();
 
   recorder->recording_icon = create_recording_icon ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]