Gstreamer 未能编译基于GstPlugin生成的样板文件
我按照中的说明为我的示例插件构建样板文件,在本例中为HelloWorld 我通过调用克隆repo中的make_元素工具创建了示例插件Gstreamer 未能编译基于GstPlugin生成的样板文件,gstreamer,glib,Gstreamer,Glib,我按照中的说明为我的示例插件构建样板文件,在本例中为HelloWorld 我通过调用克隆repo中的make_元素工具创建了示例插件 ../tools/make_element HelloWorld 之后,我修改了gst插件目录中的meson.build,以包含生成的源文件,即gsthelloworld.h和gsthelloworld.c 在执行介子构建和忍者-C构建之后,我遇到了错误: gst-template/build/../gst-plugin/src/gsthelloworld.c:
../tools/make_element HelloWorld
之后,我修改了gst插件目录中的meson.build,以包含生成的源文件,即gsthelloworld.h和gsthelloworld.c
在执行介子构建和忍者-C构建之后,我遇到了错误:
gst-template/build/../gst-plugin/src/gsthelloworld.c:184: undefined reference to `GST_HELLOWORLD'
**there are multiple lines of the same errors happen at different part of the source file.
在两个生成的源文件中,我似乎都找不到GST\u HELLOWORLD
的声明
查看中的教程,我看到有一个宏声明遵循类似的命名约定,我的命名约定为HelloWorld,而提供的示例为MyFilter
#define GST_MY_FILTER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MY_FILTER,GstMyFilter))
但是,我在生成的源文件中看不到任何宏。因此,我猜它可能是在其他地方编写的,因为以gstplugin.c和gstplugin.h的形式提供的模板看起来与生成的源文件非常相似,如果我从构建文件中删除示例插件,就可以成功编译
因此,我是否遗漏了与编译相关的任何步骤?
谢谢
编辑:
我是在一台装有Ubuntu 18.04(gstreamer 1.14.5)的PC上做这件事的。与一个正常工作的插件相比,我对gsthelloworld.h的修改对我来说很有效:
#define GST_TYPE_HELLOWORLD (gst_my_filter_get_type())
G_DECLARE_FINAL_TYPE (GstHelloWorld, gst_hello_world,
GST, PLUGIN_TEMPLATE, GstElement)
// You need to add this one below in your gsthelloworld.h
#define GST_HELLOWORLD(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_HELLOWORLD,GstHelloWorld))
在
用HELLOWORLD
#define GST_TYPE_HELLOWORLD (gst_my_filter_get_type())
G_DECLARE_FINAL_TYPE (GstHelloWorld, gst_hello_world,
GST, PLUGIN_TEMPLATE, GstElement)
// You need to add this one below in your gsthelloworld.h
#define GST_HELLOWORLD(obj) \
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_HELLOWORLD,GstHelloWorld))
#define GST_TYPE_HELLOWORLD (gst_my_filter_get_type())
G_DECLARE_FINAL_TYPE (GstHelloWorld, gst_hello_world,
GST, PLUGIN_TEMPLATE, GstElement)