mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-26 17:18:15 +00:00
validate: Properly expose the commit action as ASYNC
This commit is contained in:
parent
0bb313030b
commit
23c71e8222
1 changed files with 24 additions and 2 deletions
|
@ -438,20 +438,42 @@ beach:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
_commit_done_cb (GstBus * bus, GstMessage * message, GstValidateAction * action)
|
||||||
|
{
|
||||||
|
gst_validate_action_set_done (action);
|
||||||
|
|
||||||
|
g_signal_handlers_disconnect_by_func (bus, _commit_done_cb, action);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_commit (GstValidateScenario * scenario, GstValidateAction * action)
|
_commit (GstValidateScenario * scenario, GstValidateAction * action)
|
||||||
{
|
{
|
||||||
GESTimeline *timeline = get_timeline (scenario);
|
GESTimeline *timeline = get_timeline (scenario);
|
||||||
|
GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (scenario->pipeline));
|
||||||
|
GstState state;
|
||||||
|
|
||||||
gst_validate_printf (action, "Commiting timeline %s\n",
|
gst_validate_printf (action, "Commiting timeline %s\n",
|
||||||
GST_OBJECT_NAME (timeline));
|
GST_OBJECT_NAME (timeline));
|
||||||
|
|
||||||
ges_timeline_commit (timeline);
|
g_signal_connect (bus, "message::async-done", G_CALLBACK (_commit_done_cb),
|
||||||
|
action);
|
||||||
|
|
||||||
|
gst_element_get_state (scenario->pipeline, &state, NULL, 0);
|
||||||
|
if (!ges_timeline_commit (timeline) || state < GST_STATE_PAUSED) {
|
||||||
|
g_signal_handlers_disconnect_by_func (bus, G_CALLBACK (_commit_done_cb),
|
||||||
|
action);
|
||||||
gst_object_unref (timeline);
|
gst_object_unref (timeline);
|
||||||
|
gst_object_unref (bus);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
gst_object_unref (bus);
|
||||||
|
gst_object_unref (timeline);
|
||||||
|
|
||||||
|
return GST_VALIDATE_EXECUTE_ACTION_ASYNC;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
_split_clip (GstValidateScenario * scenario, GstValidateAction * action)
|
_split_clip (GstValidateScenario * scenario, GstValidateAction * action)
|
||||||
|
|
Loading…
Reference in a new issue