c++ - GStreamer 插件与 GStreamermm(C++)

标签 c++ plugins binding gstreamer

我正在尝试使用 GStreamermm 绑定(bind)在 C++ 中编写一个 gstreamer 插件。现在,有一个很好的插件编写者指南 (http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/),并且在网络上有各种示例和模板,但是对于 gstreamermm,很少大量的文档。

我知道我可以混合使用 C 和 C++,但使用 C++ 绑定(bind)似乎更加优雅。

简单地将 gstreamer pwg 中的示例“翻译”为 gstreamermm 是一种死胡同; gstreamer 需要使用相当多的宏来定义类型,我看不到 gstreamermm 的直接翻译。此外,我对 gstreamer 的经验很少,对 gobj 完全没有经验(到目前为止)。

有人能让我走上正轨吗?即使是最微小的例子或解释也行。

谢谢

最佳答案

我几天前在 gtkmm 邮件列表上问过这个问题,得到了以下答案(来自 José Alburquerque):

Presently, the only plug-ins that have a (probably non-existent) possibility of being developed using gstreamermm are ones that are private to applications. If that's possible, These plug-ins would be registered using the Gst::Plugin::register_static()[1] method and not the process that you've described above.

[1] http://developer.gnome.org/gstreamermm/unstable/classGst_1_1Plugin.html#ac0728bb285ae1bed9298c0f9ea522ad9

In theory, one would extend one of the gstreamermm base classes[2] and call the Gst::ElementFactory::register_element()[3] method in the Gst::Plugin::SlotInit slot (callback) so that an element factory that generates these elements can be created. That factory can then be added to the registry using Gst::Registry::add_feature()[4] in the same Gst::Plugin::SlotInit slot.

[2] http://developer.gnome.org/gstreamermm/unstable/group__GstBaseClasses.html

[3] The Gst::ElementFactory::register_element() method is a method that is not implemented yet but would wrap the gst_element_register() function. That would be part of an upcoming release.

[4] http://developer.gnome.org/gstreamermm/unstable/classGst_1_1Registry.html#ae1f9a1ddd60ef5a7e1f8cddf14ec404f

I've not tested this and don't really know exactly how it would work (or if it actually would) but it's how I'd try if I had to. However, I think it's easier to write the plug-in in C presently, but that's just a matter of making things easier.

关于c++ - GStreamer 插件与 GStreamermm(C++),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11691016/

相关文章:

c++ - 基本 C++ 递归

c++ - 如何在 C++ 中使用另一个变量名中的变量

wpf - 如何在 WPF XAML 中的多重绑定(bind)中使用 stringformat

javascript - 为 v-bind 添加条件?

c++ - 以编程方式禁用/启用网络接口(interface)

c++ - 二进制搜索排序数组中极端元素的错误输出

variables - Jenkins 插件 - 环境变量

internet-explorer - 强制 Internet Explorer 使用特定的 Java 运行时环境安装?

javascript - CKEditor 图像宽度和高度作为 HTML 属性而不是内联样式

ios - 如何在 swiftUI 列表中更改复杂数据源