简体   繁体   English

GStreamermm的GStreamer插件(C ++)

[英]GStreamer plugin with GStreamermm(C++)

I'm trying to write a gstreamer plugin in C++, using the GStreamermm bindings. 我正在尝试使用GStreamermm绑定在C ++中编写gstreamer插件。 Now, there's a good plugins writers guide (http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/), and on the web there's various examples and templates, but for gstreamermm, there's very little amount of documentation whatsoever. 现在,有一个很好的插件编写指南(http://gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/),并且在网络上有各种示例和模板,但对于gstreamermm,它几乎没有大量的文件。

I know I could just resort to using a mixture of C and C++, but using the C++ bindings seems so much more elegant. 我知道我可以使用C和C ++的混合,但使用C ++绑定似乎更优雅。

Simply 'translating' the examples found in the gstreamer pwg to gstreamermm is kind of a dead end; 简单地“翻译”gstreamer pwg中的例子到gstreamermm是一种死路一条; gstreamer requires the use of quite a few macros for defining types, which I cannot see an immediate gstreamermm translation to. gstreamer需要使用相当多的宏来定义类型,我无法立即看到gstreamermm的翻译。 Additionally, I have only little experience with gstreamer, and absolutely no experience with gobj (so far). 另外,我对gstreamer的经验很少,而且绝对没有gobj的经验(到目前为止)。

Is anyone able to put me on the right track? 有人能让我走上正轨吗? Even the tiniest example or explanation would do. 即使是最微小的例子或解释也会这样。

Thanks 谢谢

I've asked this on the gtkmm mailing list a couple of days ago, and got the following answer (from José Alburquerque): 几天前我在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. 目前,唯一具有(可能不存在)使用gstreamermm开发的可能性的插件是专用于应用程序的插件。 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. 如果可能的话,这些插件将使用Gst :: Plugin :: register_static()[1]方法注册,而不是您在上面描述的过程。

[1] http://developer.gnome.org/gstreamermm/unstable/classGst_1_1Plugin.html#ac0728bb285ae1bed9298c0f9ea522ad9 [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. 从理论上讲,可以扩展gstreamermm基类之一[2]并在Gst :: Plugin :: SlotInit槽(回调)中调用Gst :: ElementFactory :: register_element()[3]方法,以便元素工厂生成这些元素可以创建。 That factory can then be added to the registry using Gst::Registry::add_feature()[4] in the same Gst::Plugin::SlotInit slot. 然后可以使用Gst :: Registry :: add_feature()[4]在同一个Gst :: Plugin :: SlotInit插槽中将该工厂添加到注册表中。

[2] http://developer.gnome.org/gstreamermm/unstable/group__GstBaseClasses.html [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. [3] Gst :: ElementFactory :: register_element()方法是一个尚未实现的方法,但会包装gst_element_register()函数。 That would be part of an upcoming release. 这将是即将发布的版本的一部分。

[4] http://developer.gnome.org/gstreamermm/unstable/classGst_1_1Registry.html#ae1f9a1ddd60ef5a7e1f8cddf14ec404f [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中编写插件更容易,但这只是让事情变得更容易的问题。

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

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