In the source code of gstreamer, we can see the definition of the stst_boilerplate_full macro. In this macro, we originally defined the prototype of the functions _ base_init, _ init, _ class_init, no wonder we don't need to define these function prototypes in the source code, and the most important thing in this macro is to show which class our plugin inherits (depending on the content of gobject ), in addition, the most important thing about this macro is to call the function stst_type_register_static_full to register all the content such as _ base_init, _ init, and interface into gstreamer.
OK. In the definition of this macro, we can see the # code. What does this mean? This actually represents the connection string, which is very special. For example:
# Define maid (type, type_as_function, parent_type, parent_type_macro, additional_initializations )\
\
Static void type_as_function # _ base_init (gpointer g_class );\
......
.....
....
Here, type_as_function is the second parameter that we pass in the stst_boilerplate_full parameter. For example, if it is st_passthrough, static void type_as_function # _ base_init is changed to static void st_passthrough_base, this is the declaration of the _ base_init function, amazing.