[farsight2/master] Add empty FsRtpDtmfEventSource class

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


---
 gst/fsrtpconference/Makefile.am                |    6 +-
 gst/fsrtpconference/fs-rtp-dtmf-event-source.c |  154 ++++++++++++++++++++++++
 gst/fsrtpconference/fs-rtp-dtmf-event-source.h |   74 +++++++++++
 gst/fsrtpconference/fs-rtp-special-source.c    |   10 +-
 gst/fsrtpconference/fs-rtp-special-source.h    |    2 +-
 5 files changed, 238 insertions(+), 8 deletions(-)
 create mode 100644 gst/fsrtpconference/fs-rtp-dtmf-event-source.c
 create mode 100644 gst/fsrtpconference/fs-rtp-dtmf-event-source.h

diff --git a/gst/fsrtpconference/Makefile.am b/gst/fsrtpconference/Makefile.am
index 8cc0ffd..b185b57 100644
--- a/gst/fsrtpconference/Makefile.am
+++ b/gst/fsrtpconference/Makefile.am
@@ -10,7 +10,8 @@ libfsrtpconference_la_SOURCES = gstfsrtpconference.c \
 	fs-rtp-codec-cache.c \
 	fs-rtp-codec-negotiation.c \
 	fs-rtp-specific-nego.c \
