GStreamer的gst_element_factory_make失败 [英] GStreamer gst_element_factory_make fails
问题描述
我想了GStreamer的测试应用程序,但在运行时以下行失败:
I'm trying out a GStreamer test application, but at runtime the following line fails:
demuxer = gst_element_factory_make ("oggdemux", "ogg-demuxer"); // returns NULL
我使用的MacOSX和安装的GStreamer,通过MacPorts的libogg和Vorbis的工具。所以,我不明白为什么它会失败。
I am using MacOSX and installed GStreamer, libogg and vorbis-tools through MacPorts. So I don't see why it fails.
如何使工作有什么建议?
Any suggestions on how to make it work?
编辑:解决
问题是,我需要安装从GST-插件好的包自动检测插件。
The problem was that I needed to install the autodetect plugin from the gst-plugins-good package.
下面是这使它工作的操作列表:
Here's a list of actions that made it work:
删除的MacPorts安装:
Remove the MacPorts installation:
sudo的港口卸载的GStreamer
以下行添加到〜/ .profile文件
Add the following line to ~/.profile
export PKG_CONFIG_PATH=/opt/local/lib/pkgconfig:/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
下载的GStreamer,GStreamer的-插件基地和GStreamer的 - 插件 - 良好来源。
Download gstreamer, gstreamer-plugins-base and gstreamer-plugins-good sources.
编译并安装的GStreamer(的./configure,make,make install的)
Build and install gstreamer (./configure, make, make install)
编译并安装的GStreamer-插件基地(的./configure,make,make install的)
Build and install gstreamer-plugins-base (./configure, make, make install)
和对的GStreamer-plugins的好,我只内置自动检测包,因为建筑均导致错误行为我不需要或不关心现在的一些插件。我做这样的:
And for gstreamer-plugins-good I only built the autodetect package because building all resulted in errors for some plugins that I don't need or care about now. I did it like this:
./configure
cd gst/autodetect/
make
sudo make install
目前该方案建立并运行。我似乎没有然而,要得到任何音频输出:(但那是另一个问题。
Right now the program builds and runs. I don't seem to be getting any audio output however :( but that's another issue.
推荐答案
阅读 gstelementfactory.c
(GStreamer的版本0.10.25)线463( gst_element_factory_make
函数定义),有三个错误,这些错误会导致 NULL
回报:
Reading gstelementfactory.c
(GStreamer version 0.10.25) line 463 (gst_element_factory_make
function definition), there are three errors which cause a NULL
return:
- 第一个参数('factoryname')为
NULL
(在你的code显然OK) - 命名的元素工厂无法找到(函数
gst_element_factory_find
返回NULL
) - 元素实例不能创建(函数
gst_element_Factory_create
返回NULL
)
- The first argument ('factoryname') is
NULL
(obviously OK in your code) - The named element factory could not be found (the function
gst_element_factory_find
returnedNULL
) - The element instance could not created (the function
gst_element_Factory_create
returnedNULL
)
在code进行大量的记录,所以如果你能够把这个,那么你可能会得到进一步的提示为根本问题。
The code performs substantial logging so if you are able to turn this on then you may get further hints as to the underlying problem.
要检查oggdemux插件配置正确,请尝试运行:
To check that the oggdemux plugin is configured correctly, try running:
gst-inspect oggdemux
如果这不会返回结果,请尝试使用 GST-寄存器
进行注册。
If this doesn't return a result, try using gst-register
to register it.
这篇关于GStreamer的gst_element_factory_make失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!