mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-03 02:33:53 +00:00
videobalance: Make property access threadsafe
This commit is contained in:
parent
5f396b9a71
commit
37de42977a
1 changed files with 10 additions and 2 deletions
|
@ -177,9 +177,11 @@ static void
|
||||||
gst_video_balance_update_properties (GstVideoBalance * videobalance)
|
gst_video_balance_update_properties (GstVideoBalance * videobalance)
|
||||||
{
|
{
|
||||||
gboolean passthrough = gst_video_balance_is_passthrough (videobalance);
|
gboolean passthrough = gst_video_balance_is_passthrough (videobalance);
|
||||||
|
GstBaseTransform *base = GST_BASE_TRANSFORM (videobalance);
|
||||||
|
|
||||||
gst_base_transform_set_passthrough (GST_BASE_TRANSFORM (videobalance),
|
GST_BASE_TRANSFORM_LOCK (base);
|
||||||
passthrough);
|
base->passthrough = passthrough;
|
||||||
|
GST_BASE_TRANSFORM_UNLOCK (base);
|
||||||
|
|
||||||
if (!passthrough)
|
if (!passthrough)
|
||||||
gst_video_balance_update_tables (videobalance);
|
gst_video_balance_update_tables (videobalance);
|
||||||
|
@ -317,7 +319,9 @@ gst_video_balance_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
|
||||||
if (size != videobalance->size)
|
if (size != videobalance->size)
|
||||||
goto wrong_size;
|
goto wrong_size;
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (videobalance);
|
||||||
videobalance->process (videobalance, data);
|
videobalance->process (videobalance, data);
|
||||||
|
GST_OBJECT_UNLOCK (videobalance);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
@ -501,6 +505,7 @@ gst_video_balance_colorbalance_set_value (GstColorBalance * balance,
|
||||||
g_return_if_fail (GST_IS_VIDEO_FILTER (vb));
|
g_return_if_fail (GST_IS_VIDEO_FILTER (vb));
|
||||||
g_return_if_fail (channel->label != NULL);
|
g_return_if_fail (channel->label != NULL);
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (vb);
|
||||||
if (!g_ascii_strcasecmp (channel->label, "HUE")) {
|
if (!g_ascii_strcasecmp (channel->label, "HUE")) {
|
||||||
new_val = (value + 1000.0) * 2.0 / 2000.0 - 1.0;
|
new_val = (value + 1000.0) * 2.0 / 2000.0 - 1.0;
|
||||||
changed = new_val != vb->hue;
|
changed = new_val != vb->hue;
|
||||||
|
@ -520,6 +525,7 @@ gst_video_balance_colorbalance_set_value (GstColorBalance * balance,
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_video_balance_update_properties (vb);
|
gst_video_balance_update_properties (vb);
|
||||||
|
GST_OBJECT_UNLOCK (vb);
|
||||||
|
|
||||||
gst_color_balance_value_changed (balance, channel,
|
gst_color_balance_value_changed (balance, channel,
|
||||||
gst_color_balance_get_value (balance, channel));
|
gst_color_balance_get_value (balance, channel));
|
||||||
|
@ -580,6 +586,7 @@ gst_video_balance_set_property (GObject * object, guint prop_id,
|
||||||
gdouble d;
|
gdouble d;
|
||||||
const gchar *label = NULL;
|
const gchar *label = NULL;
|
||||||
|
|
||||||
|
GST_OBJECT_LOCK (balance);
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_CONTRAST:
|
case PROP_CONTRAST:
|
||||||
d = g_value_get_double (value);
|
d = g_value_get_double (value);
|
||||||
|
@ -619,6 +626,7 @@ gst_video_balance_set_property (GObject * object, guint prop_id,
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_video_balance_update_properties (balance);
|
gst_video_balance_update_properties (balance);
|
||||||
|
GST_OBJECT_UNLOCK (balance);
|
||||||
|
|
||||||
if (label) {
|
if (label) {
|
||||||
GstColorBalanceChannel *channel =
|
GstColorBalanceChannel *channel =
|
||||||
|
|
Loading…
Reference in a new issue