-	fs-rtp-special-source.c
+	fs-rtp-special-source.c \
+	fs-rtp-dtmf-event-source.c
 
 libfsrtpconference_la_CFLAGS = $(FS2_INTERNAL_CFLAGS) $(FS2_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
 libfsrtpconference_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
@@ -29,4 +30,5 @@ noinst_HEADERS = \
 	fs-rtp-codec-cache.h \
 	fs-rtp-codec-negotiation.h \
 	fs-rtp-specific-nego.h \
-	fs-rtp-special-source.h
+	fs-rtp-special-source.h \
+	fs-rtp-dtmf-event-source.h
diff --git a/gst/fsrtpconference/fs-rtp-dtmf-event-source.c b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
new file mode 100644
index 0000000..239f7f8
--- /dev/null
+++ b/gst/fsrtpconference/fs-rtp-dtmf-event-source.c
@@ -0,0 +1,154 @@
+/*
+ * Farsight2 - Farsight RTP DTMF Event Source
+ *
+ * Copyright 2007 Collabora Ltd.
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk>
+ * Copyright 2007 Nokia Corp.
+ *
+ * fs-rtp-dtmf-event-source.c - A Farsight RTP Event Source gobject
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gst/farsight/fs-base-conference.h>
+
+#include "fs-rtp-dtmf-event-source.h"
+
+#define GST_CAT_DEFAULT fsrtpconference_debug
+
+/**
+ * SECTION:fs-rtp-dtmf-event-source
+ * @short_description: Class to create the source of DTMF events
+ *
+ * This class is manages the DTMF Event source and related matters
+ *
+ */
+
+
+struct _FsRtpDtmfEventSourcePrivate {
+  gboolean disposed;
+};
+
+static FsRtpSpecialSourceClass *parent_class = NULL;
+
+G_DEFINE_TYPE(FsRtpDtmfEventSource, fs_rtp_dtmf_event_source,
+    FS_TYPE_RTP_SPECIAL_SOURCE);
+
+#define FS_RTP_DTMF_EVENT_SOURCE_GET_PRIVATE(o)                                 \
+  (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_RTP_DTMF_EVENT_SOURCE,             \
+   FsRtpDtmfEventSourcePrivate))
+
+static void fs_rtp_dtmf_event_source_dispose (GObject *object);
+
+static FsRtpSpecialSource *fs_rtp_dtmf_event_source_new (
+    FsRtpSpecialSourceClass *klass,
+    GList *negotiated_sources,
+    GstElement *bin,
+    GstElement *rtpmuxer,
+    GError **error);
+static gboolean fs_rtp_dtmf_event_source_class_want_source (
+    FsRtpSpecialSourceClass *klass,
+    GList *negotiated_sources);
+static GList *fs_rtp_dtmf_event_source_class_add_blueprint (
+    FsRtpSpecialSourceClass *klass,
+    GList *blueprints);
+
+static void
+fs_rtp_dtmf_event_source_class_init (FsRtpDtmfEventSourceClass *klass)
+{
+  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+  FsRtpSpecialSourceClass *spsource_class = FS_RTP_SPECIAL_SOURCE_CLASS (klass);
+  parent_class = fs_rtp_dtmf_event_source_parent_class;
+
+  gobject_class->dispose = fs_rtp_dtmf_event_source_dispose;
+
+  spsource_class->new = fs_rtp_dtmf_event_source_new;
+  spsource_class->want_source = fs_rtp_dtmf_event_source_class_want_source;
+  spsource_class->add_blueprint = fs_rtp_dtmf_event_source_class_add_blueprint;
+
+}
+
+
+static void
+fs_rtp_dtmf_event_source_init (FsRtpDtmfEventSource *self)
+{
+  self->priv = FS_RTP_DTMF_EVENT_SOURCE_GET_PRIVATE (self);
+  self->priv->disposed = FALSE;
+}
+
+static void
+fs_rtp_dtmf_event_source_dispose (GObject *object)
+{
+  FsRtpDtmfEventSource *self = FS_RTP_DTMF_EVENT_SOURCE (object);
+
+  if (self->priv->disposed)
+    return;
+
+  self->priv->disposed = TRUE;
+  G_OBJECT_CLASS (fs_rtp_dtmf_event_source_parent_class)->dispose (object);
+}
+
+
+static GList*
+fs_rtp_dtmf_event_source_class_add_blueprint (FsRtpSpecialSourceClass *klass,
+    GList *blueprints)
+{
+  return blueprints;
+}
+
+static gboolean
+fs_rtp_dtmf_event_source_class_want_source (FsRtpSpecialSourceClass *klass,
+    GList *negotiated_sources)
+{
+  return FALSE;
+}
+
+
+static gboolean
+fs_rtp_dtmf_event_source_build (FsRtpDtmfEventSource *source,
+    GList *negotiated_sources,
+    GError **error)
+{
+  return FALSE;
+}
+
+static FsRtpSpecialSource *
+fs_rtp_dtmf_event_source_new (FsRtpSpecialSourceClass *klass,
+    GList *negotiated_sources,
+    GstElement *bin,
+    GstElement *rtpmuxer,
+    GError **error)
+{
+  FsRtpDtmfEventSource *source = NULL;
+
+  source = g_object_new (FS_TYPE_RTP_DTMF_EVENT_SOURCE,
+      "bin", bin,
+      "rtpmuxer", rtpmuxer,
+      NULL);
+  g_assert (source);
+
+  if (!fs_rtp_dtmf_event_source_build (source, negotiated_sources, error))
+  {
+    g_object_unref (source);
+    return NULL;
+  }
+
+  return FS_RTP_SPECIAL_SOURCE_CAST (source);
+}
diff --git a/gst/fsrtpconference/fs-rtp-dtmf-event-source.h b/gst/fsrtpconference/fs-rtp-dtmf-event-source.h
new file mode 100644
index 0000000..675bd23
--- /dev/null
+++ b/gst/fsrtpconference/fs-rtp-dtmf-event-source.h
@@ -0,0 +1,74 @@
+/*
+ * Farsight2 - Farsight RTP DTMF Event Source
+ *
+ * Copyright 2007 Collabora Ltd.
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk>
+ * Copyright 2007 Nokia Corp.
+ *
+ * fs-rtp-dtmf-event-source.h - A Farsight RTP Event Source gobject
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+
+#ifndef __FS_RTP_DTMF_EVENT_SOURCE_H__
+#define __FS_RTP_DTMF_EVENT_SOURCE_H__
+
+#include "fs-rtp-special-source.h"
+
+G_BEGIN_DECLS
+
+/* TYPE MACROS */
+#define FS_TYPE_RTP_DTMF_EVENT_SOURCE \
+  (fs_rtp_dtmf_event_source_get_type())
+#define FS_RTP_DTMF_EVENT_SOURCE(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), FS_TYPE_RTP_DTMF_EVENT_SOURCE, \
+      FsRtpDtmfEventSource))
+#define FS_RTP_DTMF_EVENT_SOURCE_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), FS_TYPE_RTP_DTMF_EVENT_SOURCE, \
+     FsRtpDtmfEventSourceClass))
+#define FS_IS_RTP_DTMF_EVENT_SOURCE(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), FS_TYPE_RTP_DTMF_EVENT_SOURCE))
+#define FS_IS_RTP_DTMF_EVENT_SOURCE_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), FS_TYPE_RTP_DTMF_EVENT_SOURCE))
+#define FS_RTP_DTMF_EVENT_SOURCE_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), FS_TYPE_RTP_DTMF_EVENT_SOURCE,   \
+    FsRtpDtmfEventSourceClass))
+#define FS_RTP_DTMF_EVENT_SOURCE_CAST(obj) ((FsRtpDtmfEventSource*) (obj))
+
+typedef struct _FsRtpDtmfEventSource FsRtpDtmfEventSource;
+typedef struct _FsRtpDtmfEventSourceClass FsRtpDtmfEventSourceClass;
+typedef struct _FsRtpDtmfEventSourcePrivate FsRtpDtmfEventSourcePrivate;
+
+struct _FsRtpDtmfEventSourceClass
+{
+  FsRtpSpecialSourceClass parent_class;
+};
+
+/**
+ * FsRtpDtmfEventSource:
+ *
+ */
+struct _FsRtpDtmfEventSource
+{
+  FsRtpSpecialSource parent;
+  FsRtpDtmfEventSourcePrivate *priv;
+};
+
+GType fs_rtp_dtmf_event_source_get_type (void);
+
+G_END_DECLS
+
+#endif /* __FS_RTP_DTMF_EVENT_SOURCE_H__ */
diff --git a/gst/fsrtpconference/fs-rtp-special-source.c b/gst/fsrtpconference/fs-rtp-special-source.c
index a3bad19..3a4e7ed 100644
--- a/gst/fsrtpconference/fs-rtp-special-source.c
+++ b/gst/fsrtpconference/fs-rtp-special-source.c
@@ -5,7 +5,7 @@
  *  @author: Olivier Crete <olivier.crete at collabora.co.uk>
  * Copyright 2007 Nokia Corp.
  *
