GNOME Bugzilla – Bug 436620
get_uri_type methods should return enum objects
Last modified: 2007-07-27 11:22:16 UTC
gst.URIHandler.get_uri_type and gst.ElementFactory.get_uri_type methods return plain integers (like their C counterparts). I'd rather have them return gst.URIType enum instances proper (so I can grab the value nick easily). Attaching a trivial patch. P.S.: Note how the C functions have inconsistent return types (gint vs. guint), where both should be rather GstURIType it seems.
Created attachment 87718 [details] [review] Make get_uri_type methods return enum objects
This is fine by me. The reason why is because you could already check before whether the return value was equal to gst.URI_* OLD BEHAVIOUR: In [2]: e = gst.element_factory_make("gnomevfssrc") In [4]: e.get_uri_type() Out[4]: 2L In [5]: e.get_uri_type() == gst.URI_SRC Out[5]: True NEW BEHAVIOUR: In [3]: e.get_uri_type() Out[3]: <enum GST_URI_SRC of type GstURIType> In [4]: e.get_uri_type() == gst.URI_SRC Out[4]: True 2007-07-27 Rene Stadler <mail@renestadler.de> reviewed by: Edward Hervey <bilboed@bilboed.com> * gst/gst.defs: Make .get_uri_type() methods return a GstURIType enum instead of an integer. Fixes #436620