[farsight2/master] Add empty implementation of FsRtpParticipant

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


---
 gst/fsrtpconference/Makefile.am          |   10 ++-
 gst/fsrtpconference/fs-rtp-conference.c  |    2 +
 gst/fsrtpconference/fs-rtp-participant.c |  168 ++++++++++++++++++++++++++++++
 gst/fsrtpconference/fs-rtp-participant.h |   80 ++++++++++++++
 4 files changed, 257 insertions(+), 3 deletions(-)
 create mode 100644 gst/fsrtpconference/fs-rtp-participant.c
 create mode 100644 gst/fsrtpconference/fs-rtp-participant.h

diff --git a/gst/fsrtpconference/Makefile.am b/gst/fsrtpconference/Makefile.am
index 771b8e8..20e8efc 100644
--- a/gst/fsrtpconference/Makefile.am
+++ b/gst/fsrtpconference/Makefile.am
@@ -1,8 +1,12 @@
 plugin_LTLIBRARIES = libfsrtpconference.la
 
-libfsrtpconference_la_SOURCES = fs-rtp-conference.c
-libfsrtpconference_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
+libfsrtpconference_la_SOURCES = \
+	fs-rtp-conference.c \
+	fs-rtp-participant.c
+libfsrtpconference_la_CFLAGS = $(FS2_PLUGINS_BASE_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS)
 libfsrtpconference_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
 libfsrtpconference_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS)
 
-noinst_HEADERS = fs-rtp-conference.h
+noinst_HEADERS = \
+	fs-rtp-conference.h \
+	fs-rtp-participant.h
diff --git a/gst/fsrtpconference/fs-rtp-conference.c b/gst/fsrtpconference/fs-rtp-conference.c
index d771b34..a366a6f 100644
--- a/gst/fsrtpconference/fs-rtp-conference.c
+++ b/gst/fsrtpconference/fs-rtp-conference.c
@@ -34,6 +34,7 @@
 #endif
 
 #include "fs-rtp-conference.h"
+#include "fs-rtp-participant.h"
 
 GST_DEBUG_CATEGORY_STATIC (fs_rtp_conference_debug);
 #define GST_CAT_DEFAULT fs_rtp_conference_debug
@@ -190,6 +191,7 @@ fs_rtp_conference_new_participant (FsBaseConference *conf,
 
   FsParticipant *new_participant = NULL;
 
+  new_participant = fs_rtp_participant_new (cname);
 
   return new_participant;
 }
