[farsight2/master] Use GST_BOILERPLATE_WITH_INTERFACE

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


---
 gst-libs/gst/farsight/fs-base-conference.c  |   76 +++------------------------
 gst-libs/gst/farsight/fs-conference-iface.c |   10 ++--
 gst-libs/gst/farsight/fs-conference-iface.h |   10 ++--
 3 files changed, 18 insertions(+), 78 deletions(-)

diff --git a/gst-libs/gst/farsight/fs-base-conference.c b/gst-libs/gst/farsight/fs-base-conference.c
index ed44614..6f38d81 100644
--- a/gst-libs/gst/farsight/fs-base-conference.c
+++ b/gst-libs/gst/farsight/fs-base-conference.c
@@ -63,60 +63,10 @@ struct _FsBaseConferencePrivate
   GPtrArray *session_list;
 };
 
-static GstBinClass *parent_class = NULL;
-
-static void fs_base_conference_interface_init (gpointer g_iface,
-                                               gpointer iface_data);
-static void fs_base_conference_base_init (gpointer g_class);
-static void fs_base_conference_class_init (FsBaseConferenceClass *klass);
-static void fs_base_conference_init (FsBaseConference *conf,
-                                     FsBaseConferenceClass *klass);
-static void fs_base_conference_implements_interface_init (
-    GstImplementsInterfaceClass * klass);
-
-GType
-fs_base_conference_get_type (void)
-{
-  static GType base_conference_type = 0;
-
-  if (!base_conference_type) {
-    static const GTypeInfo base_conference_info = {
-      sizeof (FsBaseConferenceClass),
-      (GBaseInitFunc) fs_base_conference_base_init,
-      NULL,
-      (GClassInitFunc) fs_base_conference_class_init,
-      NULL,
-      NULL,
-      sizeof (FsBaseConference),
-      0,
-      (GInstanceInitFunc) fs_base_conference_init,
-    };
-
-    static const GInterfaceInfo iface_info = {
-      (GInterfaceInitFunc) fs_base_conference_implements_interface_init,
-      NULL,
-      NULL,
-    };
-
-    static const GInterfaceInfo conference_info = {
-      (GInterfaceInitFunc) fs_base_conference_interface_init,
-      NULL,
-      NULL,
-    };
-
-
-
-    base_conference_type = g_type_register_static (GST_TYPE_BIN,
-        "FsBaseConference", &base_conference_info, G_TYPE_FLAG_ABSTRACT);
-
-    g_type_add_interface_static (base_conference_type,
-                                 GST_TYPE_IMPLEMENTS_INTERFACE,
-                                 &iface_info);
-    g_type_add_interface_static (base_conference_type, FS_TYPE_CONFERENCE,
-                                 &conference_info);
-  }
-  return base_conference_type;
-}
+GST_BOILERPLATE_WITH_INTERFACE (
+    FsBaseConference, fs_base_conference,
+    GstBin, GST_TYPE_BIN,
+    FsConference, FS_TYPE_CONFERENCE, fs_conference);
 
 static void fs_base_conference_finalize (GObject *object);
 static void fs_base_conference_set_property (GObject *object, guint prop_id,
@@ -196,31 +146,21 @@ fs_base_conference_init (FsBaseConference *conf,
 }
 
 static void
-fs_base_conference_interface_init (gpointer g_iface,
-                                   gpointer iface_data)
+fs_conference_interface_init (FsConferenceClass *iface)
 {
-  FsConferenceInterface *iface = (FsConferenceInterface *)g_iface;
-
   iface->new_session = fs_base_conference_new_session;
   iface->new_participant = fs_base_conference_new_participant;
 }
 
 static gboolean
-fs_base_conference_interface_supported (GstImplementsInterface * iface,
-                                         GType type)
+fs_conference_supported (
+    FsBaseConference * self,
+    GType type)
 {
   g_assert (type == FS_TYPE_CONFERENCE);
   return TRUE;
 }
 
-static void
-fs_base_conference_implements_interface_init (
-    GstImplementsInterfaceClass * klass)
-{
-  klass->supported = fs_base_conference_interface_supported;
-}
-
-
 void _remove_session_ptr (FsBaseConference *conf, FsSession *session)
 {
   if (!g_ptr_array_remove (conf->priv->session_list, session))
diff --git a/gst-libs/gst/farsight/fs-conference-iface.c b/gst-libs/gst/farsight/fs-conference-iface.c
index 9750d15..eb2db94 100644
--- a/gst-libs/gst/farsight/fs-conference-iface.c
+++ b/gst-libs/gst/farsight/fs-conference-iface.c
@@ -42,7 +42,7 @@
  *
  */
 
-static void fs_conference_iface_init (FsConferenceInterface *iface);
+static void fs_conference_iface_init (FsConferenceClass *iface);
 
 GType
 fs_conference_get_type (void)
@@ -51,7 +51,7 @@ fs_conference_get_type (void)
 
   if (!fs_conference_type) {
     static const GTypeInfo fs_conference_info = {
-      sizeof (FsConferenceInterface),
+      sizeof (FsConferenceClass),
       (GBaseInitFunc) fs_conference_iface_init,
       NULL,
       NULL,
@@ -80,7 +80,7 @@ fs_error_quark (void)
 
 
 static void
-fs_conference_iface_init (FsConferenceInterface * iface)
+fs_conference_iface_init (FsConferenceClass * iface)
 {
   /* default virtual functions */
   iface->new_session = NULL;
@@ -102,7 +102,7 @@ FsSession *
 fs_conference_new_session (FsConference *conference, FsMediaType media_type,
                            GError **error)
 {
-  FsConferenceInterface *iface =
+  FsConferenceClass *iface =
       FS_CONFERENCE_GET_IFACE (conference);
 
   if (iface->new_session) {
@@ -129,7 +129,7 @@ FsParticipant *
 fs_conference_new_participant (FsConference *conference, gchar *cname,
     GError **error)
 {
-  FsConferenceInterface *iface =
+  FsConferenceClass *iface =
       FS_CONFERENCE_GET_IFACE (conference);
 
   if (iface->new_session) {
diff --git a/gst-libs/gst/farsight/fs-conference-iface.h b/gst-libs/gst/farsight/fs-conference-iface.h
index 1b6abbf..e853be5 100644
--- a/gst-libs/gst/farsight/fs-conference-iface.h
+++ b/gst-libs/gst/farsight/fs-conference-iface.h
@@ -41,7 +41,7 @@ G_BEGIN_DECLS
 #define FS_IS_CONFERENCE(obj) \
   (GST_IMPLEMENTS_INTERFACE_CHECK_INSTANCE_TYPE ((obj), FS_TYPE_CONFERENCE))
 #define FS_CONFERENCE_GET_IFACE(inst) \
-  (G_TYPE_INSTANCE_GET_INTERFACE ((inst), FS_TYPE_CONFERENCE, FsConferenceInterface))
+  (G_TYPE_INSTANCE_GET_INTERFACE ((inst), FS_TYPE_CONFERENCE, FsConferenceClass))
 
 /**
  * FsConference:
@@ -50,17 +50,17 @@ G_BEGIN_DECLS
  */
 typedef struct _FsConference FsConference;
 
-typedef struct _FsConferenceInterface FsConferenceInterface;
+typedef struct _FsConferenceClass FsConferenceClass;
 
 /**
- * FsConferenceInterface:
+ * FsConferenceClass:
  * @parent: parent interface type.
  * @new_session: virtual method to create a new conference session
  * @new_participant: virtual method to create a new participant
  *
- * #FsConferenceInterface interface.
+ * #FsConferenceClass interface.
  */
-struct _FsConferenceInterface {
+struct _FsConferenceClass {
   GTypeInterface parent;
 
   /* virtual functions */
-- 
1.5.6.5




More information about the farsight-commits mailing list