Chinaunix首页 | 论坛 | 博客
  • 博客访问: 834180
  • 博文数量: 244
  • 博客积分: 10000
  • 博客等级: 上将
  • 技术积分: 2420
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-29 09:07
文章分类

全部博文(244)

文章存档

2011年(4)

2010年(3)

2009年(72)

2008年(119)

2007年(46)

我的朋友

分类: LINUX

2008-06-02 11:32:54

比较重要的一个宏定义
#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,  \
         gpointer data)  \
{         \
  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);    \
         \
GType         \
type_as_function ## _get_type (void)     \
{         \
  static GType object_type = 0;      \
  if (G_UNLIKELY (object_type == 0)) {     \
    static const GTypeInfo object_info = {    \
      sizeof (type ## Class),      \
      type_as_function ## _base_init,     \
      NULL,    /* base_finalize */    \
      type_as_function ## _class_init_trampoline,   \
      NULL,    /* class_finalize */    \
      NULL,               /* class_data */    \
      sizeof (type),       \
      0,                  /* n_preallocs */    \
      (GInstanceInitFunc) type_as_function ## _init   \
    };         \
    object_type = g_type_register_static (parent_type_macro, #type, \
 &object_info, (GTypeFlags) 0);     \
    additional_initializations (object_type);    \
  }         \
  return object_type;       \
}
 
 
./gstreamer-0.10.x/plugins/elements/gstelements.c
static struct _elements_entry _elements[] = {
{"capsfilter", GST_RANK_NONE, gst_capsfilter_get_type},
...
{"filesrc", GST_RANK_PRIMARY, gst_file_src_get_type},
...
{"filesink", GST_RANK_PRIMARY, gst_file_sink_get_type},
{NULL, 0},
};
最基本的有些元件
阅读(1234) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~