]> git.0d.be Git - empathy.git/blobdiff - src/empathy-video-src.c
add an header bar to the main window
[empathy.git] / src / empathy-video-src.c
index 8c9c7501548c6f6182d8845a72981717b58e5998..41dea2377c3636a6f3f3952c5f621d0b726f2eef 100644 (file)
  */
 
 #include "config.h"
+#include "empathy-video-src.h"
 
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <gst/interfaces/colorbalance.h>
+#include <gst/video/colorbalance.h>
 
 #define DEBUG_FLAG EMPATHY_DEBUG_VOIP
-#include <libempathy/empathy-debug.h>
-
-#include "empathy-video-src.h"
+#include "empathy-debug.h"
 
 G_DEFINE_TYPE(EmpathyGstVideoSrc, empathy_video_src, GST_TYPE_BIN)
 
@@ -112,10 +108,15 @@ error:
   return NULL;
 }
 
-static gboolean
-empathy_video_src_drop_eos (GstPad *pad, GstEvent *event, gpointer user_data)
+static GstPadProbeReturn
+empathy_video_src_drop_eos (GstPad *pad,
+  GstPadProbeInfo *info,
+  gpointer user_data)
 {
-  return GST_EVENT_TYPE (event) != GST_EVENT_EOS;
+  if (GST_EVENT_TYPE (GST_PAD_PROBE_INFO_EVENT (info)) == GST_EVENT_EOS)
+    return GST_PAD_PROBE_DROP;
+
+  return GST_PAD_PROBE_OK;
 }
 
 static void
@@ -128,7 +129,7 @@ empathy_video_src_init (EmpathyGstVideoSrc *obj)
   gchar *str;
 
   /* allocate caps here, so we can update it by optional elements */
-  caps = gst_caps_new_simple ("video/x-raw-yuv",
+  caps = gst_caps_new_simple ("video/x-raw",
     "width", G_TYPE_INT, 320,
     "height", G_TYPE_INT, 240,
     NULL);
@@ -144,7 +145,10 @@ empathy_video_src_init (EmpathyGstVideoSrc *obj)
   /* Drop EOS events, so that our sinks don't get confused when we restart the
    * source (triggering an EOS) */
   src = gst_element_get_static_pad (element, "src");
-  gst_pad_add_event_probe (src, G_CALLBACK (empathy_video_src_drop_eos), NULL);
+
+  gst_pad_add_probe (src, GST_PAD_PROBE_TYPE_EVENT_DOWNSTREAM,
+    empathy_video_src_drop_eos, NULL, NULL);
+
   gst_object_unref (src);
 
   /* videorate with the required properties optional as it needs a currently
@@ -179,8 +183,8 @@ empathy_video_src_init (EmpathyGstVideoSrc *obj)
   g_free (str);
 
   if ((element = empathy_gst_add_to_bin (GST_BIN (obj),
-      element, "ffmpegcolorspace")) == NULL)
-    g_error ("Failed to add \"ffmpegcolorspace\" (gst-plugins-base missing?)");
+      element, "videoconvert")) == NULL)
+    g_error ("Failed to add \"videoconvert\" (gst-plugins-base missing?)");
 
   if ((element = empathy_gst_add_to_bin (GST_BIN (obj),
       element, "videoscale")) == NULL)