]> git.0d.be Git - empathy.git/commitdiff
Hook resolution change support
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Wed, 6 Jul 2011 22:18:58 +0000 (18:18 -0400)
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>
Mon, 7 Nov 2011 20:07:19 +0000 (20:07 +0000)
src/empathy-call-window.c

index 92e0c4399ef46b8f2c7702e07ef402cc3815414f..4def7d86e5c5b698c147c611e4b2c042d35289f5 100644 (file)
@@ -2736,6 +2736,35 @@ empathy_call_window_sink_removed_cb (EmpathyCallHandler *handler,
   return FALSE;
 }
 
+static void
+empathy_call_window_framerate_changed_cb (EmpathyCallHandler *handler,
+    guint framerate,
+    EmpathyCallWindow *self)
+{
+  EmpathyCallWindowPriv *priv = GET_PRIV (self);
+
+  DEBUG ("Framerate changed to %u", framerate);
+
+  if (priv->video_input != NULL)
+    empathy_video_src_set_framerate (priv->video_input, framerate);
+}
+
+static void
+empathy_call_window_resolution_changed_cb (EmpathyCallHandler *handler,
+    guint width,
+    guint height,
+    EmpathyCallWindow *self)
+{
+  EmpathyCallWindowPriv *priv = GET_PRIV (self);
+
+  DEBUG ("Resolution changed to %ux%u", width, height);
+
+  if (priv->video_input != NULL)
+    {
+      empathy_video_src_set_resolution (priv->video_input, width, height);
+    }
+}
+
 /* Called with global lock held */
 static GstPad *
 empathy_call_window_get_video_sink_pad (EmpathyCallWindow *self)
@@ -3680,6 +3709,11 @@ empathy_call_window_connect_handler (EmpathyCallWindow *self)
   g_signal_connect (priv->handler, "notify::call-channel",
     G_CALLBACK (call_handler_notify_call_cb), self);
 
+  g_signal_connect (priv->handler, "framerate-changed",
+    G_CALLBACK (empathy_call_window_framerate_changed_cb), self);
+  g_signal_connect (priv->handler, "resolution-changed",
+    G_CALLBACK (empathy_call_window_resolution_changed_cb), self);
+
   g_object_get (priv->handler, "call-channel", &call, NULL);
   if (call != NULL)
     {