Gstreamer在Linux上运行良好

因为我目前正在为我的项目制作gstreamer绑定并获得信息,gstreamer-sharp 0.99.x只能使用glib-sharp 2.99.x,我认为创建一个测试项目是一个好主意。 所以我下载了名为“GTK#3简单项目模板”的monodevelop插件并编译了它 – >工作。 现在我添加了之前编译的gstreamer-sharp 0.99 dll并添加了以下代码:

Gst.Application.Init(); Element music = Parse.Launch("playbin uri=\"file:////media/Auslagerung/DJ/IDs/android.mp3\""); music.SetState(Gst.State.Playing); 

当我播放此代码时,我得到以下exception:

 Marshaling clicked signal Exception in Gtk# callback delegate Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: An exception was thrown by the type initializer for Gst.Pipeline ---> System.DllNotFoundException: libgstreamersharpglue-1.0.0.dll at (wrapper managed-to-native) Gst.Pipeline:gstsharp_gst_pipeline_get_fixed_clock_offset () at Gst.Pipeline..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:537 --- End of inner exception stack trace --- at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00013] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:543 at System.Reflection.MonoCMethod.DoInvoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x000a5] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:528 at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:556 at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture, System.Object[] activationAttributes) [0x00174] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System/Activator.cs:301 at System.Activator.CreateInstance (System.Type type, BindingFlags bindingAttr, System.Reflection.Binder binder, System.Object[] args, System.Globalization.CultureInfo culture) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System/Activator.cs:238 at GLib.ObjectManager.CreateObject (IntPtr raw) [0x00000] in :0 at GLib.Object.GetObject (IntPtr o, Boolean owned_ref) [0x00000] in :0 at GLib.Object.GetObject (IntPtr o) [0x00000] in :0 at Gst.Parse.Launch (System.String pipeline_description) [0x00000] in :0 at MainWindow.onButtonClick (System.Object sender, System.EventArgs a) [0x00039] in /media/Auslagerung/tmp/Gtk3-Sharp-Test/Gtk3-Sharp-Test/MainWindow.cs:25 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00054] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:230 --- End of inner exception stack trace --- at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00069] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:238 at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MethodBase.cs:114 at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x000cf] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System/Delegate.cs:424 at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x00018] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System/MulticastDelegate.cs:70 at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System/Delegate.cs:398 at GLib.Signal.ClosureInvokedCB (System.Object o, GLib.ClosureInvokedArgs args) [0x00000] in :0 at GLib.SignalClosure.Invoke (GLib.ClosureInvokedArgs args) [0x00000] in :0 at GLib.SignalClosure.MarshalCallback (IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) [0x00000] in :0 at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal) at GLib.SignalClosure.MarshalCallback(IntPtr raw_closure, IntPtr return_val, UInt32 n_param_vals, IntPtr param_values, IntPtr invocation_hint, IntPtr marshal_data) at Gtk.Application.gtk_main() at Gtk.Application.Run() at Gtk3SharpTest.MainClass.Main(System.String[] args) in /media/Auslagerung/tmp/Gtk3-Sharp-Test/Gtk3-Sharp-Test/Program.cs:line 14 Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for Gst.Pipeline ---> System.DllNotFoundException: libgstreamersharpglue-1.0.0.dll at (wrapper managed-to-native) Gst.Pipeline:gstsharp_gst_pipeline_get_fixed_clock_offset () at Gst.Pipeline..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:537 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Gst.Pipeline ---> System.DllNotFoundException: libgstreamersharpglue-1.0.0.dll at (wrapper managed-to-native) Gst.Pipeline:gstsharp_gst_pipeline_get_fixed_clock_offset () at Gst.Pipeline..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&) at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /builddir/build/BUILD/mono-3.4.0/mcs/class/corlib/System.Reflection/MonoMethod.cs:537 

任何人都可以帮助我,在哪里可以找到DLL? 或者我在建筑中错过了哪些东西?!

提前致谢。

您的Output目录中没有libgstreamerglue-1.0.0。

libgstreamersharpglue.so位于目前为止ldconfig未知的目录中。

我正在使用ubuntu 15.04。 打开命令行并执行以下操作:

ldconfig -p | grep libgstreamersharpglue – >没有输出意味着它不在ldconfig的缓存中

找到gstreamer | grep glue(确保已经完成了sudo updatedb) – >如果这不产生输出你没有安装所有需要的包

如果文件位于系统的某个位置,它将位于结果列表中:

对我来说是/usr/lib/cli/gstreamer-sharp-0.9/libgstreamersharpglue-0.10.so

您需要使用/usr/lib/cli/gstreamer-sharp-0.9目录来使用ldconfig。

或者:将目录直接添加到/etc/ld.so.conf中

或者:删除/etc/ld.so.conf.d中的.conf文件,并将该目录添加到该文件中

在我的系统上我做了后者:/etc/ld.so.conf.d/cli.conf

其中有两条记录/ usr / lib / cli

/usr/lib/cli/gstreamer-sharp-0.9

现在重建ldconfig的缓存

sudo ldconfig

测试它是否成功:

ldconfig -p | grep gstreamersharpglue – >你应该得到这个输出

重试运行您的应用程序