diff --git a/gst/fsrtpconference/fs-rtp-participant.c b/gst/fsrtpconference/fs-rtp-participant.c
new file mode 100644
index 0000000..43fb893
--- /dev/null
+++ b/gst/fsrtpconference/fs-rtp-participant.c
@@ -0,0 +1,168 @@
+/*
+ * Farsight2 - Farsight RTP Participant
+ *
+ * Copyright 2007 Collabora Ltd.
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk>
+ * Copyright 2007 Nokia Corp.
+ *
+ * fs-rtp-participant.c - A RTP Farsight Participant gobject
+ *
+ * This program 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+/**
+ * SECTION:fs-rtp-participant
+ * @short_description: A RTP participant in a #FsRtpConference
+ *
+ * This object represents one participant or person in a conference
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "fs-rtp-participant.h"
+
+/* Signals */
+enum
+{
+  LAST_SIGNAL
+};
+
+/* props */
+enum
+{
+  PROP_0,
+};
+
+struct _FsParticipantPrivate
+{
+  gboolean disposed;
+};
+
+#define FS_RTP_PARTICIPANT_GET_PRIVATE(o)  \
+   (G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_PARTICIPANT, \
+   FsParticipantPrivate))
+
+static void fs_rtp_participant_class_init (FsParticipantClass *klass);
+static void fs_rtp_participant_init (FsParticipant *self);
+static void fs_rtp_participant_dispose (GObject *object);
+static void fs_rtp_participant_finalize (GObject *object);
+
+static void fs_rtp_participant_get_property (GObject *object,
+                                         guint prop_id,
+                                         GValue *value,
+                                         GParamSpec *pspec);
+static void fs_rtp_participant_set_property (GObject *object,
+                                         guint prop_id,
+                                         const GValue *value,
+                                         GParamSpec *pspec);
+
+static GObjectClass *parent_class = NULL;
+static guint signals[LAST_SIGNAL] = { 0 };
+
+GType
+fs_rtp_participant_get_type (void)
+{
+  static GType type = 0;
+
+  if (type == 0) {
+    static const GTypeInfo info = {
+      sizeof (FsParticipantClass),
+      NULL,
+      NULL,
+      (GClassInitFunc) fs_rtp_participant_class_init,
+      NULL,
+      NULL,
+      sizeof (FsRtpParticipant),
+      0,
+      (GInstanceInitFunc) fs_rtp_participant_init
+    };
+
+    type = g_type_register_static (FS_TYPE_PARTICIPANT,
+        "FsRtpParticipant", &info, 0);
+  }
+
+  return type;
+}
+
+static void
+fs_rtp_participant_class_init (FsParticipantClass *klass)
+{
+  GObjectClass *gobject_class;
+
+  gobject_class = (GObjectClass *) klass;
+  parent_class = g_type_class_peek_parent (klass);
+
+  gobject_class->set_property = fs_rtp_participant_set_property;
+  gobject_class->get_property = fs_rtp_participant_get_property;
+
+
+  gobject_class->dispose = fs_rtp_participant_dispose;
+  gobject_class->finalize = fs_rtp_participant_finalize;
+
+  g_type_class_add_private (klass, sizeof (FsParticipantPrivate));
+}
+
+static void
+fs_rtp_participant_init (FsParticipant *self)
+{
+  /* member init */
+  self->priv = FS_RTP_PARTICIPANT_GET_PRIVATE (self);
+  self->priv->disposed = FALSE;
+}
+
+static void
+fs_rtp_participant_dispose (GObject *object)
+{
+  FsParticipant *self = FS_RTP_PARTICIPANT (object);
+
+  if (self->priv->disposed) {
+    /* If dispose did already run, return. */
+    return;
+  }
+
+  /* Make sure dispose does not run twice. */
+  self->priv->disposed = TRUE;
+
+  parent_class->dispose (object);
+}
+
+static void
+fs_rtp_participant_finalize (GObject *object)
+{
+  parent_class->finalize (object);
+}
+
+static void
+fs_rtp_participant_get_property (GObject *object,
+                             guint prop_id,
+                             GValue *value,
+                             GParamSpec *pspec)
+{
+}
+
+static void
+fs_rtp_participant_set_property (GObject *object,
+                             guint prop_id,
+                             const GValue *value,
+                             GParamSpec *pspec)
+{
+}
+
+FsRtpParticipant *fs_rtp_participant_new (gchar *cname)
+{
+  return g_object_new (FS_TYPE_RTP_PARTICIPANT, "cname", cname, NULL);
+}
diff --git a/gst/fsrtpconference/fs-rtp-participant.h b/gst/fsrtpconference/fs-rtp-participant.h
new file mode 100644
index 0000000..9939299
--- /dev/null
+++ b/gst/fsrtpconference/fs-rtp-participant.h
@@ -0,0 +1,80 @@
+/*
+ * Farsight2 - Farsight RTP Participant
+ *
+ * Copyright 2007 Collabora Ltd.
+ *  @author: Olivier Crete <olivier.crete at collabora.co.uk>
+ * Copyright 2007 Nokia Corp.
+ *
+ * fs-rtp-participant.h - A Farsight RTP Participant gobject
+ *
+ * This program 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef __FS_RTP_PARTICIPANT_H__
+#define __FS_RTP_PARTICIPANT_H__
+
+#include <gst/farsight/fs-participant.h>
+
+G_BEGIN_DECLS
+
+/* TYPE MACROS */
+#define FS_TYPE_RTP_PARTICIPANT (fs_rtp_participant_get_type())
+#define FS_RTP_PARTICIPANT(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), FS_TYPE_RTP_PARTICIPANT, \
+                              FsRtpParticipant))
+#define FS_RTP_PARTICIPANT_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass), FS_TYPE_RTP_PARTICIPANT, \
+                           FsRtpParticipantClass))
+#define FS_IS_RTP_PARTICIPANT(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), FS_TYPE_RTP_PARTICIPANT))
+#define FS_IS_RTP_PARTICIPANT_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), FS_TYPE_RTP_PARTICIPANT))
+#define FS_RTP_PARTICIPANT_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), FS_TYPE_RTP_PARTICIPANT, \
+                              FsRtpParticipantClass))
+
+typedef struct _FsRtpParticipant FsRtpParticipant;
+typedef struct _FsRtpParticipantClass FsRtpParticipantClass;
+typedef struct _FsRtpParticipantPrivate FsRtpParticipantPrivate;
+
+struct _FsRtpParticipantClass
+{
+  FsParticipantClass parent_class;
+
+  /*virtual functions */
+
+  /*< private >*/
+  FsRtpParticipantPrivate *priv;
+};
+
+/**
+ * FsRtpParticipant:
+ *
+ */
+struct _FsRtpParticipant
+{
+  FsParticipant parent;
+  FsRtpParticipantPrivate *priv;
+
+  /*< private >*/
+};
+
+GType fs_rtp_participant_get_type (void);
+
+FsRtpParticipant *fs_rtp_participant_new (gchar *cname);
+
+G_END_DECLS
+
+#endif /* __FS_RTP_PARTICIPANT_H__ */
-- 
1.5.6.5




More information about the farsight-commits mailing list