GstPoll
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_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_set_controllable).
New file descriptors are added to the set using gst_poll_add_fd, and removed using gst_poll_remove_fd. Controlling which file descriptors should be waited for to become readable and/or writable are done using gst_poll_fd_ctl_read, gst_poll_fd_ctl_write and gst_poll_fd_ctl_pri.
Use gst_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_restart and gst_poll_set_flushing.
Once the file descriptor set has been waited for, one can use gst_poll_fd_has_closed to see if the file descriptor has been closed, gst_poll_fd_has_error to see if it has generated an error, gst_poll_fd_can_read to see if it is possible to read from the file descriptor, and gst_poll_fd_can_write to see if it is possible to write to it.
GstPoll
A set of file/network descriptors.
Gst.Poll
A set of file/network descriptors.
Gst.Poll
A set of file/network descriptors.
Methods
gst_poll_add_fd
gboolean gst_poll_add_fd (GstPoll * set, GstPollFD * fd)
Add a file descriptor to the file descriptor set.
Parameters:
set
–
a file descriptor set.
fd
–
a file descriptor.
TRUE if the file descriptor was successfully added to the set.
Gst.Poll.prototype.add_fd
function Gst.Poll.prototype.add_fd(fd: Gst.PollFD): {
// javascript wrapper for 'gst_poll_add_fd'
}
Add a file descriptor to the file descriptor set.
Gst.Poll.add_fd
def Gst.Poll.add_fd (self, fd):
#python wrapper for 'gst_poll_add_fd'
Add a file descriptor to the file descriptor set.
gst_poll_fd_can_read
gboolean gst_poll_fd_can_read (const GstPoll * set, GstPollFD * fd)
Check if fd in set has data to be read.
Parameters:
set
–
a file descriptor set.
fd
–
a file descriptor.
TRUE if the descriptor has data to be read.
Gst.Poll.prototype.fd_can_read
function Gst.Poll.prototype.fd_can_read(fd: Gst.PollFD): {
// javascript wrapper for 'gst_poll_fd_can_read'
}
Check if fd in set has data to be read.
Gst.Poll.fd_can_read
def Gst.Poll.fd_can_read (self, fd):
#python wrapper for 'gst_poll_fd_can_read'
Check if fd in set has data to be read.
gst_poll_fd_can_write
gboolean gst_poll_fd_can_write (const GstPoll * set, GstPollFD * fd)
Check if fd in set can be used for writing.
Parameters:
set
–
a file descriptor set.
fd
–
a file descriptor.
TRUE if the descriptor can be used for writing.
Gst.Poll.prototype.fd_can_write
function Gst.Poll.prototype.fd_can_write(fd: Gst.PollFD): {
// javascript wrapper for 'gst_poll_fd_can_write'
}
Check if fd in set can be used for writing.
Gst.Poll.fd_can_write
def Gst.Poll.fd_can_write (self, fd):
#python wrapper for 'gst_poll_fd_can_write'
Check if fd in set can be used for writing.
gst_poll_fd_ctl_pri
gboolean gst_poll_fd_ctl_pri (GstPoll * set, GstPollFD * fd, gboolean active)
Control whether the descriptor fd in set will be monitored for exceptional conditions (POLLPRI).
Not implemented on Windows (will just return FALSE there).
Parameters:
set
–
a file descriptor set.
fd
–
a file descriptor.
active
–
a new status.
TRUE if the descriptor was successfully updated.
Since : 1.16
Gst.Poll.prototype.fd_ctl_pri
function Gst.Poll.prototype.fd_ctl_pri(fd: Gst.PollFD, active: Number): {
// javascript wrapper for 'gst_poll_fd_ctl_pri'
}
Control whether the descriptor fd in set will be monitored for exceptional conditions (POLLPRI).
Not implemented on Windows (will just return false there).
Parameters:
a file descriptor set.
a file descriptor.
a new status.
Since : 1.16
Gst.Poll.fd_ctl_pri
def Gst.Poll.fd_ctl_pri (self, fd, active):
#python wrapper for 'gst_poll_fd_ctl_pri'
Control whether the descriptor fd in set will be monitored for exceptional conditions (POLLPRI).
Not implemented on Windows (will just return False there).
Parameters:
a file descriptor set.
a file descriptor.
a new status.
Since : 1.16
gst_poll_fd_ctl_read
gboolean gst_poll_fd_ctl_read (GstPoll * set, GstPollFD * fd, gboolean active)
Control whether the descriptor fd in set will be monitored for readability.
Parameters:
set
–
a file descriptor set.
fd
–
a file descriptor.
active
–
a new status.
TRUE if the descriptor was successfully updated.
Gst.Poll.prototype.fd_ctl_read
function Gst.Poll.prototype.fd_ctl_read(fd: Gst.PollFD, active: Number): {
// javascript wrapper for 'gst_poll_fd_ctl_read'
}
Control whether the descriptor fd in set will be monitored for readability.
Parameters:
a file descriptor set.
a file descriptor.
a new status.
Gst.Poll.fd_ctl_read
def Gst.Poll.fd_ctl_read (self, fd, active):
#python wrapper for 'gst_poll_fd_ctl_read'
Control whether the descriptor fd in set will be monitored for readability.
Parameters:
a file descriptor set.
a file descriptor.
a new status.
gst_poll_fd_ctl_write
gboolean gst_poll_fd_ctl_write (GstPoll * set, GstPollFD * fd, gboolean active)
Control whether the descriptor fd in set will be monitored for writability.
Parameters:
set
–
a file descriptor set.
fd
–
a file descriptor.
active
–
a new status.
TRUE if the descriptor was successfully updated.
Gst.Poll.prototype.fd_ctl_write
function Gst.Poll.prototype.fd_ctl_write(fd: Gst.PollFD, active: Number): {
// javascript wrapper for 'gst_poll_fd_ctl_write'
}
Control whether the descriptor fd in set will be monitored for writability.
Parameters:
a file descriptor set.
a file descriptor.
a new status.
Gst.Poll.fd_ctl_write
def Gst.Poll.fd_ctl_write (self, fd, active):
#python wrapper for 'gst_poll_fd_ctl_write'
Control whether the descriptor fd in set will be monitored for writability.
Parameters:
a file descriptor set.
a file descriptor.
a new status.
gst_poll_fd_has_closed
gboolean gst_poll_fd_has_closed (const GstPoll * set, GstPollFD * fd)
Check if fd in set has closed the connection.
Parameters:
set
–
a file descriptor set.
fd
–
a file descriptor.
TRUE if the connection was closed.
Gst.Poll.prototype.fd_has_closed
function Gst.Poll.prototype.fd_has_closed(fd: Gst.PollFD): {
// javascript wrapper for 'gst_poll_fd_has_closed'
}
Check if fd in set has closed the connection.
Gst.Poll.fd_has_closed
def Gst.Poll.fd_has_closed (self, fd):
#python wrapper for 'gst_poll_fd_has_closed'
Check if fd in set has closed the connection.
gst_poll_fd_has_error
gboolean gst_poll_fd_has_error (const GstPoll * set, GstPollFD * fd)
Check if fd in set has an error.
Parameters:
set
–
a file descriptor set.
fd
–
a file descriptor.
TRUE if the descriptor has an error.
Gst.Poll.prototype.fd_has_error
function Gst.Poll.prototype.fd_has_error(fd: Gst.PollFD): {
// javascript wrapper for 'gst_poll_fd_has_error'
}
Check if fd in set has an error.
Gst.Poll.fd_has_error
def Gst.Poll.fd_has_error (self, fd):
#python wrapper for 'gst_poll_fd_has_error'
Check if fd in set has an error.
gst_poll_fd_has_pri
gboolean gst_poll_fd_has_pri (const GstPoll * set, GstPollFD * fd)
Check if fd in set has an exceptional condition (POLLPRI).
Not implemented on Windows (will just return FALSE there).
Parameters:
set
–
a file descriptor set.
fd
–
a file descriptor.
TRUE if the descriptor has an exceptional condition.
Since : 1.16
Gst.Poll.prototype.fd_has_pri
function Gst.Poll.prototype.fd_has_pri(fd: Gst.PollFD): {
// javascript wrapper for 'gst_poll_fd_has_pri'
}
Check if fd in set has an exceptional condition (POLLPRI).
Not implemented on Windows (will just return false there).
Since : 1.16
Gst.Poll.fd_has_pri
def Gst.Poll.fd_has_pri (self, fd):
#python wrapper for 'gst_poll_fd_has_pri'
Check if fd in set has an exceptional condition (POLLPRI).
Not implemented on Windows (will just return False there).
Since : 1.16
gst_poll_fd_ignored
gst_poll_fd_ignored (GstPoll * set, GstPollFD * fd)
Mark fd as ignored so that the next call to gst_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 performed on fd before the next call to gst_poll_wait.
The reason why this is needed is because the underlying implementation might not allow querying the fd more than once between calls to one of the re-enabling operations.
Parameters:
set
–
a file descriptor set.
fd
–
a file descriptor.
Gst.Poll.prototype.fd_ignored
function Gst.Poll.prototype.fd_ignored(fd: Gst.PollFD): {
// javascript wrapper for 'gst_poll_fd_ignored'
}
Mark fd as ignored so that the next call to Gst.Poll.prototype.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 performed on fd before the next call to Gst.Poll.prototype.wait.
The reason why this is needed is because the underlying implementation might not allow querying the fd more than once between calls to one of the re-enabling operations.
Gst.Poll.fd_ignored
def Gst.Poll.fd_ignored (self, fd):
#python wrapper for 'gst_poll_fd_ignored'
Mark fd as ignored so that the next call to Gst.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 performed on fd before the next call to Gst.Poll.wait.
The reason why this is needed is because the underlying implementation might not allow querying the fd more than once between calls to one of the re-enabling operations.
gst_poll_free
gst_poll_free (GstPoll * set)
Free a file descriptor set.
Parameters:
set
(
[transfer: full])
–
a file descriptor set.
Gst.Poll.prototype.free
function Gst.Poll.prototype.free(): {
// javascript wrapper for 'gst_poll_free'
}
Free a file descriptor set.
Parameters:
a file descriptor set.
Gst.Poll.free
def Gst.Poll.free (self):
#python wrapper for 'gst_poll_free'
Free a file descriptor set.
Parameters:
a file descriptor set.
gst_poll_get_read_gpollfd
gst_poll_get_read_gpollfd (GstPoll * set, GPollFD * fd)
Get a GPollFD for the reading part of the control socket. This is useful when integrating with a GSource and GMainLoop.
Gst.Poll.prototype.get_read_gpollfd
function Gst.Poll.prototype.get_read_gpollfd(fd: GPollFD (not introspectable)): {
// javascript wrapper for 'gst_poll_get_read_gpollfd'
}
Get a GPollFD for the reading part of the control socket. This is useful when integrating with a GSource and GMainLoop.
Parameters:
Gst.Poll.get_read_gpollfd
def Gst.Poll.get_read_gpollfd (self, fd):
#python wrapper for 'gst_poll_get_read_gpollfd'
Get a GPollFD for the reading part of the control socket. This is useful when integrating with a GSource and GMainLoop.
Parameters:
gst_poll_read_control
gboolean gst_poll_read_control (GstPoll * set)
Read a byte from the control socket of the controllable set.
This function only works for timer GstPoll objects created with gst_poll_new_timer.
Parameters:
set
–
a GstPoll.
Gst.Poll.prototype.read_control
function Gst.Poll.prototype.read_control(): {
// javascript wrapper for 'gst_poll_read_control'
}
Read a byte from the control socket of the controllable set.
This function only works for timer Gst.Poll objects created with gst_poll_new_timer (not introspectable).
Gst.Poll.read_control
def Gst.Poll.read_control (self):
#python wrapper for 'gst_poll_read_control'
Read a byte from the control socket of the controllable set.
This function only works for timer Gst.Poll objects created with gst_poll_new_timer (not introspectable).
gst_poll_remove_fd
gboolean gst_poll_remove_fd (GstPoll * set, GstPollFD * fd)
Remove a file descriptor from the file descriptor set.
Parameters:
set
–
a file descriptor set.
fd
–
a file descriptor.
TRUE if the file descriptor was successfully removed from the set.
Gst.Poll.prototype.remove_fd
function Gst.Poll.prototype.remove_fd(fd: Gst.PollFD): {
// javascript wrapper for 'gst_poll_remove_fd'
}
Remove a file descriptor from the file descriptor set.
Gst.Poll.remove_fd
def Gst.Poll.remove_fd (self, fd):
#python wrapper for 'gst_poll_remove_fd'
Remove a file descriptor from the file descriptor set.
gst_poll_restart
gst_poll_restart (GstPoll * set)
Restart any gst_poll_wait that is in progress. This function is typically used after adding or removing descriptors to set.
If set is not controllable, then this call will have no effect.
This function only works for non-timer GstPoll objects created with gst_poll_new.
Parameters:
set
–
a GstPoll.
Gst.Poll.prototype.restart
function Gst.Poll.prototype.restart(): {
// javascript wrapper for 'gst_poll_restart'
}
Restart any Gst.Poll.prototype.wait that is in progress. This function is typically used after adding or removing descriptors to set.
If set is not controllable, then this call will have no effect.
This function only works for non-timer Gst.Poll objects created with gst_poll_new (not introspectable).
Gst.Poll.restart
def Gst.Poll.restart (self):
#python wrapper for 'gst_poll_restart'
Restart any Gst.Poll.wait that is in progress. This function is typically used after adding or removing descriptors to set.
If set is not controllable, then this call will have no effect.
This function only works for non-timer Gst.Poll objects created with gst_poll_new (not introspectable).
gst_poll_set_controllable
gboolean gst_poll_set_controllable (GstPoll * set, gboolean controllable)
When controllable is TRUE, this function ensures that future calls to gst_poll_wait will be affected by gst_poll_restart and gst_poll_set_flushing.
This function only works for non-timer GstPoll objects created with gst_poll_new.
TRUE if the controllability of set could be updated.
Gst.Poll.prototype.set_controllable
function Gst.Poll.prototype.set_controllable(controllable: Number): {
// javascript wrapper for 'gst_poll_set_controllable'
}
When controllable is true, this function ensures that future calls to Gst.Poll.prototype.wait will be affected by Gst.Poll.prototype.restart and Gst.Poll.prototype.set_flushing.
This function only works for non-timer Gst.Poll objects created with gst_poll_new (not introspectable).
Gst.Poll.set_controllable
def Gst.Poll.set_controllable (self, controllable):
#python wrapper for 'gst_poll_set_controllable'
When controllable is True, this function ensures that future calls to Gst.Poll.wait will be affected by Gst.Poll.restart and Gst.Poll.set_flushing.
This function only works for non-timer Gst.Poll objects created with gst_poll_new (not introspectable).
gst_poll_set_flushing
gst_poll_set_flushing (GstPoll * set, gboolean flushing)
When flushing is TRUE, this function ensures that current and future calls to gst_poll_wait will return -1, with errno set to EBUSY.
Unsetting the flushing state will restore normal operation of set.
This function only works for non-timer GstPoll objects created with gst_poll_new.
Gst.Poll.prototype.set_flushing
function Gst.Poll.prototype.set_flushing(flushing: Number): {
// javascript wrapper for 'gst_poll_set_flushing'
}
When flushing is true, this function ensures that current and future calls to Gst.Poll.prototype.wait will return -1, with errno set to EBUSY.
Unsetting the flushing state will restore normal operation of set.
This function only works for non-timer Gst.Poll objects created with gst_poll_new (not introspectable).
Gst.Poll.set_flushing
def Gst.Poll.set_flushing (self, flushing):
#python wrapper for 'gst_poll_set_flushing'
When flushing is True, this function ensures that current and future calls to Gst.Poll.wait will return -1, with errno set to EBUSY.
Unsetting the flushing state will restore normal operation of set.
This function only works for non-timer Gst.Poll objects created with gst_poll_new (not introspectable).
gst_poll_wait
gint gst_poll_wait (GstPoll * set, GstClockTime 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.
For GstPoll objects created with gst_poll_new, this function can only be called from a single thread at a time. If called from multiple threads, -1 will be returned with errno set to EPERM.
This is not true for timer GstPoll objects created with gst_poll_new_timer, where it is allowed to have multiple threads waiting simultaneously.
The number of GstPollFD in set that have activity or 0 when no activity was detected after timeout. If an error occurs, -1 is returned and errno is set.
Gst.Poll.prototype.wait
function Gst.Poll.prototype.wait(timeout: Number): {
// javascript wrapper for 'gst_poll_wait'
}
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.
For Gst.Poll objects created with gst_poll_new (not introspectable), this function can only be called from a single thread at a time. If called from multiple threads, -1 will be returned with errno set to EPERM.
This is not true for timer Gst.Poll objects created with gst_poll_new_timer (not introspectable), where it is allowed to have multiple threads waiting simultaneously.
The number of Gst.PollFD in set that have activity or 0 when no activity was detected after timeout. If an error occurs, -1 is returned and errno is set.
Gst.Poll.wait
def Gst.Poll.wait (self, timeout):
#python wrapper for 'gst_poll_wait'
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.
For Gst.Poll objects created with gst_poll_new (not introspectable), this function can only be called from a single thread at a time. If called from multiple threads, -1 will be returned with errno set to EPERM.
This is not true for timer Gst.Poll objects created with gst_poll_new_timer (not introspectable), where it is allowed to have multiple threads waiting simultaneously.
The number of Gst.PollFD in set that have activity or 0 when no activity was detected after timeout. If an error occurs, -1 is returned and errno is set.
gst_poll_write_control
gboolean gst_poll_write_control (GstPoll * set)
Write a byte to the control socket of the controllable set. This function is mostly useful for timer GstPoll objects created with gst_poll_new_timer.
It will make any current and future gst_poll_wait function return with 1, meaning the control socket is set. After an equal amount of calls to gst_poll_read_control have been performed, calls to gst_poll_wait will block again until their timeout expired.
This function only works for timer GstPoll objects created with gst_poll_new_timer.
Parameters:
set
–
a GstPoll.
Gst.Poll.prototype.write_control
function Gst.Poll.prototype.write_control(): {
// javascript wrapper for 'gst_poll_write_control'
}
Write a byte to the control socket of the controllable set. This function is mostly useful for timer Gst.Poll objects created with gst_poll_new_timer (not introspectable).
It will make any current and future Gst.Poll.prototype.wait function return with 1, meaning the control socket is set. After an equal amount of calls to Gst.Poll.prototype.read_control have been performed, calls to Gst.Poll.prototype.wait will block again until their timeout expired.
This function only works for timer Gst.Poll objects created with gst_poll_new_timer (not introspectable).
Gst.Poll.write_control
def Gst.Poll.write_control (self):
#python wrapper for 'gst_poll_write_control'
Write a byte to the control socket of the controllable set. This function is mostly useful for timer Gst.Poll objects created with gst_poll_new_timer (not introspectable).
It will make any current and future Gst.Poll.wait function return with 1, meaning the control socket is set. After an equal amount of calls to Gst.Poll.read_control have been performed, calls to Gst.Poll.wait will block again until their timeout expired.
This function only works for timer Gst.Poll objects created with gst_poll_new_timer (not introspectable).
Functions
gst_poll_new
GstPoll * gst_poll_new (gboolean controllable)
Create a new file descriptor set. If controllable, it is possible to restart or flush a call to gst_poll_wait with gst_poll_restart and gst_poll_set_flushing respectively.
Free-function: gst_poll_free
Parameters:
controllable
–
whether it should be possible to control a wait.
a new GstPoll, or NULL in case of an error. Free with gst_poll_free.
gst_poll_new_timer
GstPoll * gst_poll_new_timer ()
Create a new poll object that can be used for scheduling cancellable timeouts.
A timeout is performed with gst_poll_wait. Multiple timeouts can be performed from different threads.
Free-function: gst_poll_free
a new GstPoll, or NULL in case of an error. Free with gst_poll_free.
GstPollFD
A file descriptor object.
Members
fd
(int)
–
a file descriptor
Methods
gst_poll_fd_init
gst_poll_fd_init (GstPollFD * fd)
Initializes fd. Alternatively you can initialize it with GST_POLL_FD_INIT.
Parameters:
fd
–
Gst.PollFD.prototype.init
function Gst.PollFD.prototype.init(): {
// javascript wrapper for 'gst_poll_fd_init'
}
Initializes fd. Alternatively you can initialize it with GST_POLL_FD_INIT (not introspectable).
Parameters:
Gst.PollFD.init
def Gst.PollFD.init (self):
#python wrapper for 'gst_poll_fd_init'
Initializes fd. Alternatively you can initialize it with GST_POLL_FD_INIT (not introspectable).
Parameters:
Constants
GST_POLL_FD_INIT
#define GST_POLL_FD_INIT { -1, -1 }
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.
The results of the search are