poll: add method to get a GPollFD
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 3 Nov 2010 17:16:08 +0000 (18:16 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Fri, 3 Dec 2010 14:50:38 +0000 (15:50 +0100)
docs/gst/gstreamer-sections.txt
gst/gstpoll.c
gst/gstpoll.h
win32/common/libgstreamer.def

index 0fb0da6..6aab4f7 100644 (file)
@@ -1898,6 +1898,7 @@ gst_poll_fd_init
 gst_poll_free
 gst_poll_new
 gst_poll_new_timer
+gst_poll_get_read_gpollfd
 gst_poll_remove_fd
 gst_poll_restart
 gst_poll_set_controllable
index 6cef398..5ae8aef 100644 (file)
@@ -667,6 +667,27 @@ gst_poll_free (GstPoll * set)
 }
 
 /**
+ * gst_poll_get_read_gpollfd:
+ * @set: a #GstPoll
+ * @fd: a #GPollFD
+ *
+ * Get a GPollFD for the reading part of the control socket. This is useful when
+ * integrating with a GSource and GMainLoop.
+ *
+ * Since: 0.10.32
+ */
+void
+gst_poll_get_read_gpollfd (GstPoll * set, GPollFD * fd)
+{
+  g_return_if_fail (set != NULL);
+  g_return_if_fail (fd != NULL);
+
+  fd->fd = set->control_read_fd.fd;
+  fd->events = G_IO_IN | G_IO_HUP | G_IO_ERR;
+  fd->revents = 0;
+}
+
+/**
  * gst_poll_fd_init:
  * @fd: a #GstPollFD
  *
index 5503fbe..741a79b 100644 (file)
@@ -67,6 +67,8 @@ GstPoll*        gst_poll_new              (gboolean controllable);
 GstPoll*        gst_poll_new_timer        (void);
 void            gst_poll_free             (GstPoll *set);
 
+void            gst_poll_get_read_gpollfd (GstPoll *set, GPollFD *fd);
+
 void            gst_poll_fd_init          (GstPollFD *fd);
 
 gboolean        gst_poll_add_fd           (GstPoll *set, GstPollFD *fd);
index 5934a02..4075d1a 100644 (file)
@@ -788,6 +788,7 @@ EXPORTS
        gst_poll_fd_ignored
        gst_poll_fd_init
        gst_poll_free
+       gst_poll_get_read_gpollfd
        gst_poll_new
        gst_poll_new_timer
        gst_poll_read_control