From 730dd21ce5cb8173f7a4b9665f953b8eee69bdd1 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Fri, 27 Feb 2004 17:58:24 +0000 Subject: [PATCH] gst/gstdata.c (gst_data_get_type): New function, register Original commit message from CVS: * gst/gstdata.c (gst_data_get_type): New function, register GstData as a GBoxed type. * gst/gstdata.h (GST_TYPE_DATA): New macro --- ChangeLog | 7 +++++++ gst/gstdata.c | 12 ++++++++++++ gst/gstdata.h | 6 ++++++ 3 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index d1cf0f1bcb..e0a1d64d41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-02-27 Johan Dahlin + + * gst/gstdata.c (gst_data_get_type): New function, register + GstData as a GBoxed type. + + * gst/gstdata.h (GST_TYPE_DATA): New macro + 2004-02-27 Thomas Vander Stichele * Makefile.am: diff --git a/gst/gstdata.c b/gst/gstdata.c index 0e6fe6405f..eaa269166a 100644 --- a/gst/gstdata.c +++ b/gst/gstdata.c @@ -27,6 +27,18 @@ #include "gstdata_private.h" #include "gstinfo.h" +GType +gst_data_get_type (void) +{ + static GType type = 0; + + if (!type) + type = g_boxed_type_register_static ("GstData", + (GBoxedCopyFunc) gst_data_copy, + (GBoxedFreeFunc) gst_data_free); + return type; +} + /** * gst_data_init: * @data: a #GstData to initialize diff --git a/gst/gstdata.h b/gst/gstdata.h index 14d4b75a5d..a9e30509c5 100644 --- a/gst/gstdata.h +++ b/gst/gstdata.h @@ -41,6 +41,9 @@ G_BEGIN_DECLS #define GST_DATA_FLAG_SET(data,flag) G_STMT_START{ (GST_DATA_FLAGS(data) |= (1<<(flag))); }G_STMT_END #define GST_DATA_FLAG_UNSET(data,flag) G_STMT_START{ (GST_DATA_FLAGS(data) &= ~(1<<(flag))); }G_STMT_END +/* Macros for the GType */ +#define GST_TYPE_DATA (gst_data_get_type ()) + typedef struct _GstData GstData; typedef void (*GstDataFreeFunction) (GstData *data); @@ -96,6 +99,9 @@ GstData* gst_data_ref (GstData* data); GstData* gst_data_ref_by_count (GstData* data, gint count); void gst_data_unref (GstData* data); +/* GType for GstData */ +GType gst_data_get_type (void) G_GNUC_CONST; + G_END_DECLS #endif /* __GST_DATA_H__ */ -- 2.34.1