gstreamer/gstreamer-sharp/glue/controlsource.c

47 lines
1.2 KiB
C
Raw Normal View History

2009-05-31 19:10:45 +00:00
#include <gst/gst.h>
#include <gst/controller/gstcontrolsource.h>
guint
gst__controllersharp_gst__controller_controlsource_get_get_value_offset (void)
{
2009-09-20 08:19:49 +00:00
return (guint) G_STRUCT_OFFSET (GstControlSource, get_value);
2009-05-31 19:10:45 +00:00
}
const gchar *__gtype_prefix = "__gtksharp_";
#define HAS_PREFIX(a) (*((guint64 *)(a)) == *((guint64 *) __gtype_prefix))
static GObjectClass *
2009-09-20 08:19:49 +00:00
get_threshold_class (GObject * obj)
2009-05-31 19:10:45 +00:00
{
2009-09-20 08:19:49 +00:00
GObjectClass *klass;
GType gtype = G_TYPE_FROM_INSTANCE (obj);
2009-09-20 08:19:49 +00:00
while (HAS_PREFIX (g_type_name (gtype)))
gtype = g_type_parent (gtype);
klass = g_type_class_peek (gtype);
if (klass == NULL)
klass = g_type_class_ref (gtype);
return klass;
2009-05-31 19:10:45 +00:00
}
2009-09-20 08:19:49 +00:00
gboolean
gst__controllersharp_gst__controller_controlsource_base_bind (GstControlSource *
csource, GParamSpec * pspec)
2009-05-31 19:10:45 +00:00
{
2009-09-20 08:19:49 +00:00
GstControlSourceClass *parent =
(GstControlSourceClass *) get_threshold_class (G_OBJECT (csource));
if (parent->bind)
return parent->bind (csource, pspec);
return FALSE;
2009-05-31 19:10:45 +00:00
}
2009-09-20 08:19:49 +00:00
void
gst__controllersharp_gst__controller_controlsource_override_bind (GType gtype,
gpointer cb)
2009-05-31 19:10:45 +00:00
{
2009-09-20 08:19:49 +00:00
GstControlSourceClass *klass = g_type_class_peek (gtype);
if (!klass)
klass = g_type_class_ref (gtype);
((GstControlSourceClass *) klass)->bind = cb;
2009-05-31 19:10:45 +00:00
}