gstreamer初探--代码分析之一

本文介绍了GStreamer中GST_BOILERPLATE宏的使用,通过展开宏展示了如何为GstUDPSrc进行类型注册。文章以gstudpsrc.c为例,详细解释了gst_type_register_static_full函数及其在GObject对象系统中的作用。内容涵盖了类初始化、实例初始化等关键步骤,揭示了GStreamer与GLib库之间的紧密关系。
摘要由CSDN通过智能技术生成

一、比较重要的宏定义:

 

 以下宏定义 在 gstutils.h文件中。

 

#define GST_BOILERPLATE(type,type_as_function,parent_type,parent_type_macro)\

  GST_BOILERPLATE_FULL (type,type_as_function, parent_type, parent_type_macro, \

      __GST_DO_NOTHING)

 

#define GST_BOILERPLATE_FULL(type,type_as_function, parent_type, parent_type_macro, additional_initializations) \

         \

static voidtype_as_function ## _base_init    (gpointer      g_class); \

static voidtype_as_function ## _class_init    (type## Class *g_class);\

static voidtype_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);  \

}        

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值