summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2008-02-29 11:00:43 +0000
committerWim Taymans <wim.taymans@gmail.com>2008-02-29 11:00:43 +0000
commit3ae60c3b9d103ad1548dc783a9ea99bd02cafaa2 (patch)
tree4ea462d044c9cfd3920215490b4e26bbf5b8d0e4
parent4c31dc7cc45ee1f56e6bb5d2bb059f2e2d5e4fde (diff)
Add INIT macro and _init method for initializing the GstPollFD.
Original commit message from CVS: * docs/gst/gstreamer-sections.txt: * gst/gstpoll.c: (gst_poll_fd_init): * gst/gstpoll.h: Add INIT macro and _init method for initializing the GstPollFD.
-rw-r--r--ChangeLog7
-rw-r--r--docs/gst/gstreamer-sections.txt2
-rw-r--r--gst/gstpoll.c16
-rw-r--r--gst/gstpoll.h12
4 files changed, 37 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6ac3645140..79f6dd8781 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-02-29 Wim Taymans <wim.taymans@collabora.co.uk>
+
+ * docs/gst/gstreamer-sections.txt:
+ * gst/gstpoll.c: (gst_poll_fd_init):
+ * gst/gstpoll.h:
+ Add INIT macro and _init method for initializing the GstPollFD.
+
2008-02-28 Sebastian Dröge <slomo@circular-chaos.org>
* plugins/elements/gstfdsink.c: (gst_fd_sink_start),
diff --git a/docs/gst/gstreamer-sections.txt b/docs/gst/gstreamer-sections.txt
index 0571e3bce5..0d1c1dcb16 100644
--- a/docs/gst/gstreamer-sections.txt
+++ b/docs/gst/gstreamer-sections.txt
@@ -1610,6 +1610,7 @@ gst_rank_get_type
GstPoll
GstPollFD
GstPollMode
+GST_POLL_FD_INIT
gst_poll_add_fd
gst_poll_fd_can_read
gst_poll_fd_can_write
@@ -1617,6 +1618,7 @@ gst_poll_fd_ctl_read
gst_poll_fd_ctl_write
gst_poll_fd_has_closed
gst_poll_fd_has_error
+gst_poll_fd_init
gst_poll_free
gst_poll_get_mode
gst_poll_new
diff --git a/gst/gstpoll.c b/gst/gstpoll.c
index cf161236ed..27dd44d024 100644
--- a/gst/gstpoll.c
+++ b/gst/gstpoll.c
@@ -365,6 +365,22 @@ gst_poll_get_mode (const GstPoll * set)
return mode;
}
+/**
+ * gst_poll_fd_init:
+ * @fd: a #GstPollFD
+ *
+ * Initializes @fd. Alternatively you can initialize it with
+ * #GST_POLL_FD_INIT.
+ */
+void
+gst_poll_fd_init (GstPollFD * fd)
+{
+ g_return_if_fail (fd != NULL);
+
+ fd->fd = -1;
+ fd->idx = -1;
+}
+
static gboolean
gst_poll_add_fd_unlocked (GstPoll * set, GstPollFD * fd)
{
diff --git a/gst/gstpoll.h b/gst/gstpoll.h
index 2325181e39..3a9e135f26 100644
--- a/gst/gstpoll.h
+++ b/gst/gstpoll.h
@@ -52,6 +52,16 @@ typedef struct {
} GstPollFD;
/**
+ * GST_POLL_FD_INIT:
+ *
+ * A #GstPollFD must be initialized with this macro, before it can be
+ * used. This macro can used be to initialize a variable, but it cannot
+ * be assigned to a variable. In that case you have to use
+ * gst_poll_fd_init().
+ */
+#define GST_POLL_FD_INIT { -1, -1 }
+
+/**
* GstPollMode:
* @GST_POLL_MODE_AUTO: choose method automatically
* @GST_POLL_MODE_SELECT: use select() when waiting
@@ -75,6 +85,8 @@ void gst_poll_free (GstPoll *set);
void gst_poll_set_mode (GstPoll *set, GstPollMode mode);
GstPollMode gst_poll_get_mode (const GstPoll *set);
+void gst_poll_fd_init (GstPollFD *fd);
+
gboolean gst_poll_add_fd (GstPoll *set, GstPollFD *fd);
gboolean gst_poll_remove_fd (GstPoll *set, GstPollFD *fd);