diff options
author | Erik Walthinsen <omega@temple-baptist.org> | 2001-06-25 01:20:11 +0000 |
---|---|---|
committer | Erik Walthinsen <omega@temple-baptist.org> | 2001-06-25 01:20:11 +0000 |
commit | 7f8d8fe8d5c184f05ad388b3f2ea19383a2954f9 (patch) | |
tree | 5948ecb95948b38c7cdf316585a741c442d0a31e /plugins/elements/gsttee.c | |
parent | 2703619624604e7cf1fc5e9cb5908f60cf5704c9 (diff) |
Merged from GOBJECT1 to HEAD at 200106241GOBJECT1-200106241
Original commit message from CVS:
Merged from GOBJECT1 to HEAD at 200106241
Diffstat (limited to 'plugins/elements/gsttee.c')
-rw-r--r-- | plugins/elements/gsttee.c | 64 |
1 files changed, 43 insertions, 21 deletions
diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index 67ab4b1541..0e1b418f61 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -63,7 +63,8 @@ static void gst_tee_init (GstTee *tee); static GstPad* gst_tee_request_new_pad (GstElement *element, GstPadTemplate *temp); -static void gst_tee_get_arg (GtkObject *object, GtkArg *arg, guint id); +static void gst_tee_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); +static void gst_tee_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); static void gst_tee_chain (GstPad *pad, GstBuffer *buf); @@ -71,22 +72,22 @@ static GstElementClass *parent_class = NULL; //static guint gst_tee_signals[LAST_SIGNAL] = { 0 }; static GstPadTemplate *gst_tee_src_template; -GtkType +GType gst_tee_get_type(void) { - static GtkType tee_type = 0; + static GType tee_type = 0; if (!tee_type) { - static const GtkTypeInfo tee_info = { - "GstTee", + static const GTypeInfo tee_info = { + sizeof(GstTeeClass), NULL, + NULL, + (GClassInitFunc)gst_tee_class_init, + NULL, + NULL, sizeof(GstTee), - sizeof(GstTeeClass), - (GtkClassInitFunc)gst_tee_class_init, - (GtkObjectInitFunc)gst_tee_init, - (GtkArgSetFunc)NULL, - (GtkArgGetFunc)NULL, - (GtkClassInitFunc)NULL, + 0, + (GInstanceInitFunc)gst_tee_init, }; - tee_type = gtk_type_unique (GST_TYPE_ELEMENT, &tee_info); + tee_type = g_type_register_static (GST_TYPE_ELEMENT, "GstTee", &tee_info, 0); } return tee_type; } @@ -94,18 +95,20 @@ gst_tee_get_type(void) { static void gst_tee_class_init (GstTeeClass *klass) { - GtkObjectClass *gtkobject_class; + GObjectClass *gobject_class; GstElementClass *gstelement_class; - gtkobject_class = (GtkObjectClass*)klass; + gobject_class = (GObjectClass*)klass; gstelement_class = (GstElementClass*)klass; - parent_class = gtk_type_class(GST_TYPE_ELEMENT); + parent_class = g_type_class_ref(GST_TYPE_ELEMENT); - gtk_object_add_arg_type ("GstTee::num_pads", GTK_TYPE_INT, - GTK_ARG_READABLE, ARG_NUM_PADS); + g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_NUM_PADS, + g_param_spec_int("num_pads","num_pads","num_pads", + G_MININT,G_MAXINT,0,G_PARAM_READABLE)); // CHECKME - gtkobject_class->get_arg = gst_tee_get_arg; + gobject_class->set_property = gst_tee_set_property; + gobject_class->get_property = gst_tee_get_property; gstelement_class->request_new_pad = gst_tee_request_new_pad; } @@ -149,7 +152,7 @@ gst_tee_request_new_pad (GstElement *element, GstPadTemplate *templ) } static void -gst_tee_get_arg (GtkObject *object, GtkArg *arg, guint id) +gst_tee_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GstTee *tee; @@ -158,9 +161,28 @@ gst_tee_get_arg (GtkObject *object, GtkArg *arg, guint id) tee = GST_TEE (object); - switch(id) { + switch (prop_id) { +// case ARG_NUM_PADS: +// g_value_set_int (value, tee->numsrcpads); +// break; + default: + break; + } +} + +static void +gst_tee_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +{ + GstTee *tee; + + /* it's not null if we got it, but it might not be ours */ + g_return_if_fail (GST_IS_TEE (object)); + + tee = GST_TEE (object); + + switch (prop_id) { case ARG_NUM_PADS: - GTK_VALUE_INT (*arg) = tee->numsrcpads; + g_value_set_int (value, tee->numsrcpads); break; default: break; |