【问题标题】:How to use c++ module in gstreamer plugin?如何在 gstreamer 插件中使用 c++ 模块?
【发布时间】:2016-11-02 17:31:21
【问题描述】:

我需要将用 C++ 编写的算法包含到我的 gstreamer 插件中。 我创建了 algorithm.h 文件,其中包含

extern "C" int myFunction( );

和实现此功能的算法 algorithm.cpp 文件。 现在,在我构建并安装了包含 algorithm.h 文件并调用 myFunction() 的插件之后,我尝试使用我的元素运行测试管道,这导致错误告诉我没有 myFunction 对象。

我想这与不将带有 myFunction 的对象模块包含到插件的二进制文件中有关。因此我的问题是:

如何正确使用我的 c++ 模块和我的插件?

【问题讨论】:

    标签: c++ c plugins gstreamer libraries


    【解决方案1】:

    通过使用本教程,我设法在我的插件中使用了我的 c++ 模块:link

    我还需要在 configure.ac 文件中包含一些标志。

    17 dnl enable mainainer mode by default
    18 AM_MAINTAINER_MODE([enable])
    19 
    20 dnl check for tools (compiler etc.)
    21 AC_PROG_CC
    22 AC_PROG_CXX         // <-- 22, 23 lines were included.
    23 AC_PROG_LIBTOOL     // <-- |
    24 
    25 dnl required version of libtool
    26 LT_PREREQ([2.2.6])
    27 LT_INIT
    

    这让我可以从我的插件代码编译和运行我的 c++ 函数。 但是,如果我尝试在我的 c++ 代码中包含头文件,我仍然会遇到问题。问题是这个模块编译时没有gstreamer的依赖,不知道怎么正确设置。

    【讨论】:

      猜你喜欢
      • 2017-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-01-23
      • 2012-01-11
      相关资源
      最近更新 更多