summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2010-07-23 15:34:51 +0200
committerEdward Hervey <bilboed@bilboed.com>2010-07-23 15:34:51 +0200
commit2bef33d711afac5e4719d2c1648531709578faee (patch)
tree6aafe818e1b3ffbfdce9d5d897802b6344bc5d78
parent60b14e7002c0fcf1acd7ed4ef9aa4e714394209f (diff)
gnlsource: Use G_TYPE private instances
This ensures the private data is 'closer' to the public structures
-rw-r--r--gnl/gnlsource.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/gnl/gnlsource.c b/gnl/gnlsource.c
index 93c2341..fc1fb0f 100644
--- a/gnl/gnlsource.c
+++ b/gnl/gnlsource.c
@@ -68,7 +68,6 @@ static gboolean gnl_source_add_element (GstBin * bin, GstElement * element);
static gboolean gnl_source_remove_element (GstBin * bin, GstElement * element);
static void gnl_source_dispose (GObject * object);
-static void gnl_source_finalize (GObject * object);
static gboolean gnl_source_send_event (GstElement * element, GstEvent * event);
@@ -104,6 +103,8 @@ gnl_source_class_init (GnlSourceClass * klass)
gstbin_class = (GstBinClass *) klass;
gnlobject_class = (GnlObjectClass *) klass;
+ g_type_class_add_private (klass, sizeof (GnlSourcePrivate));
+
parent_class = g_type_class_ref (GNL_TYPE_OBJECT);
GST_DEBUG_CATEGORY_INIT (gnlsource, "gnlsource",
@@ -121,7 +122,6 @@ gnl_source_class_init (GnlSourceClass * klass)
gstelement_class->change_state = GST_DEBUG_FUNCPTR (gnl_source_change_state);
gobject_class->dispose = GST_DEBUG_FUNCPTR (gnl_source_dispose);
- gobject_class->finalize = GST_DEBUG_FUNCPTR (gnl_source_finalize);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gnl_source_src_template));
@@ -134,7 +134,8 @@ gnl_source_init (GnlSource * source, GnlSourceClass * klass G_GNUC_UNUSED)
{
GST_OBJECT_FLAG_SET (source, GNL_OBJECT_SOURCE);
source->element = NULL;
- source->priv = g_new0 (GnlSourcePrivate, 1);
+ source->priv =
+ G_TYPE_INSTANCE_GET_PRIVATE (source, GNL_TYPE_SOURCE, GnlSourcePrivate);
if (g_object_class_find_property (G_OBJECT_CLASS (parent_class),
"async-handling")) {
@@ -174,18 +175,6 @@ gnl_source_dispose (GObject * object)
G_OBJECT_CLASS (parent_class)->dispose (object);
}
-static void
-gnl_source_finalize (GObject * object)
-{
- GnlSource *source = (GnlSource *) object;
-
- GST_DEBUG_OBJECT (object, "finalize");
-
- g_free (source->priv);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
static gboolean
gnl_source_prepare (GnlObject * object)
{