Cancellable.makePollfd

Creates a gstreamer.PollFD corresponding to cancellable; this can be passed to g_poll() and used to poll for cancellation. This is useful both for unix systems without a native poll and for portability to windows.

When this function returns TRUE, you should use Cancellable.releaseFd to free up resources allocated for the pollfd. After a FALSE return, do not call Cancellable.releaseFd.

If this function returns FALSE, either no cancellable was given or resource limits prevent this function from allocating the necessary structures for polling. (On Linux, you will likely have reached the maximum number of file descriptors.) The suggested way to handle these cases is to ignore the cancellable.

You are not supposed to read from the fd yourself, just check for readable status. Reading to unset the readable status is done with Cancellable.reset.

class Cancellable
bool
makePollfd

Parameters

pollfd GPollFD*

a pointer to a gstreamer.PollFD

Return Value

Type: bool

TRUE if pollfd was successfully initialized, FALSE on failure to prepare the cancellable.

Meta

Since

2.22