help with definition of "gst_object_get_type()"
jojo
rjiejie at gmail.com
Wed Jun 27 03:54:05 PDT 2012
Hi, all,
version:
gstreamer : 0.10.36
gst-plugins-base: 0.10.16
gst-plugins-good: 0.10.31
according to the source code above, i just find the macro template as bellow, and i can not find anything to define the "gst_object_get_type()",
someone know about where does the api is defined ?
thanks .
#define GST_BOILERPLATE_FULL(type, type_as_function, parent_type, parent_type_macro, additional_initializations) \
\
static void type_as_function ## _base_init (gpointer g_class); \
static void type_as_function ## _class_init (type ## Class *g_class);\
static void type_as_function ## _init (type *object, \
type ## Class *g_class);\
static parent_type ## Class *parent_class = NULL; \
static void \
type_as_function ## _class_init_trampoline (gpointer g_class) \
{ \
parent_class = (parent_type ## Class *) \
g_type_class_peek_parent (g_class); \
type_as_function ## _class_init ((type ## Class *)g_class); \
} \
\
GType \
type_as_function ## _get_type (void) \
{ \
/* The typedef for GType may be gulong or gsize, depending on the \
* system and whether the compiler is c++ or not. The g_once_init_* \
* functions always take a gsize * though ... */ \
static volatile gsize gonce_data = 0; \
if (g_once_init_enter (&gonce_data)) { \
GType _type; \
_type = gst_type_register_static_full (parent_type_macro, \
g_intern_static_string (#type), \
sizeof (type ## Class), \
type_as_function ## _base_init, \
NULL, /* base_finalize */ \
(GClassInitFunc) type_as_function ## _class_init_trampoline, \
NULL, /* class_finalize */ \
NULL, /* class_data */ \
sizeof (type), \
0, /* n_preallocs */ \
(GInstanceInitFunc) type_as_function ## _init, \
NULL, \
(GTypeFlags) 0); \
additional_initializations (_type); \
g_once_init_leave (&gonce_data, (gsize) _type); \
} \
return (GType) gonce_data; \
}
B.R.
-- jojo
More information about the gstreamer-devel
mailing list