mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-04 15:36:35 +00:00
48a5bce689
What still needs to be done is to add a way to set a custom lock to the task, currently a newly created task can only get a lock by making it a pad task.
39 lines
933 B
Text
39 lines
933 B
Text
[DllImport ("gstreamersharpglue-0.10") ]
|
|
extern static uint gstsharp_gst_task_get_cond_offset ();
|
|
|
|
static uint cond_offset = gstsharp_gst_task_get_cond_offset ();
|
|
private IntPtr CondPtr {
|
|
get {
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*) ( ( (byte*) Handle) + cond_offset);
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
[DllImport ("libglib-2.0-0.dll") ]
|
|
static extern void g_cond_wait (IntPtr cond, IntPtr mutex);
|
|
[DllImport ("libglib-2.0-0.dll") ]
|
|
static extern void g_cond_signal (IntPtr cond);
|
|
|
|
public void Wait () {
|
|
g_cond_wait (CondPtr, LockPtr);
|
|
}
|
|
|
|
public void Signal () {
|
|
g_cond_signal (CondPtr);
|
|
}
|
|
|
|
[DllImport ("gstreamersharpglue-0.10") ]
|
|
extern static uint gstsharp_gst_task_get_running_offset ();
|
|
|
|
static uint running_offset = gstsharp_gst_task_get_running_offset ();
|
|
public bool IsRunning {
|
|
get {
|
|
unsafe {
|
|
bool* raw_ptr = (bool*) ( ( (byte*) Handle) + running_offset);
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|