mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 17:20:36 +00:00
spectrum: improve property setter
consistently only update if the property actualy changed the value. Do it without reading the gvalue twice. No need to reset the spectrum analyzer for threshold changes.
This commit is contained in:
parent
61f22f4379
commit
50a139de85
1 changed files with 17 additions and 20 deletions
|
@ -331,31 +331,28 @@ gst_spectrum_set_property (GObject * object, guint prop_id,
|
|||
case PROP_MESSAGE_PHASE:
|
||||
filter->message_phase = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_INTERVAL:
|
||||
GST_BASE_TRANSFORM_LOCK (filter);
|
||||
filter->interval = g_value_get_uint64 (value);
|
||||
gst_spectrum_reset_state (filter);
|
||||
GST_BASE_TRANSFORM_UNLOCK (filter);
|
||||
break;
|
||||
case PROP_BANDS:
|
||||
GST_BASE_TRANSFORM_LOCK (filter);
|
||||
|
||||
if (filter->bands == g_value_get_uint (value)) {
|
||||
case PROP_INTERVAL:{
|
||||
guint64 interval = g_value_get_uint64 (value);
|
||||
if (filter->interval != interval) {
|
||||
GST_BASE_TRANSFORM_LOCK (filter);
|
||||
filter->interval = g_value_get_uint64 (value);
|
||||
gst_spectrum_reset_state (filter);
|
||||
GST_BASE_TRANSFORM_UNLOCK (filter);
|
||||
break;
|
||||
}
|
||||
|
||||
filter->bands = g_value_get_uint (value);
|
||||
|
||||
gst_spectrum_reset_state (filter);
|
||||
|
||||
GST_BASE_TRANSFORM_UNLOCK (filter);
|
||||
}
|
||||
break;
|
||||
case PROP_BANDS:{
|
||||
guint bands = g_value_get_uint (value);
|
||||
if (filter->bands != bands) {
|
||||
GST_BASE_TRANSFORM_LOCK (filter);
|
||||
filter->bands = bands;
|
||||
gst_spectrum_reset_state (filter);
|
||||
GST_BASE_TRANSFORM_UNLOCK (filter);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case PROP_THRESHOLD:
|
||||
GST_BASE_TRANSFORM_LOCK (filter);
|
||||
filter->threshold = g_value_get_int (value);
|
||||
gst_spectrum_reset_state (filter);
|
||||
GST_BASE_TRANSFORM_UNLOCK (filter);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
|
|
Loading…
Reference in a new issue