添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
登录

无法编译基于GstPlugin生成的样板

内容来源于 Stack Overflow,遵循 CC BY-SA 4.0 许可协议进行翻译与使用。IT领域专用引擎提供翻译支持

腾讯云小微IT领域专用引擎提供翻译支持

原文
vincent911001 修改于2020-03-26
  • 该问题已被编辑
  • 提问者: vincent911001
  • 提问时间: 2020-03-26 07:19

在为我的示例插件构建样板时,我遵循了 Gst插件开发基础 中可用的说明,在本例中是HelloWorld。

我通过在克隆的回购中调用make_element工具创建了示例插件

../tools/make_element HelloWorld

之后,我修改了gst-plugin目录中的meson.build,以包含生成的源文件,即gsthelloworld.h和gsthelloworld.c。

helloworld_sources = [
  'src/gsthelloworld.c'
gsthelloworld = library('gsthelloworld',
  helloworld_sources,
  c_args: plugin_c_args,
  dependencies : [gst_dep],
  install : true,
  install_dir : plugins_install_dir,
)

我在执行 meson build && ninja -C build 后遇到了错误

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_HELLOWORLD 的声明。

查看 Gst插件开发基础 中的教程,我发现有一个宏声明遵循类似的命名约定,我的是 HelloWorld ,而提供的示例是 MyFilter

#define GST_MY_FILTER(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MY_FILTER,GstMyFilter))

但是,我在生成的源文件中没有看到任何宏。因此,我猜它可能是作为gstplugin.c和gstplugin.h提供的模板编写的,与生成的源文件非常相似,如果我从构建文件中删除我的示例插件,就可以成功地编译它。

因此,我是否错过了与汇编相关的任何步骤?谢谢。

编辑:我是用Ubuntu18.04(GStreer1.14.5)在PC上这样做的。

浏览 10 关注 0 得票数 0
  • 得票数为Stack Overflow原文数据
原文

3 个回答

回答于2020-11-14
得票数 1

我将其与一个工作插件进行了比较,对 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))
回答于2021-03-11
得票数 2

在……里面

    #define GST_TYPE_HELLOWORLD (gst_my_filter_get_type())
G_DECLARE_FINAL_TYPE (GstHelloWorld, gst_hello_world,
    GST, PLUGIN_TEMPLATE, GstElement)

PLUGIN_TEMPLATE 替换为 HELLOWORLD

回答于2022-11-22
得票数 0

为我工作的是:

#ifndef __GST_MYFILTER_H__
#define __GST_MYFILTER_H__
#include <gst/gst.h>
G_BEGIN_DECLS
/* #defines don't like whitespacey bits */
#define GST_TYPE_MYFILTER \
  (gst_my_filter_get_type())
#define GST_MYFILTER(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MYFILTER,GstMyFilter))
#define GST_MYFILTER_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MYFILTER,GstMyFilterClass))
#define GST_IS_MYFILTER(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MYFILTER))
#define GST_IS_MYFILTER_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MYFILTER))
typedef struct _GstMyFilter      GstMyFilter;
typedef struct _GstMyFilterClass GstMyFilterClass;
struct _GstMyFilter
  GstElement element;
  GstPad *sinkpad, *srcpad;
  gboolean silent;
struct _GstMyFilterClass 
  GstElementClass parent_class;