[farsight2/master] Check for the presence of rtpdtmfsrc before adding dtmf event blueprint

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:21:30 PST 2008


---
 gst/fsrtpconference/fs-rtp-dtmf-event-source.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-dtmf-event-source.c b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
index df7e85e..84643bf 100644
--- a/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
+++ b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
@@ -29,10 +29,11 @@
 
 #include <gst/farsight/fs-base-conference.h>
 
-#include "fs-rtp-dtmf-event-source.h"
-
+#include "fs-rtp-conference.h"
 #include "fs-rtp-discover-codecs.h"
 
+#include "fs-rtp-dtmf-event-source.h"
+
 #define GST_CAT_DEFAULT fsrtpconference_debug
 
 /**
@@ -171,6 +172,19 @@ fs_rtp_dtmf_event_source_class_add_blueprint (FsRtpSpecialSourceClass *klass,
 {
   GList *item;
   GList *already_done = NULL;
+  GstElementFactory *fact = NULL;
+
+  fact = gst_element_factory_find ("rtpdtmfsrc");
+  if (fact)
+  {
+    gst_object_unref (fact);
+  }
+  else
+  {
+    GST_CAT_WARNING (fsrtpconference_disco,
+        "Could not find rtpdtmfsrc, will not offer DTMF events");
+    return blueprints;
+  }
 
   for (item = g_list_first (blueprints);
        item;
@@ -256,7 +270,6 @@ fs_rtp_dtmf_event_source_class_want_source (FsRtpSpecialSourceClass *klass,
     GList *negotiated_codecs,
     FsCodec *selected_codec)
 {
-
   if (selected_codec->media_type != FS_MEDIA_TYPE_AUDIO)
     return FALSE;
 
-- 
1.5.6.5




More information about the farsight-commits mailing list