简体   繁体   English

在Ubuntu 14.04上的Mono中使用GStreamer

[英]Using GStreamer in Mono on Ubuntu 14.04

I want to use GStreamer for sound effects and music in a game. 我想将GStreamer用于游戏中的声音效果和音乐。

Installed GStreamer from this PPA: https://launchpad.net/~ddalex/+archive/ubuntu/gstreamer 从此PPA安装了GStreamer: https//launchpad.net/~ddalex/+archive/ubuntu/gstreamer

And also tried installing GStreamer this way, after installing it from the PPA did not appear to work: https://askubuntu.com/questions/279509/how-can-i-install-gstreamer-1-0-in-ubuntu-12-04 并且还尝试了以这种方式安装GStreamer,但从PPA安装GStreamer似乎没有用: https : //askubuntu.com/questions/279509/how-can-i-install-gstreamer-1-0-in-ubuntu- 12-04

However, both times GStreamer installed correctly as far as I could tell, and yet it will not show up under references in MonoDevelop. 但是,据我所知,两次GStreamer均已正确安装,但在MonoDevelop的引用中不会显示。

Is it possible that I have misunderstood how to use GStreamer in MonoDevelop? 我是否有可能误解了如何在MonoDevelop中使用GStreamer?

EDIT: I have since downloaded GStreamer sharp: https://gstreamer.freedesktop.org/modules/gstreamer-sharp.html 编辑:此后,我已经下载了GStreamer Sharp: https : //gstreamer.freedesktop.org/modules/gstreamer-sharp.html

But I don't understand how to use it, any help? 但是我不知道如何使用它,有帮助吗?

EDIT: To clarify, my operating system is Ubuntu 14.04 编辑:澄清一下,我的操作系统是Ubuntu 14.04

EDIT: I thought the the problem was solved. 编辑:我认为问题已解决。

Using apt-cache search 'gstreamer' I found and installed the library libgstreamer0.10-cil-dev, now GStreamer shows up in MonoDevelop! 我使用apt-cache搜索'gstreamer'找到并安装了库libgstreamer0.10-cil-dev,现在GStreamer出现在MonoDevelop中了!

However, while GStreamer now shows up in references, when I tried to compile a test program done in C# but based on the official GStreamer SDK tutorial. 但是,尽管GStreamer现在显示在引用中,但是当我尝试编译以C#完成但基于官方GStreamer SDK教程的测试程序时。

The test program: 测试程序:

Gst.Element pipeline;

    Gst.Application.Init ();

    pipeline = Gst.Parse.Launch("playbin2 uri=http://docs.gstreamer.com/media/sintel_trailer-480p.webm");
    pipeline.SetState(Gst.State.Playing);

I get this error: An exception was thrown by the type initializer for Gst.GLib.GType , under details it seems the problem is a missing library: System.TypeInitializationException: An exception was thrown by the type initializer for Gst.GLib.GType ---> System.Exception: libgstreamersharpglue-0.10.so 我收到此错误: An exception was thrown by the type initializer for Gst.GLib.GType ,在详细信息下,似乎是缺少了一个库: System.TypeInitializationException: An exception was thrown by the type initializer for Gst.GLib.GType ---> System.Exception: libgstreamersharpglue-0.10.so

Thanks to otopolsky for their help in getting this far! 感谢otopolsky为他们提供的帮助! And thanks in advance for any further help. 在此先感谢您的进一步帮助。

Update: The problem appears to be solved now, see the answer below for the solution. 更新:该问题现在似乎已解决,请参阅以下答案以获取解决方案。

I solved the problem! 我解决了问题!

Using apt-cache search 'gstreamer' I found and installed the library libgstreamer0.10-cil-dev , now GStreamer shows up in MonoDevelop! 我使用apt-cache search 'gstreamer'找到并安装了库libgstreamer0.10-cil-dev ,现在GStreamer出现在MonoDevelop中了!

Thanks to otopolsky for their help. 感谢otopolsky的帮助。

EDIT: See the question above, I thought the problem was solved but another problem arose. 编辑:看到上面的问题,我以为问题已解决,但又出现了另一个问题。

Update: The problem is solved! 更新:问题已解决! It turns out that the library libgstreamersharpglue was not in a directory known to ldconfig. 事实证明,库libgstreamersharpglue不在ldconfig已知的目录中。 Eventually I found this answer that explained how to have ldconfig use this directory: https://stackoverflow.com/a/32330648/5870433 最终我找到了这个答案,解释了如何使ldconfig使用此目录: https : //stackoverflow.com/a/32330648/5870433

Also of help was this site explaining how to add a library to ldconfig cache: https://codeyarns.com/2014/01/14/how-to-add-library-directory-to-ldconfig-cache/ 该站点还解释了如何向ldconfig缓存添加库,这也对我们有所帮助: https : //codeyarns.com/2014/01/14/how-to-add-library-directory-to-ldconfig-cache/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM