[gst-devel] problem with g_object properties

Corentin Baron corentin.baron at inrialpes.fr
Fri Apr 28 06:09:13 CEST 2006


Thomas Vander Stichele wrote:

>(SNIP)
>
>  
>
>>I'm writing a gstreamer plugin for a video streaming library we use at 
>>work (called blinky, but that's not the point here), and I've got a 
>>problem with my plugin's properties. When I set the property at first, 
>>it seems correctly set, but alas when I set the state of my test 
>>pipeline to PLAYING the property is broken.
>>    
>>
>
>You should also show were you register your object properties, it is
>possible you made a mistake there.
>
>Thomas
>  
>
The properties are registered in the class_init function:

static void
gst_blinkysrc_class_init (GstBlinkySrcClass *klass)
{
  GObjectClass *gobject_class;
  GstElementClass *gstelement_class;

  gobject_class = (GObjectClass*) klass;
  gstelement_class = (GstElementClass*) klass;

  parent_class = g_type_class_ref (GST_TYPE_ELEMENT);

  g_object_class_install_property (gobject_class, ARG_SILENT,
    g_param_spec_boolean ("silent", "Silent", "Produce verbose output ?",
                          FALSE, G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class, ARG_BL_DEVICE,
    g_param_spec_string ("device", "Device", "Blinky device to get data
from.",
                          "0", G_PARAM_READWRITE));
  g_object_class_install_property (gobject_class, ARG_BL_SYNCHRONIZE,
    g_param_spec_boolean ("sync", "Synchronize", "Synchronize with
blinky device ?",
                          FALSE, G_PARAM_READWRITE));

  gobject_class->set_property = gst_blinkysrc_set_property;
  gobject_class->get_property = gst_blinkysrc_get_property;

  gstelement_class->change_state = gst_blinky_src_change_state;
}

I used a plugin template perl script made by Luca Ognibene to generate
the skeleton of my plugin.

Thx,
Corentin.





More information about the gstreamer-devel mailing list