switch (prop_id) {
case ARG_DROP:
- GST_OBJECT_LOCK (object);
- valve->drop = g_value_get_boolean (value);
- GST_OBJECT_UNLOCK (object);
+ g_atomic_int_set (&valve->drop, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
switch (prop_id) {
case ARG_DROP:
- GST_OBJECT_LOCK (object);
- g_value_set_boolean (value, valve->drop);
- GST_OBJECT_UNLOCK (object);
+ g_value_set_boolean (value, g_atomic_int_get (&valve->drop));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
{
GstValve *valve = GST_VALVE (gst_pad_get_parent_element (pad));
GstFlowReturn ret = GST_FLOW_OK;
- gboolean drop;
- GST_OBJECT_LOCK (valve);
- drop = valve->drop;
- GST_OBJECT_UNLOCK (valve);
-
- if (drop) {
+ if (g_atomic_int_get (&valve->drop)) {
gst_buffer_unref (buffer);
valve->discont = TRUE;
} else {
/* Ignore errors if "drop" was changed while the thread was blocked
* downwards
*/
- GST_OBJECT_LOCK (valve);
- if (valve->drop)
+ if (g_atomic_int_get (&valve->drop))
ret = GST_FLOW_OK;
- GST_OBJECT_UNLOCK (valve);
gst_object_unref (valve);
{
GstValve *valve = GST_VALVE (gst_pad_get_parent_element (pad));
gboolean ret = TRUE;
- gboolean drop;
-
- GST_OBJECT_LOCK (valve);
- drop = valve->drop;
- GST_OBJECT_UNLOCK (valve);
- if (drop)
+ if (g_atomic_int_get (&valve->drop))
gst_event_unref (event);
else
ret = gst_pad_push_event (valve->srcpad, event);
/* Ignore errors if "drop" was changed while the thread was blocked
* downwards.
*/
- GST_OBJECT_LOCK (valve);
- if (valve->drop)
+ if (g_atomic_int_get (&valve->drop))
ret = TRUE;
- GST_OBJECT_UNLOCK (valve);
gst_object_unref (valve);
return ret;
{
GstValve *valve = GST_VALVE (gst_pad_get_parent_element (pad));
GstFlowReturn ret = GST_FLOW_OK;
- gboolean drop;
-
- GST_OBJECT_LOCK (valve);
- drop = valve->drop;
- GST_OBJECT_UNLOCK (valve);
- if (drop)
+ if (g_atomic_int_get (&valve->drop))
*buf = NULL;
else
ret = gst_pad_alloc_buffer (valve->srcpad, offset, size, caps, buf);
/* Ignore errors if "drop" was changed while the thread was blocked
* downwards
*/
- GST_OBJECT_LOCK (valve);
- if (valve->drop)
+ if (g_atomic_int_get (&valve->drop))
ret = GST_FLOW_OK;
- GST_OBJECT_UNLOCK (valve);
gst_object_unref (valve);