]> git.0d.be Git - empathy.git/commitdiff
recycle the video input gst element
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 2 Dec 2009 17:32:35 +0000 (17:32 +0000)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 1 Apr 2010 08:15:38 +0000 (10:15 +0200)
There is no point to recreate it for each call.

src/empathy-call-window.c

index 56d3ab285614160b3ba83ea0fb41be4c2be78818..a1c7c625efdbe2b522de7dbe23fbc8a8e03e4f77 100644 (file)
@@ -622,13 +622,20 @@ create_audio_output (EmpathyCallWindow *self)
 }
 
 static void
-initialize_input_elements (GstBus *bus, EmpathyCallWindow *self)
+create_video_input (EmpathyCallWindow *self)
 {
   EmpathyCallWindowPriv *priv = GET_PRIV (self);
 
+  g_assert (priv->video_input == NULL);
   priv->video_input = empathy_video_src_new ();
   gst_object_ref (priv->video_input);
   gst_object_sink (priv->video_input);
+}
+
+static void
+initialize_input_elements (GstBus *bus, EmpathyCallWindow *self)
+{
+  EmpathyCallWindowPriv *priv = GET_PRIV (self);
 
   priv->audio_input = empathy_audio_src_new ();
   gst_object_ref (priv->audio_input);
@@ -1016,6 +1023,7 @@ empathy_call_window_init (EmpathyCallWindow *self)
 
   create_pipeline (self);
   create_audio_output (self);
+  create_video_input (self);
 
   priv->fsnotifier = fs_element_added_notifier_new ();
   fs_element_added_notifier_add (priv->fsnotifier, GST_BIN (priv->pipeline));
@@ -1494,10 +1502,6 @@ empathy_call_window_reset_pipeline (EmpathyCallWindow *self)
         g_object_unref (priv->pipeline);
       priv->pipeline = NULL;
 
-      if (priv->video_input != NULL)
-        g_object_unref (priv->video_input);
-      priv->video_input = NULL;
-
       if (priv->audio_input != NULL)
         g_object_unref (priv->audio_input);
       priv->audio_input = NULL;