mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
scenario: Only modify the actions from the main thread
The action's content is not protected by a mutex, so only modify it from the main thread.
This commit is contained in:
parent
1599c1abd8
commit
0a17bfc2be
1 changed files with 26 additions and 26 deletions
|
@ -2896,6 +2896,21 @@ done:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
_action_set_done (GstValidateAction * action)
|
||||||
|
{
|
||||||
|
if (action->scenario == NULL)
|
||||||
|
return G_SOURCE_REMOVE;
|
||||||
|
|
||||||
|
action->priv->state = _execute_sub_action_action (action);
|
||||||
|
if (action->priv->state != GST_VALIDATE_EXECUTE_ACTION_ASYNC) {
|
||||||
|
GST_DEBUG_OBJECT (action->scenario, "Sub action executed ASYNC");
|
||||||
|
|
||||||
|
execute_next_action (action->scenario);
|
||||||
|
}
|
||||||
|
return G_SOURCE_REMOVE;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_validate_action_set_done (GstValidateAction * action)
|
gst_validate_action_set_done (GstValidateAction * action)
|
||||||
{
|
{
|
||||||
|
@ -2903,38 +2918,23 @@ gst_validate_action_set_done (GstValidateAction * action)
|
||||||
|
|
||||||
if (action->priv->state == GST_VALIDATE_EXECUTE_ACTION_INTERLACED) {
|
if (action->priv->state == GST_VALIDATE_EXECUTE_ACTION_INTERLACED) {
|
||||||
|
|
||||||
if (action->scenario) {
|
if (scenario) {
|
||||||
SCENARIO_LOCK (action->scenario);
|
SCENARIO_LOCK (scenario);
|
||||||
action->scenario->priv->interlaced_actions =
|
scenario->priv->interlaced_actions =
|
||||||
g_list_remove (action->scenario->priv->interlaced_actions, action);
|
g_list_remove (scenario->priv->interlaced_actions, action);
|
||||||
SCENARIO_UNLOCK (action->scenario);
|
SCENARIO_UNLOCK (scenario);
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_validate_action_unref (action);
|
gst_validate_action_unref (action);
|
||||||
}
|
}
|
||||||
|
|
||||||
action->priv->state = _execute_sub_action_action (action);
|
if (GPOINTER_TO_INT (g_private_get (&main_thread_priv))) {
|
||||||
if (action->priv->state == GST_VALIDATE_EXECUTE_ACTION_ASYNC) {
|
_action_set_done (action);
|
||||||
GST_DEBUG_OBJECT (scenario, "Sub action executed ASYNC");
|
} else {
|
||||||
|
g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, (GSourceFunc) _action_set_done,
|
||||||
return;
|
gst_mini_object_ref (GST_MINI_OBJECT (action)),
|
||||||
|
(GDestroyNotify) gst_validate_action_unref);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scenario) {
|
|
||||||
if (GPOINTER_TO_INT (g_private_get (&main_thread_priv))) {
|
|
||||||
if (!scenario->priv->execute_on_idle) {
|
|
||||||
GST_DEBUG_OBJECT (scenario, "Right thread, executing next?");
|
|
||||||
execute_next_action (scenario);
|
|
||||||
|
|
||||||
return;
|
|
||||||
} else
|
|
||||||
GST_DEBUG_OBJECT (scenario, "Right thread, but executing only on idle");
|
|
||||||
} else
|
|
||||||
GST_DEBUG_OBJECT (action->scenario, "Not doing anything outside the"
|
|
||||||
" 'main' thread");
|
|
||||||
}
|
|
||||||
|
|
||||||
_add_execute_actions_gsource (scenario);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue