GNOME Bugzilla – Bug 424728
function that reports which mime types are supported
Last modified: 2011-05-18 13:00:31 UTC
could be handy to use with gtkfilechooser filter filter = gtk_file_filter_new (); gtk_file_filter_set_name (filter, _("Media playable with gstreamer")); get_gstreamer_decoder_mime(gstreamermime); for(){ gtk_file_filter_add_mime_type (filter, gstreamermime[i]); } gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (chooser), filter); dirty code just as example
I can see a few problems with this: (a) GStreamer doesn't use mime types it uses 'media types'. Often these will be the same, but often enough they will not (one could create mappings of course, which might also be useful for other purposes). (b) The mime type system in its current form is pretty much useless for anything but the most simple media types. For container formats (avi, wma/wmv/asf, matroska, quicktime, mpeg) it could only really tell you if the container format is supported, but not so much if the audio/video within the container is actually supported, so it's not really particularly useful (IMHO). (c) I'm not entirely convinced that xdg-mime as used by the filechooser dialog returns useful mime types for all media formats, or even for the mostcommon formats (for example, mpeg transport stream dumps seem to be recognised as something different). And I'm pretty sure there's more that I'm forgetting right now :)
Wandering off into pedantry... There's no such thing as a "MIME type". There are "MIME media types", which are the same as "Media Types", and the latter term is used almost exclusively in relevant RFCs. GStreamer's caps use media types when possible, but also uses a lot of strings that should never, ever, be used outside of GStreamer. And there is no automatic way to determine which is which.
Right, lets close this as WONTFIX then because it's not possible to fix this properly.