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并通过MacPorts安装了GStreamer,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?
strong> EDIT:SOLVED!
SOLVED!
问题是我需要从gst-plugins-good包安装autodetect插件。
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 port uninstall 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-plugins-base和gstreamer-plugins-好的资源。
Download gstreamer, gstreamer-plugins-base and gstreamer-plugins-good sources.
建立并安装gstreamer(./configure,make,make install)
Build and install gstreamer (./configure, make, make install)
建立并安装gstreamer-plugins-base(./configure,make ,make install)
Build and install gstreamer-plugins-base (./configure, make, make install)
并且对于gstreamer-plugins-good我只是构建了autodetect包,因为构建所有导致错误的一些插件,我不需要或关心现在。我这样做:
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 version 0.10.25)第463行( gst_element_factory_make
函数定义),有三个错误导致 NULL
return:
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
- 找不到命名的元素工厂(函数
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
)
代码执行实质性日志记录,
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-register
来注册它。
If this doesn't return a result, try using gst-register
to register it.
这篇关于GStreamer gst_element_factory_make失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!