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

1

2

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.

Footed answered 7/3, 2012 at 21:17 Comment(1)
I've used several mm wrappers, but not gstreamer. I'd consider the wrapper to be useless if you can't use its objects as a base class, so I'd say try it using a small test program.Hypophysis
F
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.

Footed answered 24/2, 2013 at 18:54 Comment(5)
I am very interested in this, I will test it (when I find some time). Do you have any plugins as an example of how to write plugins using gstreamermm? It would be good to have such functionality in gstreamermm. Have you contacted gstreamermm developers on this?Crackling
See some example here: hereFooted
(I cannot edit myprevious comment) Currently there is only simple one, but I'm working on using GstPushSrc and others base classes for elements. I'm going to contact gstreamermm developers, however haven't did it yet.Footed
As someone considering using gstreamermm I'm curious did this ever get merged into gstreamermm or replaced by similar functionality?Leavetaking
@BruceAdams: Its already merged into gstreamermm a long time ago: github.com/GNOME/gstreamermm/blob/master/gstreamer/gstreamermm/…Footed

© 2022 - 2024 — McMap. All rights reserved.