gst.poll

Module for Poll class

class Poll

Types 1

classPoll

A #GstPoll keeps track of file descriptors much like fd_set (used with select ()) or a struct pollfd array (used with poll ()). Once created with gst.poll.Poll.new_, the set can be used to wait for file descriptors to be readable and/or writable. It is possible to make this wait be controlled by specifying true for the @controllable flag when creating the set (or later calling gst.poll.Poll.setControllable).

New file descriptors are added to the set using gst.poll.Poll.addFd, and removed using gst.poll.Poll.removeFd. Controlling which file descriptors should be waited for to become readable and/or writable are done using gst.poll.Poll.fdCtlRead, gst.poll.Poll.fdCtlWrite and gst.poll.Poll.fdCtlPri.

Use gst.poll.Poll.wait to wait for the file descriptors to actually become readable and/or writable, or to timeout if no file descriptor is available in time. The wait can be controlled by calling gst.poll.Poll.restart and gst.poll.Poll.setFlushing.

Once the file descriptor set has been waited for, one can use gst.poll.Poll.fdHasClosed to see if the file descriptor has been closed, gst.poll.Poll.fdHasError to see if it has generated an error, gst.poll.Poll.fdCanRead to see if it is possible to read from the file descriptor, and gst.poll.Poll.fdCanWrite to see if it is possible to write to it.

Fields
GstPoll * _cInstancePtr
bool owned
Methods
void * _cPtr()
bool addFd(gst.poll_fd.PollFD fd)Add a file descriptor to the file descriptor set.
bool fdCanRead(gst.poll_fd.PollFD fd)Check if fd in set has data to be read.
bool fdCanWrite(gst.poll_fd.PollFD fd)Check if fd in set can be used for writing.
bool fdCtlPri(gst.poll_fd.PollFD fd, bool active)Control whether the descriptor fd in set will be monitored for exceptional conditions (POLLPRI).
bool fdCtlRead(gst.poll_fd.PollFD fd, bool active)Control whether the descriptor fd in set will be monitored for readability.
bool fdCtlWrite(gst.poll_fd.PollFD fd, bool active)Control whether the descriptor fd in set will be monitored for writability.
bool fdHasClosed(gst.poll_fd.PollFD fd)Check if fd in set has closed the connection.
bool fdHasError(gst.poll_fd.PollFD fd)Check if fd in set has an error.
bool fdHasPri(gst.poll_fd.PollFD fd)Check if fd in set has an exceptional condition (POLLPRI).
void fdIgnored(gst.poll_fd.PollFD fd)Mark fd as ignored so that the next call to [gst.poll.Poll.wait] will yield the same result for fd as last time. This function must be called if no operation (read/write/recv/send/etc.) will be per...
void getReadGpollfd(glib.types.PollFD fd)Get a GPollFD for the reading part of the control socket. This is useful when integrating with a GSource and GMainLoop.
bool readControl()Read a byte from the control socket of the controllable set.
bool removeFd(gst.poll_fd.PollFD fd)Remove a file descriptor from the file descriptor set.
void restart()Restart any [gst.poll.Poll.wait] that is in progress. This function is typically used after adding or removing descriptors to set.
bool setControllable(bool controllable)When controllable is true, this function ensures that future calls to [gst.poll.Poll.wait] will be affected by [gst.poll.Poll.restart] and [gst.poll.Poll.setFlushing].
void setFlushing(bool flushing)When flushing is true, this function ensures that current and future calls to [gst.poll.Poll.wait] will return -1, with errno set to EBUSY.
int wait(gst.types.ClockTime timeout)Wait for activity on the file descriptors in set. This function waits up to the specified timeout. A timeout of #GST_CLOCK_TIME_NONE waits forever.
bool writeControl()Write a byte to the control socket of the controllable set. This function is mostly useful for timer #GstPoll objects created with [gst.poll.Poll.newTimer].
Constructors
this(void * ptr, Flag!"Take" take)