- * fs-rtp-substream.c - A Farsight RTP Substream gobject
+ * fs-rtp-special-source.c - A Farsight RTP Special Source gobject
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -31,6 +31,8 @@
 
 #include "fs-rtp-special-source.h"
 
+#include "fs-rtp-dtmf-event-source.h"
+
 #define GST_CAT_DEFAULT fsrtpconference_debug
 
 /**
@@ -42,9 +44,6 @@
  *
  */
 
-
-#define DEFAULT_NO_RTCP_TIMEOUT (7000)
-
 struct _FsRtpSpecialSourcePrivate {
   gboolean disposed;
 };
@@ -82,7 +81,8 @@ fs_rtp_special_source_class_init (FsRtpSpecialSourceClass *klass)
 
   if (!classes)
   {
-    //classes = g_list_prepend (classes, g_type_ref_class(GTYPE1));
+    classes = g_list_prepend (classes,
+        g_type_class_ref (FS_TYPE_RTP_DTMF_EVENT_SOURCE));
   }
 }
 
diff --git a/gst/fsrtpconference/fs-rtp-special-source.h b/gst/fsrtpconference/fs-rtp-special-source.h
index 7ef7a13..07d058d 100644
--- a/gst/fsrtpconference/fs-rtp-special-source.h
+++ b/gst/fsrtpconference/fs-rtp-special-source.h
@@ -5,7 +5,7 @@
  *  @author: Olivier Crete <olivier.crete at collabora.co.uk>
  * Copyright 2007 Nokia Corp.
  *
- * fs-rtp-substream.h - A Farsight RTP Substream gobject
+ * fs-rtp-special-source.h - A Farsight RTP Special Source gobject
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
-- 
1.5.6.5




More information about the farsight-commits mailing list