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 305256 - [API] Change gst_element_seek to not mix enum/flags types
[API] Change gst_element_seek to not mix enum/flags types
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: High normal
: 0.9.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-05-23 20:53 UTC by Torsten Schoenfeld
Modified: 2005-07-20 17:27 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Torsten Schoenfeld 2005-05-23 20:53:23 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
Comment 1 Andy Wingo 2005-07-16 13:58:36 UTC
Reporter is correct, should be fixed for 0.10. Upping priority and targetting.
Comment 2 Ronald Bultje 2005-07-20 17:27:47 UTC
Fixed.