GNOME Bugzilla – Bug 305256
[API] Change gst_element_seek to not mix enum/flags types
Last modified: 2005-07-20 17:27:47 UTC
Aloha, currently, the prototype for gst_element_seek is gboolean gst_element_seek (GstElement *element, GstSeekType seek_type, guint64 offset); It clearly states that only values of type GstSeekType are allowed for seek_type. But yet, to make it work at all, you have to OR in a value of type GstFormat. This breaks the illusion of type safety, and also creates problems for language bindings. Well, at least for the Perl bindings. In the Perl bindings, we wrap flags values as anonymous array references of simple strings. So GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH is represented as ["method-set", "flag-flush"]. Now, if you want to use GST_FORMAT_TIME | GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH you'd write ["time", "method-set", "flag-flush"]. This is of course invalid, and our standard converters complain loudly about it. There's simply no way they can know that "time" is supposed to be GST_FORMAT_TIME. I added a custom converter just for GstSeekType that also accepts values of type GstFormat, so it works now. But still, it's a hack. I think you guys should consider chaning this API to avoid the type mishmash in 0.9. What about adding an additional parameter that specifies the format? Thanks for listening, -Torsten
Reporter is correct, should be fixed for 0.10. Upping priority and targetting.
Fixed.