After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 580412 - API for getting element factories by caps and type
API for getting element factories by caps and type
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
0.10.x
Other Linux
: Normal enhancement
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-27 10:18 UTC by Christian Fredrik Kalager Schaller
Modified: 2011-04-14 22:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Christian Fredrik Kalager Schaller 2009-04-27 10:18:40 UTC
In transmageddon I spent a lot of time trying to be able to get at codecs and muxers by using GStreamer caps/mimetypes and link that with element names. We got quite a bit of API in GStreamer for taking string mimetypes and using them, but not a easy way to link that information with actual plugins.

In transmageddon I created this file to deal with it:
http://cgit.freedesktop.org/~uraeus/transmageddon/tree/src/codecfinder.py

It is essentially an API which I can for instance provide with 'audio/mpeg,mpegversion=1,layer=3' and it will return me the name of a mp3 encoder if I got one, or let me know that there is no plugin for that format available (which in turn lets me use the pbutils stuff to search for a plugin).

Would be nice to have a generic version of this API in C availalble in GStreamer as loading of plugins and checking pad caps is not obvious to people not very experienced with GStreamer.
Comment 1 Olivier Crête 2009-04-27 13:54:52 UTC
I'd suggest something along the lines of

GList *gst_.._get_element_factories(GstCaps *incaps, GstCaps *outcaps, gchar *first_class, gchar *second_class, ...);

There is some nasty code that does something like that in a much less generic way in Farsight.
Comment 2 Olivier Crête 2009-04-27 13:56:55 UTC
while you're at it, lets add a "guint min_rank" parameter to exclude bad apples
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2010-01-29 08:47:11 UTC
(In reply to comment #1)
> I'd suggest something along the lines of
> 
> GList *gst_.._get_element_factories(GstCaps *incaps, GstCaps *outcaps, gchar
> *first_class, gchar *second_class, ...);
> 
> There is some nasty code that does something like that in a much less generic
> way in Farsight.

Just provide the class as one arg: "class1/class2/class3" the classes do not form a hierarchy anyway.

Code is here already more or less
http://buzztard.svn.sourceforge.net/viewvc/buzztard/trunk/buzztard/src/lib/core/tools.c?view=markup#l_45
http://buzztard.svn.sourceforge.net/viewvc/buzztard/trunk/buzztard/src/lib/core/tools.c?view=markup#l_76
Comment 4 Christian Fredrik Kalager Schaller 2011-04-14 22:14:06 UTC
I guess Encodebin does more or less what I want, so I am closing this bug.