mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-08 13:18:52 +00:00
debug: change rndbuffersize properties from long to int
These should all be int instead of long, to avoid bugs when passing these as varargs with g_object_set(), and there was no reason to use long in the first place here. Fixes FIXME.
This commit is contained in:
parent
a1948e34d2
commit
98e415dc9d
1 changed files with 11 additions and 14 deletions
|
@ -46,8 +46,8 @@ struct _GstRndBufferSize
|
||||||
|
|
||||||
/*< private > */
|
/*< private > */
|
||||||
GRand *rand;
|
GRand *rand;
|
||||||
gulong seed;
|
guint seed;
|
||||||
glong min, max;
|
gint min, max;
|
||||||
|
|
||||||
GstPad *sinkpad, *srcpad;
|
GstPad *sinkpad, *srcpad;
|
||||||
guint64 offset;
|
guint64 offset;
|
||||||
|
@ -125,20 +125,17 @@ gst_rnd_buffer_size_class_init (GstRndBufferSizeClass * klass)
|
||||||
gstelement_class->change_state =
|
gstelement_class->change_state =
|
||||||
GST_DEBUG_FUNCPTR (gst_rnd_buffer_size_change_state);
|
GST_DEBUG_FUNCPTR (gst_rnd_buffer_size_change_state);
|
||||||
|
|
||||||
/* FIXME 0.11: these should all be int instead of long, to avoid bugs
|
|
||||||
* when passing these as varargs with g_object_set(), and there was no
|
|
||||||
* reason to use long in the first place here */
|
|
||||||
g_object_class_install_property (gobject_class, ARG_SEED,
|
g_object_class_install_property (gobject_class, ARG_SEED,
|
||||||
g_param_spec_ulong ("seed", "random number seed",
|
g_param_spec_uint ("seed", "random number seed",
|
||||||
"seed for randomness (initialized when going from READY to PAUSED)",
|
"seed for randomness (initialized when going from READY to PAUSED)",
|
||||||
0, G_MAXUINT32, DEFAULT_SEED,
|
0, G_MAXUINT32, DEFAULT_SEED,
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
||||||
g_object_class_install_property (gobject_class, ARG_MINIMUM,
|
g_object_class_install_property (gobject_class, ARG_MINIMUM,
|
||||||
g_param_spec_long ("min", "mininum", "mininum buffer size",
|
g_param_spec_int ("min", "mininum", "mininum buffer size",
|
||||||
0, G_MAXINT32, DEFAULT_MIN,
|
0, G_MAXINT32, DEFAULT_MIN,
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
||||||
g_object_class_install_property (gobject_class, ARG_MAXIMUM,
|
g_object_class_install_property (gobject_class, ARG_MAXIMUM,
|
||||||
g_param_spec_long ("max", "maximum", "maximum buffer size",
|
g_param_spec_int ("max", "maximum", "maximum buffer size",
|
||||||
1, G_MAXINT32, DEFAULT_MAX,
|
1, G_MAXINT32, DEFAULT_MAX,
|
||||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS));
|
||||||
}
|
}
|
||||||
|
@ -182,13 +179,13 @@ gst_rnd_buffer_size_set_property (GObject * object, guint prop_id,
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case ARG_SEED:
|
case ARG_SEED:
|
||||||
self->seed = g_value_get_ulong (value);
|
self->seed = g_value_get_uint (value);
|
||||||
break;
|
break;
|
||||||
case ARG_MINIMUM:
|
case ARG_MINIMUM:
|
||||||
self->min = g_value_get_long (value);
|
self->min = g_value_get_int (value);
|
||||||
break;
|
break;
|
||||||
case ARG_MAXIMUM:
|
case ARG_MAXIMUM:
|
||||||
self->max = g_value_get_long (value);
|
self->max = g_value_get_int (value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
@ -205,13 +202,13 @@ gst_rnd_buffer_size_get_property (GObject * object, guint prop_id,
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case ARG_SEED:
|
case ARG_SEED:
|
||||||
g_value_set_ulong (value, self->seed);
|
g_value_set_uint (value, self->seed);
|
||||||
break;
|
break;
|
||||||
case ARG_MINIMUM:
|
case ARG_MINIMUM:
|
||||||
g_value_set_long (value, self->min);
|
g_value_set_int (value, self->min);
|
||||||
break;
|
break;
|
||||||
case ARG_MAXIMUM:
|
case ARG_MAXIMUM:
|
||||||
g_value_set_long (value, self->max);
|
g_value_set_int (value, self->max);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
|
|
Loading…
Reference in a new issue