【问题标题】:Create Null Instance in Gstreamer 0.10在 Gstreamer 0.10 中创建空实例
【发布时间】:2017-10-31 14:31:38
【问题描述】:

成功安装了 ossbuild GStreamer 来享受 Gstreamer for C#。

步骤总结如下:

  1. 下载 GStreamer-WinBuilds-GPL-x86-Beta04-0.10.7.msiGStreamer-WinBuilds-SDK-GPL-x86-Beta04-0.10.7.msi 来自https://code.google.com/p/ossbuild/downloads/list(或者您可以下载支持较少插件的 LGPL 许可证对)
  2. 然后安装前者,然后安装后者。
  3. 然后您可以在此处找到 gstreamer-sharp .NET 参考文件 gstreamer-sharp.dll

    C:\Program Files (x86)\OSSBuild\GStreamer\version_variable\sdk\bindings\dotnet\gstreamer-sharp.dll

  4. 需要在项目中添加另一个胶水文件 gstreamersharpglie-0.10.dll,并将其设置为 Copy Always 或 Copy if Newer 以使 gstreamer-sharp 在 Windows 中工作。 p>

但是当我尝试运行示例代码(使用 Gst;)时,它出现了异常。

var pipeline = new Gst.Pipeline();
//always have null instance here
var elementA = Gst.ElementFactory.Make("videotestsrc");
//exceptions happens
elementA["pattern"] = 18; 

【问题讨论】:

    标签: c# .net gstreamer


    【解决方案1】:
    //must have
    Gst.Application.Init();
    var pipeline = new Gst.Pipeline();
    //if don't have Gst.Application.Init(), it will always have null instance here
    var elementA = Gst.ElementFactory.Make("videotestsrc");
    //if no exceptions happens here then everything should be fine
    elementA["pattern"] = 18; 
    

    如果Gst.Application.Init(); 触发找不到python26.dll 的错误,通过安装python 2.6 并在项目中添加python26.dll 来解决。

    记得用Gst.Application.Init(); 初始化,解决空实例花了我 2 天时间。最后,由于 GStreamer 及其绑定是针对 x86 架构编译的,因此请强制为 x86 构建 .NET 程序集。

    【讨论】:

      猜你喜欢
      • 2012-04-24
      • 2021-09-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多