summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Crête <olivier.crete@collabora.co.uk>2010-06-30 19:13:10 (GMT)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-06-30 20:10:10 (GMT)
commit2f8dc27e291e5f0d0a43e0492272cb04737bf453 (patch)
tree596423db37add73de037702786ef83ca6f1293cb
parent3c06cabb0b185e4ebbee0de89e343509b1f20af3 (diff)
netbuffer: declare with G_DEFINE_TYPE for type safety
Fixes #623233.
-rw-r--r--gst-libs/gst/netbuffer/gstnetbuffer.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/gst-libs/gst/netbuffer/gstnetbuffer.c b/gst-libs/gst/netbuffer/gstnetbuffer.c
index 3d389f9..6328a76 100644
--- a/gst-libs/gst/netbuffer/gstnetbuffer.c
+++ b/gst-libs/gst/netbuffer/gstnetbuffer.c
@@ -34,51 +34,26 @@
#include "gstnetbuffer.h"
-static void gst_netbuffer_init (GTypeInstance * instance, gpointer g_class);
-static void gst_netbuffer_class_init (gpointer g_class, gpointer class_data);
static void gst_netbuffer_finalize (GstNetBuffer * nbuf);
static GstNetBuffer *gst_netbuffer_copy (GstNetBuffer * nbuf);
static GstBufferClass *parent_class;
-GType
-gst_netbuffer_get_type (void)
-{
- static GType _gst_netbuffer_type = 0;
-
- if (G_UNLIKELY (_gst_netbuffer_type == 0)) {
- static const GTypeInfo netbuffer_info = {
- sizeof (GstNetBufferClass),
- NULL,
- NULL,
- gst_netbuffer_class_init,
- NULL,
- NULL,
- sizeof (GstNetBuffer),
- 0,
- gst_netbuffer_init,
- NULL
- };
-
- _gst_netbuffer_type = g_type_register_static (GST_TYPE_BUFFER,
- "GstNetBuffer", &netbuffer_info, 0);
- }
- return _gst_netbuffer_type;
-}
+G_DEFINE_TYPE (GstNetBuffer, gst_netbuffer, GST_TYPE_BUFFER);
static void
-gst_netbuffer_class_init (gpointer g_class, gpointer class_data)
+gst_netbuffer_class_init (GstNetBufferClass * netbuffer_class)
{
- GstMiniObjectClass *mo_class = GST_MINI_OBJECT_CLASS (g_class);
+ GstMiniObjectClass *mo_class = GST_MINI_OBJECT_CLASS (netbuffer_class);
- parent_class = g_type_class_peek_parent (g_class);
+ parent_class = g_type_class_peek_parent (netbuffer_class);
mo_class->copy = (GstMiniObjectCopyFunction) gst_netbuffer_copy;
mo_class->finalize = (GstMiniObjectFinalizeFunction) gst_netbuffer_finalize;
}
static void
-gst_netbuffer_init (GTypeInstance * instance, gpointer g_class)
+gst_netbuffer_init (GstNetBuffer * instance)
{
}