GNOME Bugzilla – Bug 520671
GstPoll needs to be ported to Windows
Last modified: 2008-03-08 11:34:10 UTC
Please describe the problem: GStreamer core HEAD won't build on Windows because of GstPoll requiring porting. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
Created attachment 106660 [details] [review] Alpha version barely sufficient for 'hello world' with udpsrc Proof of concept, mostly just stubs, and limited to sockets only. Tested with: gst-launch udpsrc ! fakesink dump=true and import socket s = socket.socket (socket.AF_INET, socket.SOCK_DGRAM) s.sendto ('hello gst', 0, ('127.0.0.1', 4951)) Needless to say: Do not merge :)
Created attachment 106726 [details] [review] First take on GstPoll Windows support Feature complete except being limited to sockets only. Please review and test. Looking forward to getting check up running here so I can run through the GstPoll unittests.
Created attachment 106769 [details] [review] gstpoll_win32_support Like the first patch, but always choose Windows poll mode on Windows.
Created attachment 106775 [details] [review] gstpoll_win32_support Like the previous patch but remember to clear any previously stored result for non-signaled events.
I'm going to remove the GstPollMode from the API (still used internally) because the user of this API is never going to choose a mode himself, moreover, it could be possible to select a mode that is not supported. We should just select a mode internally that is supported and has best performance, whithout the user doing anything. This change will however change the API and requires us to update the users of the API and testsuite.
Created attachment 106777 [details] [review] gstpoll_win32_support Like the previous but one tiny change: Removed the io.h include on Windows, it's no longer needed.
Patch by: Ole André Vadla Ravnås <ole dot andre dot ravnas at tandberg dot com> * docs/gst/gstreamer-sections.txt: * gst/gstpoll.c: (find_index), (gst_poll_free_winsock_event), (gst_poll_update_winsock_event_mask), (gst_poll_new), (gst_poll_free), (gst_poll_fd_init), (gst_poll_add_fd_unlocked), (gst_poll_remove_fd), (gst_poll_fd_ctl_write), (gst_poll_fd_ctl_read_unlocked), (gst_poll_fd_has_closed), (gst_poll_fd_has_error), (gst_poll_fd_can_read_unlocked), (gst_poll_fd_can_write), (gst_poll_wait), (gst_poll_set_controllable), (gst_poll_restart), (gst_poll_set_flushing): * gst/gstpoll.h: * libs/gst/net/gstnetclientclock.c: (gst_net_client_clock_new): * libs/gst/net/gstnettimeprovider.c: (gst_net_time_provider_start), (gst_net_time_provider_new): * plugins/elements/gstfdsink.c: (gst_fd_sink_start): * plugins/elements/gstfdsrc.c: (gst_fd_src_start): * tests/benchmarks/gstpollstress.c: (main): * tests/check/gst/gstpoll.c: (GST_START_TEST), (gst_poll_suite): Remove GstPollMode from the API, it does not make sense to let the application control this. Add support for Win32. Fix the testsuite. Fixes #520671.
Adding me to the CC. list as I have done some very similar work (I use udpsrc with gstpoll on my windows box) and I'm interested in follow-ups. see bug #515312 if you want more details but using WFMO is probably the way to go.