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 538628 - Patch: added a timeout property to fdsrc used in gst_poll_wait
Patch: added a timeout property to fdsrc used in gst_poll_wait
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal enhancement
: 0.10.21
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-06-16 15:32 UTC by joel larsson
Modified: 2008-06-20 10:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add poll timeout property on gstfdsrc.c / gstfdsrc.h (3.71 KB, patch)
2008-06-16 15:39 UTC, joel larsson
none Details | Review
handle poll timeout in the same way as udpsrc (4.41 KB, patch)
2008-06-17 09:07 UTC, joel larsson
committed Details | Review

Description joel larsson 2008-06-16 15:32:28 UTC
When using the fdsrc to read from a socket, its useful to be able to specify a timeout for the gst_poll_wait that is used. The behavior should be unchanged when not setting the property, it will use -1 and wait forever.

See patch for

gstreamer/gstreamer/plugins/elements/gstfdsrc.c (1.82)
gstreamer/gstreamer/plugins/elements/gstfdsrc.h (1.23)

http://pastebin.com/f6e1b4e37

Also changed some old labels/debugmessages that used "select" to "poll".

/joel
Comment 1 joel larsson 2008-06-16 15:39:32 UTC
Created attachment 112845 [details] [review]
add poll timeout property on gstfdsrc.c / gstfdsrc.h
Comment 2 joel larsson 2008-06-16 15:48:10 UTC
Comment on attachment 112845 [details] [review]
add poll timeout property on gstfdsrc.c / gstfdsrc.h

the timeout is handled in the same way as eos, returning GST_FLOW_UNEXPECTED from the create function. Is this correct?
Comment 3 Wim Taymans 2008-06-16 16:14:26 UTC
Why not do it the same way as udpsrc does it? it posts a message when the timeout occurs so that the application can decide what to do next. This sounds more flexible than simply stopping.
Comment 4 joel larsson 2008-06-17 09:07:02 UTC
Created attachment 112894 [details] [review]
handle poll timeout  in the same way as udpsrc
Comment 5 Wim Taymans 2008-06-20 10:02:14 UTC
        Patch by: joel larsson <tilljoel at gmail dot com>

        * docs/plugins/gstreamer-plugins.args:
        * plugins/elements/gstfdsrc.c: (gst_fd_src_class_init),
        (gst_fd_src_init), (gst_fd_src_update_fd),
        (gst_fd_src_set_property), (gst_fd_src_get_property),
        (gst_fd_src_create):
        * plugins/elements/gstfdsrc.h:
        Add timeout property like udpsrc. Fixes #538628.
        Add some more docs and example pipelines.