GNOME Bugzilla – Bug 118310
Timeout support added for fdsrc
Last modified: 2004-12-22 21:47:04 UTC
Hello Here is a patch that adds timeout support for the fdsrc element. http://www.galaxen.se/~mattias/temp/gstfdsrc-timeout-patch.diff
I like it. We probably need a new timeout event.
Some comments: - the property should be a guint64, and in nanoseconds. This is to conform with other gstreamer properties. - select() can return EINTR for a number of completely valid reasons. It's not necessarily an element error
I have been working on a similar patch for fdsink, but have been unable to get select to work the way I want. fdsink seams to be a "chain element" so i wonder if a solution as in fdsrc will work?
_chain() is the equivalent of _get() for sink pads. A source element doesn't have a sink pad, so it's irrelevant.
Created attachment 20730 [details] [review] Diff against CVS HEAD around 2003-07-23
Just add patch as attachment, as i may move it from the remote server.
I'd be happy to apply it to HEAD, if you fix the things I commented about previously.
Mattias: ping ?
Pong. Do you think the patch worth including? i can probably fix the things David commented on, but currently im not sure if have the disk space to compile the source :)
Created attachment 24389 [details] [review] New patch against HEAD, includes uint64 for timeout value and EINTR handling.
Timeout is now in nanoseconds. Does everything look ok? Also, im curious about one thing: If I for example set the timeout value to 1 second useing UL-postfix: g_object_set (G_OBJECT (src), "timeout", 1000000000UL, NULL); I get this warning about property "fdsrc", not "timeout", weird. (process:14439): GLib-GObject-WARNING **: gobject.c:882: object class `GstFdSrc' has no property named `fdsrc' With ULL-postfix i get no warning, in both cases the timeout value seams to get set.
in that case, you're passing an unsigned long, instead of a guint64_t, which probably translates to a unsigned long long on your machine. You should use G_GINT64_CONSTANT (1000000000), or less portably, 1000000000ULL. Patch is applied, with g_error() converted to GST_ELEMENT_ERROR(). Thanks.