diff --git a/ChangeLog b/ChangeLog index 6ac3645140..79f6dd8781 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-02-29 Wim Taymans + + * 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 * 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 @@ -51,6 +51,16 @@ typedef struct { gint idx; } 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 @@ -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);