Callbacks

AppSinkEosCallback (appsink, *user_data)

AppSinkNewEventCallback (appsink, *user_data)

AppSinkNewPrerollCallback (appsink, *user_data)

AppSinkNewSampleCallback (appsink, *user_data)

AppSinkProposeAllocationCallback (appsink, query, *user_data)

AppSrcEnoughDataCallback (appsrc, *user_data)

AppSrcNeedDataCallback (appsrc, length, *user_data)

AppSrcSeekDataCallback (appsrc, offset, *user_data)

Details

GstApp.AppSinkEosCallback(appsink, *user_data)
Parameters:

Called when the end-of-stream has been reached. This callback is called from the streaming thread.

New in version 1.28.

GstApp.AppSinkNewEventCallback(appsink, *user_data)
Parameters:
Returns:

True when the event has been handled.

Return type:

bool

Called when a new event is available. This callback is called from the streaming thread. The new event can be retrieved with GstApp.AppSink.pull_object() either from this callback or from any other thread.

The callback should return True if the event has been handled, False otherwise.

New in version 1.28.

GstApp.AppSinkNewPrerollCallback(appsink, *user_data)
Parameters:
Returns:

Gst.FlowReturn.OK on success.

Return type:

Gst.FlowReturn

Called when a new preroll sample is available. This callback is called from the streaming thread. The new preroll sample can be retrieved with GstApp.AppSink.pull_preroll() either from this callback or from any other thread.

New in version 1.28.

GstApp.AppSinkNewSampleCallback(appsink, *user_data)
Parameters:
Returns:

Gst.FlowReturn.OK on success.

Return type:

Gst.FlowReturn

Called when a new sample is available. This callback is called from the streaming thread. The new sample can be retrieved with GstApp.AppSink.pull_sample() either from this callback or from any other thread.

New in version 1.28.

GstApp.AppSinkProposeAllocationCallback(appsink, query, *user_data)
Parameters:
Returns:

True when the query has been handled.

Return type:

bool

Called when the propose_allocation query is available. This callback is called from the streaming thread.

New in version 1.28.

GstApp.AppSrcEnoughDataCallback(appsrc, *user_data)
Parameters:

Called when appsrc has enough data. It is recommended that the application stops calling push-buffer until the need_data callback is emitted again to avoid excessive buffer queueing.

New in version 1.28.

GstApp.AppSrcNeedDataCallback(appsrc, length, *user_data)
Parameters:

Called when the appsrc needs more data. A buffer or EOS should be pushed to appsrc from this thread or another thread. length is just a hint and when it is set to -1, any number of bytes can be pushed into appsrc.

New in version 1.28.

GstApp.AppSrcSeekDataCallback(appsrc, offset, *user_data)
Parameters:
Returns:

True if the seek was successful.

Return type:

bool

Called when a seek should be performed to the offset. The next push-buffer should produce buffers from the new offset. This callback is only called for seekable stream types.

New in version 1.28.