[gstreamer-bugs] [Bug 305256] New: [API] Change gst_element_seek to not mix enum/flags types

bugzilla-daemon at bugzilla.gnome.org bugzilla-daemon at bugzilla.gnome.org
Mon May 23 13:53:24 PDT 2005


Please DO NOT reply to this by email. All additional comments should be made in
the comments box of this bug report.

 http://bugzilla.gnome.org/show_bug.cgi?id=305256
 GStreamer | gstreamer (core) | Ver: HEAD CVS

           Summary: [API] Change gst_element_seek to not mix enum/flags
                    types
           Product: GStreamer
           Version: HEAD CVS
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gstreamer (core)
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: kaffeetisch at gmx.de
         QAContact: gstreamer-bugs at lists.sourceforge.net
                CC: all-bugs at bugzilla.gnome.org


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

------- You are receiving this mail because: -------
You are the assignee for the bug.
You are the QA contact for the bug.




More information about the Gstreamer-bugs mailing list