Commit c217346f authored by Thibault Saunier's avatar Thibault Saunier 🌵

structured-interface: Add support for setting effects inpoint

Part-of: <!187>
parent f070373d
......@@ -155,6 +155,11 @@ static GESCommandLineOption options[] = {
"element-name", "e", 0, NULL,
"The name of the element to apply the effect on."
},
{
"inpoint", "i", GST_TYPE_CLOCK_TIME, NULL,
"Implies that the effect has a internal content"
"(see [ges_track_element_set_has_internal_source](ges_track_element_set_has_internal_source))",
},
{
"name", "n", 0, "child-name",
"The name to be given to the effect."
......
......@@ -567,7 +567,7 @@ _ges_container_add_child_from_struct (GESTimeline * timeline,
const gchar *container_name, *child_name, *child_type, *id;
gboolean res = TRUE;
const gchar *valid_fields[] = { "container-name", "asset-id",
const gchar *valid_fields[] = { "container-name", "asset-id", "inpoint",
"child-type", "child-name", "project-uri", NULL
};
......@@ -637,6 +637,45 @@ _ges_container_add_child_from_struct (GESTimeline * timeline,
else
child_name = GES_TIMELINE_ELEMENT_NAME (child);
if (gst_structure_has_field (structure, "inpoint")) {
GstClockTime inpoint;
GESFrameNumber finpoint;
if (!GES_IS_TRACK_ELEMENT (child)) {
*error = g_error_new (GES_ERROR, 0, "Child %s is not a trackelement"
", can't set inpoint.", child_name);
gst_object_unref (child);
goto beach;
}
if (!ges_util_structure_get_clocktime (structure, "inpoint", &inpoint,
&finpoint)) {
*error = g_error_new (GES_ERROR, 0, "Could not use inpoint.");
gst_object_unref (child);
goto beach;
}
if (!ges_track_element_set_has_internal_source (GES_TRACK_ELEMENT (child),
TRUE)) {
*error =
g_error_new (GES_ERROR, 0,
"Could not set inpoint as %s can't have an internal source",
child_name);
gst_object_unref (child);
goto beach;
}
if (GES_FRAME_NUMBER_IS_VALID (finpoint))
inpoint = ges_timeline_get_frame_time (timeline, finpoint);
ges_timeline_element_set_inpoint (child, inpoint);
}
res = ges_container_add (container, child);
if (res == FALSE) {
g_error_new (GES_ERROR, 0, "Could not add child to container");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment