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.
This commit is contained in:
Wim Taymans 2008-02-29 11:00:43 +00:00
parent 4c31dc7cc4
commit 3ae60c3b9d
4 changed files with 37 additions and 0 deletions

View file

@ -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> 2008-02-28 Sebastian Dröge <slomo@circular-chaos.org>
* plugins/elements/gstfdsink.c: (gst_fd_sink_start), * plugins/elements/gstfdsink.c: (gst_fd_sink_start),

View file

@ -1610,6 +1610,7 @@ gst_rank_get_type
GstPoll GstPoll
GstPollFD GstPollFD
GstPollMode GstPollMode
GST_POLL_FD_INIT
gst_poll_add_fd gst_poll_add_fd
gst_poll_fd_can_read gst_poll_fd_can_read
gst_poll_fd_can_write gst_poll_fd_can_write
@ -1617,6 +1618,7 @@ gst_poll_fd_ctl_read
gst_poll_fd_ctl_write gst_poll_fd_ctl_write
gst_poll_fd_has_closed gst_poll_fd_has_closed
gst_poll_fd_has_error gst_poll_fd_has_error
gst_poll_fd_init
gst_poll_free gst_poll_free
gst_poll_get_mode gst_poll_get_mode
gst_poll_new gst_poll_new

View file

@ -365,6 +365,22 @@ gst_poll_get_mode (const GstPoll * set)
return mode; 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 static gboolean
gst_poll_add_fd_unlocked (GstPoll * set, GstPollFD * fd) gst_poll_add_fd_unlocked (GstPoll * set, GstPollFD * fd)
{ {

View file

@ -51,6 +51,16 @@ typedef struct {
gint idx; gint idx;
} GstPollFD; } 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: * GstPollMode:
* @GST_POLL_MODE_AUTO: choose method automatically * @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); void gst_poll_set_mode (GstPoll *set, GstPollMode mode);
GstPollMode gst_poll_get_mode (const GstPoll *set); 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_add_fd (GstPoll *set, GstPollFD *fd);
gboolean gst_poll_remove_fd (GstPoll *set, GstPollFD *fd); gboolean gst_poll_remove_fd (GstPoll *set, GstPollFD *fd);