[farsight2/master] Add function to start/stop telephony events on FsRtpSpecialSource

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


---
 gst/fsrtpconference/fs-rtp-session.c        |    2 +-
 gst/fsrtpconference/fs-rtp-special-source.c |   45 +++++++++++++++++++++++++++
 gst/fsrtpconference/fs-rtp-special-source.h |   19 +++++++++++
 3 files changed, 65 insertions(+), 1 deletions(-)

diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index dac777e..45f9f5c 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -1196,7 +1196,7 @@ fs_rtp_session_new_stream (FsSession *session,
  *
  * This function will start sending a telephony event (such as a DTMF
  * tone) on the #FsRtpSession. You have to call the function
- * #fs_rtp_session_stop_telephony_event() to stop it. 
+ * #fs_rtp_session_stop_telephony_event() to stop it.
  * This function will use any available method, if you want to use a specific
  * method only, use #fs_rtp_session_start_telephony_event_full()
  *
diff --git a/gst/fsrtpconference/fs-rtp-special-source.c b/gst/fsrtpconference/fs-rtp-special-source.c
index e1d1e85..a2eee95 100644
--- a/gst/fsrtpconference/fs-rtp-special-source.c
+++ b/gst/fsrtpconference/fs-rtp-special-source.c
@@ -259,3 +259,48 @@ fs_rtp_special_source_update (FsRtpSpecialSource *source,
 
   return FALSE;
 }
+
+
+gboolean
+fs_rtp_special_sources_start_telephony_event (GList *current_extra_sources,
+      guint8 event,
+      guint8 volume,
+      FsDTMFMethod method)
+{
+  GList *item = NULL;
+
+  for (item = g_list_first (current_extra_sources);
+       item;
+       item = g_list_next (item))
+  {
+    FsRtpSpecialSource *source = item->data;
+    FsRtpSpecialSourceClass *klass = FS_RTP_SPECIAL_SOURCE_GET_CLASS (source);
+
+    if (klass->start_telephony_event)
+      if (klass->start_telephony_event (source, event, volume, method))
+        return TRUE;
+  }
+
+  return FALSE;
+}
+
+gboolean
+fs_rtp_special_sources_stop_telephony_event (GList *current_extra_sources,
+    FsDTMFMethod method)
+{
+  GList *item = NULL;
+
+  for (item = g_list_first (current_extra_sources);
+       item;
+       item = g_list_next (item))
+  {
+    FsRtpSpecialSource *source = item->data;
+    FsRtpSpecialSourceClass *klass = FS_RTP_SPECIAL_SOURCE_GET_CLASS (source);
+
+    if (klass->stop_telephony_event)
+      if (klass->stop_telephony_event (source, method))
+        return TRUE;
+  }
+
+  return FALSE;
+}
diff --git a/gst/fsrtpconference/fs-rtp-special-source.h b/gst/fsrtpconference/fs-rtp-special-source.h
index 3814c31..3dcbdd6 100644
--- a/gst/fsrtpconference/fs-rtp-special-source.h
+++ b/gst/fsrtpconference/fs-rtp-special-source.h
@@ -62,6 +62,15 @@ struct _FsRtpSpecialSourceClass
       GList *negotiated_codecs,
       FsCodec *selected_codec);
 
+  gboolean (*start_telephony_event) (FsRtpSpecialSource *source,
+      guint8 event,
+      guint8 volume,
+      FsDTMFMethod method);
+
+  gboolean (*stop_telephony_event) (FsRtpSpecialSource *source,
+      FsDTMFMethod method);
+
+
   /* Class methods */
   gboolean (*want_source) (FsRtpSpecialSourceClass *klass,
       GList *negotiated_codecs,
@@ -102,6 +111,16 @@ fs_rtp_special_sources_update (
 GList *
 fs_rtp_special_sources_add_blueprints (GList *blueprints);
 
+gboolean
+fs_rtp_special_sources_start_telephony_event (GList *current_extra_sources,
+      guint8 event,
+      guint8 volume,
+      FsDTMFMethod method);
+
+gboolean
+fs_rtp_special_sources_stop_telephony_event (GList *current_extra_sources,
+    FsDTMFMethod method);
+
 G_END_DECLS
 
 #endif /* __FS_RTP_SPECIAL_SOURCE_H__ */
-- 
1.5.6.5




More information about the farsight-commits mailing list