Fix the Gst.Task bindings

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.
This commit is contained in:
Sebastian Dröge 2009-04-27 12:34:20 +02:00
parent 658c39e785
commit 48a5bce689
5 changed files with 67 additions and 0 deletions

View file

@ -700,6 +700,19 @@
<attr path="/api/namespace/struct[@name='TypeFind']/method[@name='Register']" name="hidden">1</attr>
<!-- FIXME: Bug https://bugzilla.novell.com/show_bug.cgi?id=323372 -->
<attr path="/api/namespace/object[@name='Task']/field" name="hidden">1</attr>
<attr path="/api/namespace/object[@name='Task']/method[@cname='gst_task_cleanup_all']" name="hidden">1</attr>
<remove-node path="/api/namespace/object[@name='Task']/method[@cname='gst_task_create']" />>
<add-node path="/api/namespace/object[@name='Task']">
<constructor cname="gst_task_create">
<parameters>
<parameter type="GstTaskFunction" name="func" />
<parameter type="gpointer" name="data" />
</parameters>
</constructor>
</add-node>
<!-- FIXME: Bug https://bugzilla.novell.com/show_bug.cgi?id=323372 -->
<attr path="/api/namespace/object[@name='TypeFindFactory']/field[@name='Caps']" name="hidden">1</attr>
<!-- FIXME: Bug https://bugzilla.novell.com/show_bug.cgi?id=323372 -->

View file

@ -66,6 +66,7 @@ customs = \
Object.custom \
PadTemplate.custom \
Plugin.custom \
Task.custom \
MiniObject.custom \
Registry.custom \
Query.custom \

View file

@ -0,0 +1,39 @@
[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);
}
}
}

View file

@ -10,6 +10,7 @@ libgstreamersharpglue_0_10_la_SOURCES = \
bin.c \
structure.c \
taglist.c \
task.c \
object.c \
gobject.c

View file

@ -0,0 +1,13 @@
#include <gst/gst.h>
uint
gstsharp_gst_task_get_cond_offset (void)
{
return (uint) G_STRUCT_OFFSET (GstTask, cond);
}
uint
gstsharp_gst_task_get_running_offset (void)
{
return (uint) G_STRUCT_OFFSET (GstTask, running);
}