[farsight2/master] Use G_DEFINE_TYPE to define the various FsRtp* types
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:20:12 PST 2008
---
gst/fsrtpconference/fs-rtp-participant.c | 30 +++---------------------------
gst/fsrtpconference/fs-rtp-session.c | 29 ++---------------------------
gst/fsrtpconference/fs-rtp-stream.c | 30 +++---------------------------
3 files changed, 8 insertions(+), 81 deletions(-)
diff --git a/gst/fsrtpconference/fs-rtp-participant.c b/gst/fsrtpconference/fs-rtp-participant.c
index 4e5a0e8..3c456da 100644
--- a/gst/fsrtpconference/fs-rtp-participant.c
+++ b/gst/fsrtpconference/fs-rtp-participant.c
@@ -52,12 +52,13 @@ struct _FsRtpParticipantPrivate
gboolean disposed;
};
+
+G_DEFINE_TYPE(FsRtpParticipant, fs_rtp_participant, FS_TYPE_PARTICIPANT);
+
#define FS_RTP_PARTICIPANT_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_PARTICIPANT, \
FsRtpParticipantPrivate))
-static void fs_rtp_participant_class_init (FsRtpParticipantClass *klass);
-static void fs_rtp_participant_init (FsRtpParticipant *self);
static void fs_rtp_participant_dispose (GObject *object);
static void fs_rtp_participant_finalize (GObject *object);
@@ -73,31 +74,6 @@ static void fs_rtp_participant_set_property (GObject *object,
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 (FsRtpParticipantClass),
- 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 (FsRtpParticipantClass *klass)
{
diff --git a/gst/fsrtpconference/fs-rtp-session.c b/gst/fsrtpconference/fs-rtp-session.c
index 996d518..1581688 100644
--- a/gst/fsrtpconference/fs-rtp-session.c
+++ b/gst/fsrtpconference/fs-rtp-session.c
@@ -134,11 +134,11 @@ struct _FsRtpSessionPrivate
gboolean disposed;
};
+G_DEFINE_TYPE(FsRtpSession, fs_rtp_session, FS_TYPE_SESSION);
+
#define FS_RTP_SESSION_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_RTP_SESSION, FsRtpSessionPrivate))
-static void fs_rtp_session_class_init (FsRtpSessionClass *klass);
-static void fs_rtp_session_init (FsRtpSession *self);
static void fs_rtp_session_dispose (GObject *object);
static void fs_rtp_session_finalize (GObject *object);
@@ -188,31 +188,6 @@ static GObjectClass *parent_class = NULL;
//static guint signals[LAST_SIGNAL] = { 0 };
-GType
-fs_rtp_session_get_type (void)
-{
- static GType type = 0;
-
- if (type == 0) {
- static const GTypeInfo info = {
- sizeof (FsRtpSessionClass),
- NULL,
- NULL,
- (GClassInitFunc) fs_rtp_session_class_init,
- NULL,
- NULL,
- sizeof (FsRtpSession),
- 0,
- (GInstanceInitFunc) fs_rtp_session_init
- };
-
- type = g_type_register_static (FS_TYPE_SESSION,
- "FsRtpSession", &info, 0);
- }
-
- return type;
-}
-
static void
fs_rtp_session_class_init (FsRtpSessionClass *klass)
{
diff --git a/gst/fsrtpconference/fs-rtp-stream.c b/gst/fsrtpconference/fs-rtp-stream.c
index 93ee000..2b43c6b 100644
--- a/gst/fsrtpconference/fs-rtp-stream.c
+++ b/gst/fsrtpconference/fs-rtp-stream.c
@@ -79,11 +79,12 @@ struct _FsRtpStreamPrivate
gboolean disposed;
};
+
+G_DEFINE_TYPE(FsRtpStream, fs_rtp_stream, FS_TYPE_STREAM);
+
#define FS_RTP_STREAM_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), FS_TYPE_RTP_STREAM, FsRtpStreamPrivate))
-static void fs_rtp_stream_class_init (FsRtpStreamClass *klass);
-static void fs_rtp_stream_init (FsRtpStream *self);
static void fs_rtp_stream_dispose (GObject *object);
static void fs_rtp_stream_finalize (GObject *object);
@@ -135,31 +136,6 @@ static void fs_rtp_stream_transmitter_error (
static GObjectClass *parent_class = NULL;
// static guint signals[LAST_SIGNAL] = { 0 };
-GType
-fs_rtp_stream_get_type (void)
-{
- static GType type = 0;
-
- if (type == 0) {
- static const GTypeInfo info = {
- sizeof (FsRtpStreamClass),
- NULL,
- NULL,
- (GClassInitFunc) fs_rtp_stream_class_init,
- NULL,
- NULL,
- sizeof (FsRtpStream),
- 0,
- (GInstanceInitFunc) fs_rtp_stream_init
- };
-
- type = g_type_register_static (FS_TYPE_STREAM, "FsRtpStream", &info, 0);
- }
-
- return type;
-}
-
-
static void
fs_rtp_stream_class_init (FsRtpStreamClass *klass)
{
--
1.5.6.5
More information about the farsight-commits
mailing list