GNOME Bugzilla – Bug 133528
sincesrc seems not to register its dparams correctly
Last modified: 2004-12-22 21:47:04 UTC
when invoking gst-register-0.7 sinesrc I get : Dynamic Parameters: freq : unknown 60 volume : unknown 60 apart from that, the included demo behaves strange. especially the first slider does not work (when once clicked, it jumps out of the window). > ./demo_dparams creating elements (demo_dparams:25777): GLib-GObject-CRITICAL **: file gobject.c: line 987 (g_object_set): assertion `G_IS_OBJECT (object)' failed (demo_dparams:25777): GLib-GObject-CRITICAL **: file gobject.c: line 987 (g_object_set): assertion `G_IS_OBJECT (object)' failed setting value to 1.000000 setting value to 6.110352 starting pipeline (demo_dparams:25777): GLib-GObject-CRITICAL **: file gvaluetypes.c: line 707 (g_value_set_float): assertion `G_VALUE_HOLDS_FLOAT (value)' failed (demo_dparams:25777): GLib-GObject-CRITICAL **: file gvaluetypes.c: line 707 (g_value_set_float): assertion `G_VALUE_HOLDS_FLOAT (value)' failed
note that sinesrc doesn't currently use its dparams to control the signal.
I found the bug, it was using g_param_spec_double() instead of g_param_spec_float()
Created attachment 24362 [details] [review] fixes dparam registration
verified and commited to HEAD, thanks.
These dparams should be using double. The only reason (ever) to use float is when you have lots of data, like in float audio.
wouldn't it make sense to implement the rest of the infrastructure first and just adding a comment to the sinesrc-plugin, instead of just breaking it (by using double).
Created attachment 24386 [details] [review] changes all params from double to float (so that all gobject warnings are gone)
as dparams do not support doubles and there is no real need for the sinesrc to use doubles (for the parameters) the patch (02/13/04 11:14) makes them all float. The source-code of gst/sine/gstsinesrc.c gives no reason for these params to be double.
Likewise, there's no reason for the object properties or dparams to be float. The correct solution is to fix dparams to support doubles.
Done.
I've just upfdates from cvs and the issue is not fixed. 1.) The demo_dparams application dumps a lot of assertion (G_VALUE_HOLDS_DOUBLE) as prior my patch and doe not work. 2.) The broken gst-inspect behaviour is back after reverting my suggested patch. So please revert to use float-dparams or fix it everywhere!
Created attachment 24512 [details] [review] added support for double dparams
Created attachment 24515 [details] [review] fixed double support in dparam_smooth
Created attachment 24516 [details] [review] fixed double dparam support in the manager
still (after adding all the patches above) I get the following assertions (process:25610): GLib-GObject-CRITICAL **: file gvaluetypes.c: line 732 (g_value_get_double): assertion `G_VALUE_HOLDS_DOUBLE (value)' failed (process:25610): GLib-GObject-CRITICAL **: file gvaluetypes.c: line 732 (g_value_get_double): assertion `G_VALUE_HOLDS_DOUBLE (value)' failed in the g_object_set_property() call below: audiosrcParam = gst_dpman_get_manager(audiosrc); gst_dpman_set_mode(audiosrcParam, "synchronous"); vol = gst_dparam_new(G_TYPE_DOUBLE); if (gst_dpman_attach_dparam(audiosrcParam, "volume", vol)){ vol_doubleval = atof(argv[3])/100.0; vol_val = g_new0(GValue,1); g_value_init(vol_val, G_TYPE_DOUBLE); g_value_set_double(vol_val, vol_doubleval); g_object_set_property(G_OBJECT(vol), "value_double", vol_val); }
Silly us. The problem was that the volume element was still using float dparams. It should work now.