Gst.Task.new
function new(func:Gst.TaskFunction):Gst.Task { // Gjs wrapper for gst_task_new() }
Create a new Task that will repeatedly call the provided func with user_data as a parameter. Typically the task will run in a new thread.
The function cannot be changed after the task has been created. You must create a new Gst.Task to change the function.
This function will not yet create and start a thread. Use Gst.Task.prototype.start or Gst.Task.prototype.pause to create and start the GThread.
Before the task can be used, a GLib.RecMutex must be configured using the Gst.Task.prototype.set_lock function. This lock will always be acquired while func is called.
- func
The Gst.TaskFunction to use
- Returns
A new Gst.Task. MT safe.