GStreamermm: creating a new element type (in plugin) by deriving from Gst::Element

僤鯓⒐⒋嵵緔 提交于 2019-12-08 00:40:37

问题


The standard method of creating a new element type in plugin is gobject-style "derivation" from GstElement type with all this gobject magic, like this.

I'm writting a project in C++ which use GStreamer with some elements specialized for my purpose. I've written several plugins in the way mentioned above, but I'm not satisfied with the code, since too much of it is just to met gobject requirements.

I consider using gstreamermm. Is it possible to create a new type of elements with C++-style derivation from Gst::Element? I mean something like:

class MyElement: public Gst::Element
{
  ...
}

It would be much prettier solution (assuming I'm already using gstreamermm and C++ in the plugin). Of course we need a real gobject type, that have unique type id and so on.


回答1:


As I didn't find anything suitable, I patched gstreamermm so it allows such element registration. See https://github.com/peper0/gstreamermm-plugins It is not tested well up till now, but seems to work in several basic cases. Bug reports and feature-requests would be appreciated.

Notice: my patch isn't authorized in any way by gstreamer or gstreamermm developers, so it may broke some design assumptions made in these projects.



来源:https://stackoverflow.com/questions/9609201/gstreamermm-creating-a-new-element-type-in-plugin-by-deriving-from-gsteleme

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!