From a80401b22c6f8693e733767aec3086296ac6ed05 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Tue, 20 Dec 2011 22:36:18 +0100 Subject: controller: move GstControlledProperty into a separate class Add a GstControlBinding class. This is a preparation for making the controlsources generate double valued control curves and do the gparamspec mapping in the control binding. Now the API in GstObject is again mostly for convenience. --- gst/gstcontrolsource.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'gst/gstcontrolsource.c') diff --git a/gst/gstcontrolsource.c b/gst/gstcontrolsource.c index faffc47e3d..85f242d5fc 100644 --- a/gst/gstcontrolsource.c +++ b/gst/gstcontrolsource.c @@ -51,7 +51,12 @@ #define GST_CAT_DEFAULT control_source_debug GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); -G_DEFINE_ABSTRACT_TYPE (GstControlSource, gst_control_source, G_TYPE_OBJECT); +#define _do_init \ + GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gstcontrolsource", 0, \ + "dynamic parameter control sources"); + +G_DEFINE_ABSTRACT_TYPE_WITH_CODE (GstControlSource, gst_control_source, + G_TYPE_OBJECT, _do_init); static void gst_control_source_class_init (GstControlSourceClass * klass) @@ -60,15 +65,11 @@ gst_control_source_class_init (GstControlSourceClass * klass) /* Has to be implemented by children */ klass->bind = NULL; - - GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gstcontrolsource", 0, - "dynamic parameter control sources"); } static void gst_control_source_init (GstControlSource * self) { - /* Set default handlers that print a warning */ self->get_value = NULL; self->get_value_array = NULL; self->bound = FALSE; @@ -150,8 +151,12 @@ gst_control_source_bind (GstControlSource * self, GParamSpec * pspec) ret = GST_CONTROL_SOURCE_GET_CLASS (self)->bind (self, pspec); - if (ret) + if (ret) { + GST_DEBUG ("bound control source for param %s", pspec->name); self->bound = TRUE; + } else { + GST_DEBUG ("failed to bind control source for param %s", pspec->name); + } return ret; } -- cgit v1.2.1