From: <en...@fr...> - 2005-04-04 09:14:20
|
CVS Root: /cvs/gstreamer Module: gst-sandbox Changes by: ensonic Date: Mon Apr 04 2005 02:14:17 PDT Log message: added gobject code moved plugin inti to separate file Modified files: gst-controller : ChangeLog gst-controller/src: Makefile.am gst-controller.c gst-controller.h Added files: gst-controller/src: plugin.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-sandbox/gst-controller/ChangeLog.diff?r1=1.4&r2=1.5 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-sandbox/gst-controller/src/Makefile.am.diff?r1=1.1&r2=1.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-sandbox/gst-controller/src/gst-controller.c.diff?r1=1.3&r2=1.4 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-sandbox/gst-controller/src/gst-controller.h.diff?r1=1.3&r2=1.4 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-sandbox/gst-controller/src/plugin.c?rev=1.1&content-type=text/vnd.viewcvs-markup ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-sandbox/gst-controller/ChangeLog,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ChangeLog 1 Apr 2005 16:10:18 -0000 1.4 +++ ChangeLog 4 Apr 2005 09:14:01 -0000 1.5 @@ -1,3 +1,13 @@ +2005-04-04 Stefan Kost <en...@us...> + + * src/gst-controller.c: (gst_controller_class_init), + (gst_controller_get_type): + * src/gst-controller.h: + added gobject code + * src/Makefile.am: + * src/plugin.c: (plugin_init): + moved plugin inti to separate file 2005-04-01 Stefan Kost <en...@us...> * src/gst-controller.c: Index: Makefile.am RCS file: /cvs/gstreamer/gst-sandbox/gst-controller/src/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Makefile.am 1 Apr 2005 15:17:02 -0000 1.1 +++ Makefile.am 4 Apr 2005 09:14:03 -0000 1.2 @@ -5,6 +5,7 @@ gst-controller.h libgstcontroller_la_SOURCES = \ + plugin.c \ gst-controller.c lib_LTLIBRARIES = libgstcontroller.la Index: gst-controller.c RCS file: /cvs/gstreamer/gst-sandbox/gst-controller/src/gst-controller.c,v retrieving revision 1.3 diff -u -d -r1.3 -r1.4 --- gst-controller.c 1 Apr 2005 16:10:18 -0000 1.3 +++ gst-controller.c 4 Apr 2005 09:14:03 -0000 1.4 @@ -33,7 +33,7 @@ #include "gst-controller.h" #define GST_CAT_DEFAULT gst_controller_debug -GST_DEBUG_CATEGORY (GST_CAT_DEFAULT); +GST_DEBUG_CATEGORY_EXTERN (GST_CAT_DEFAULT); /* methods */ @@ -252,19 +252,29 @@ } -/* initialisation */ - -static gboolean -plugin_init (GstPlugin * plugin) +static void gst_controller_class_init (GstControllerClass *klass) { - GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gstcontroller", 0, - "dynamic parameter control for gstreamer elements"); - return TRUE; + // register properties and signals -GST_PLUGIN_DEFINE (GST_CONTROLLER_MAJOR_VERSION, GST_CONTROLLER_MINOR_VERSION, - "gstcontroller", "dynamic parameter control for gstreamer elements", - plugin_init, VERSION, GST_CONTROLLER_LICENSE, PACKAGE_NAME, GST_CONTROLLER_ORIGIN -) +GType gst_controller_get_type (void) +{ + static GType type = 0; + if (type == 0) { + static const GTypeInfo info = { + sizeof(GstControllerClass), + NULL, // base_init + NULL, // base_finalize + (GClassInitFunc)gst_controller_class_init, // class_init + NULL, // class_finalize + NULL, // class_data + sizeof(GstController), + 0, // n_preallocs + NULL, // instance_init + NULL // value_table + }; + type = g_type_register_static(G_TYPE_OBJECT,"GstController",&info,0); + } + return type; +} Index: gst-controller.h RCS file: /cvs/gstreamer/gst-sandbox/gst-controller/src/gst-controller.h,v --- gst-controller.h 1 Apr 2005 16:10:18 -0000 1.3 +++ gst-controller.h 4 Apr 2005 09:14:03 -0000 1.4 @@ -7,6 +7,7 @@ #ifndef __GST_CONTROLLER_H__ #define __GST_CONTROLLER_H__ +#include <glib.h> #include <glib-object.h> #include <gst/gst.h> @@ -51,41 +52,24 @@ /** * GstInterpolateMode: + * @GST_INTERPOLATE_NONE: steps-like interpolation, default + * @GST_INTERPOLATE_TRIGGER: Returns the default value of the property, + * except for times with specific values + * @GST_INTERPOLATE_LINEAR: linear interpolation + * @GST_INTERPOLATE_QUADRATIC: square interpolation + * @GST_INTERPOLATE_CUBIC: cubic interpolation + * |GST_INTERPOLATE_USER: user-provided interpolation * - * The various interpolation modes available + * The various interpolation modes available. */ typedef enum - /* - None : steps-like interpolation, default - */ GST_INTERPOLATE_NONE, - Trigger : Returns the default value of the property, - except for times with specific values GST_INTERPOLATE_TRIGGER, - Linear : linear interpolation GST_INTERPOLATE_LINEAR, - Quadratic : square interpolation GST_INTERPOLATE_QUADRATIC, - Cubic : cubic interpolation GST_INTERPOLATE_CUBIC, - User : user-provided interpolation GST_INTERPOLATE_USER } GstInterpolateMode; @@ -105,22 +89,6 @@ GstValueArray *value_array); } GstInterpolateMethod; -/** - * GstController: - * - * The instance structure of GstController - */ -typedef struct _GstController -{ - GObject parent; - GList *properties; // List of GstControlledProperty - GMutex *lock; -} GstController; * GstControlledProperty: @@ -136,7 +104,39 @@ GSList *values; // List of GstTimedValue } GstControlledProperty; +/* type macros */ +#define GST_TYPE_CONTROLLER (gst_controller_get_type ()) +#define GST_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_CONTROLLER, GstController)) +#define GST_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_CONTROLLER, GstControllerClass)) +#define GST_IS_CONTROLLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_CONTROLLER)) +#define GST_IS_CONTROLLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_CONTROLLERE)) +#define GST_CONTROLLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_CONTROLLER, GstControllerClass)) +typedef struct _GstController GstController; +typedef struct _GstControllerClass GstControllerClass; +//typedef struct _GstControllerPrivate GstControllerPrivate; +/** + * GstController: + * + * The instance structure of GstController + */ +struct _GstController + GObject parent; + GList *properties; // List of GstControlledProperty + GMutex *lock; +}; +struct _GstControllerClass + GObjectClass parent_class; +GType gst_controller_get_type (void); GstController *gst_controller_new (GObject * object,gchar * first_property_name, ...); gboolean gst_controller_remove_properties (GstController * controller, --- NEW FILE: plugin.c --- /* * plugin.c * * New dynamic properties * */ #include "config.h" #include <gst/gst.h> /* library initialisation */ #define GST_CAT_DEFAULT gst_controller_debug GST_DEBUG_CATEGORY (GST_CAT_DEFAULT); static gboolean plugin_init (GstPlugin * plugin) { GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gstcontroller", 0, "dynamic parameter control for gstreamer elements"); return TRUE; } GST_PLUGIN_DEFINE (GST_CONTROLLER_MAJOR_VERSION, GST_CONTROLLER_MINOR_VERSION, "gstcontroller", "dynamic parameter control for gstreamer elements", plugin_init, VERSION, GST_CONTROLLER_LICENSE, PACKAGE_NAME, GST_CONTROLLER_ORIGIN ) |