After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 133528 - sincesrc seems not to register its dparams correctly
sincesrc seems not to register its dparams correctly
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins
git master
Other All
: Normal major
: 0.7.5
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-02-05 17:19 UTC by Stefan Sauer (gstreamer, gtkdoc dev)
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fixes dparam registration (738 bytes, patch)
2004-02-12 17:17 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review
changes all params from double to float (so that all gobject warnings are gone) (911 bytes, patch)
2004-02-13 16:14 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review
added support for double dparams (916 bytes, patch)
2004-02-18 14:37 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review
fixed double support in dparam_smooth (1.10 KB, patch)
2004-02-18 14:59 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review
fixed double dparam support in the manager (613 bytes, patch)
2004-02-18 15:00 UTC, Stefan Sauer (gstreamer, gtkdoc dev)
none Details | Review

Description Stefan Sauer (gstreamer, gtkdoc dev) 2004-02-05 17:19: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
Comment 1 David Schleef 2004-02-05 23:53:57 UTC
note that sinesrc doesn't currently use its dparams to control the signal.
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2004-02-12 17:16:37 UTC
I found the bug, it was using 
  g_param_spec_double()
instead of
  g_param_spec_float()
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2004-02-12 17:17:32 UTC
Created attachment 24362 [details] [review]
fixes dparam registration
Comment 4 Thomas Vander Stichele 2004-02-12 18:14:42 UTC
verified and commited to HEAD, thanks.
Comment 5 David Schleef 2004-02-12 20:54:38 UTC
These dparams should be using double.  The only reason (ever) to use
float is when you have lots of data, like in float audio.
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2004-02-13 10:45:11 UTC
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).
Comment 7 Stefan Sauer (gstreamer, gtkdoc dev) 2004-02-13 16:14:36 UTC
Created attachment 24386 [details] [review]
changes all params from double to float (so that all gobject warnings are gone)
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2004-02-13 16:18:20 UTC
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.
Comment 9 David Schleef 2004-02-13 18:06:10 UTC
Likewise, there's no reason for the object properties or dparams to be
float.

The correct solution is to fix dparams to support doubles.
Comment 10 David Schleef 2004-02-14 02:46:13 UTC
Done.
Comment 11 Stefan Sauer (gstreamer, gtkdoc dev) 2004-02-17 10:58:32 UTC
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!
Comment 12 Stefan Sauer (gstreamer, gtkdoc dev) 2004-02-18 14:37:19 UTC
Created attachment 24512 [details] [review]
added support for double dparams
Comment 13 Stefan Sauer (gstreamer, gtkdoc dev) 2004-02-18 14:59:36 UTC
Created attachment 24515 [details] [review]
fixed double support in dparam_smooth
Comment 14 Stefan Sauer (gstreamer, gtkdoc dev) 2004-02-18 15:00:48 UTC
Created attachment 24516 [details] [review]
fixed double dparam support in the manager
Comment 15 Stefan Sauer (gstreamer, gtkdoc dev) 2004-02-18 17:00:37 UTC
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);
  }
Comment 16 David Schleef 2004-02-19 01:47:12 UTC
Silly us.  The problem was that the volume element was still using
float dparams.  It should work now.