mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:36:20 +00:00
rpicamsrc: colorbalance: protect with config_lock mutex
This commit is contained in:
parent
c51503fc41
commit
961cf17c97
1 changed files with 6 additions and 2 deletions
|
@ -519,7 +519,7 @@ gst_rpi_cam_src_colorbalance_set_value (GstColorBalance * balance,
|
||||||
g_return_if_fail (GST_IS_RPICAMSRC (src));
|
g_return_if_fail (GST_IS_RPICAMSRC (src));
|
||||||
g_return_if_fail (channel->label != NULL);
|
g_return_if_fail (channel->label != NULL);
|
||||||
|
|
||||||
GST_OBJECT_LOCK (src);
|
g_mutex_lock (&src->config_lock);
|
||||||
if (!g_ascii_strcasecmp (channel->label, "SATURATION")) {
|
if (!g_ascii_strcasecmp (channel->label, "SATURATION")) {
|
||||||
changed = value != src->capture_config.camera_parameters.saturation;
|
changed = value != src->capture_config.camera_parameters.saturation;
|
||||||
src->capture_config.camera_parameters.saturation = value;
|
src->capture_config.camera_parameters.saturation = value;
|
||||||
|
@ -534,7 +534,7 @@ gst_rpi_cam_src_colorbalance_set_value (GstColorBalance * balance,
|
||||||
if (changed)
|
if (changed)
|
||||||
src->capture_config.change_flags |= PROP_CHANGE_COLOURBALANCE;
|
src->capture_config.change_flags |= PROP_CHANGE_COLOURBALANCE;
|
||||||
|
|
||||||
GST_OBJECT_UNLOCK (src);
|
g_mutex_unlock (&src->config_lock);
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
gst_color_balance_value_changed (balance, channel,
|
gst_color_balance_value_changed (balance, channel,
|
||||||
|
@ -553,6 +553,8 @@ gst_rpi_cam_src_colorbalance_get_value (GstColorBalance * balance,
|
||||||
g_return_val_if_fail (GST_IS_RPICAMSRC (src), 0);
|
g_return_val_if_fail (GST_IS_RPICAMSRC (src), 0);
|
||||||
g_return_val_if_fail (channel->label != NULL, 0);
|
g_return_val_if_fail (channel->label != NULL, 0);
|
||||||
|
|
||||||
|
g_mutex_lock (&src->config_lock);
|
||||||
|
|
||||||
if (!g_ascii_strcasecmp (channel->label, "SATURATION")) {
|
if (!g_ascii_strcasecmp (channel->label, "SATURATION")) {
|
||||||
value = src->capture_config.camera_parameters.saturation;
|
value = src->capture_config.camera_parameters.saturation;
|
||||||
} else if (!g_ascii_strcasecmp (channel->label, "BRIGHTNESS")) {
|
} else if (!g_ascii_strcasecmp (channel->label, "BRIGHTNESS")) {
|
||||||
|
@ -561,6 +563,8 @@ gst_rpi_cam_src_colorbalance_get_value (GstColorBalance * balance,
|
||||||
value = src->capture_config.camera_parameters.contrast;
|
value = src->capture_config.camera_parameters.contrast;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_mutex_unlock (&src->config_lock);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue