ges-validate: Add start/inpoint/duration params to the add-clip action

This commit is contained in:
Thibault Saunier 2014-09-25 14:57:35 +02:00
parent f4faa487ba
commit 8a6892ba0a

View file

@ -299,13 +299,18 @@ _add_clip (GstValidateScenario * scenario, GstValidateAction * action)
const gchar *type_string; const gchar *type_string;
GType type; GType type;
gboolean res = FALSE; gboolean res = FALSE;
GstClockTime duration = 1 * GST_SECOND; GstClockTime duration = 1 * GST_SECOND, inpoint = 0, start =
GST_CLOCK_TIME_NONE;
gst_structure_get_int (action->structure, "layer-priority", &layer_priority); gst_structure_get_int (action->structure, "layer-priority", &layer_priority);
name = gst_structure_get_string (action->structure, "name"); name = gst_structure_get_string (action->structure, "name");
asset_id = gst_structure_get_string (action->structure, "asset-id"); asset_id = gst_structure_get_string (action->structure, "asset-id");
type_string = gst_structure_get_string (action->structure, "type"); type_string = gst_structure_get_string (action->structure, "type");
gst_validate_action_get_clocktime (scenario, action, "start", &start);
gst_validate_action_get_clocktime (scenario, action, "inpoint", &inpoint);
gst_validate_action_get_clocktime (scenario, action, "duration", &duration);
if (!(type = g_type_from_name (type_string))) { if (!(type = g_type_from_name (type_string))) {
GST_ERROR ("This type doesn't exist : %s", type_string); GST_ERROR ("This type doesn't exist : %s", type_string);
goto beach; goto beach;
@ -331,7 +336,7 @@ _add_clip (GstValidateScenario * scenario, GstValidateAction * action)
duration = GST_CLOCK_TIME_NONE; duration = GST_CLOCK_TIME_NONE;
} }
clip = ges_layer_add_asset (layer, asset, GST_CLOCK_TIME_NONE, 0, duration, clip = ges_layer_add_asset (layer, asset, start, inpoint, duration,
GES_TRACK_TYPE_UNKNOWN); GES_TRACK_TYPE_UNKNOWN);
if (clip) { if (clip) {
@ -347,8 +352,6 @@ _add_clip (GstValidateScenario * scenario, GstValidateAction * action)
gst_object_unref (layer); gst_object_unref (layer);
ges_timeline_commit (timeline);
beach: beach:
g_object_unref (timeline); g_object_unref (timeline);
return res; return res;
@ -583,6 +586,24 @@ ges_validate_register_action_types (void)
.types = "string", .types = "string",
.mandatory = TRUE, .mandatory = TRUE,
}, },
{
.name = "start",
.description = "The start value to set on the new GESClip.",
.types = "double or string",
.mandatory = FALSE,
},
{
.name = "inpoint",
.description = "The inpoint value to set on the new GESClip",
.types = "double or string",
.mandatory = FALSE,
},
{
.name = "duration",
.description = "The duration value to set on the new GESClip",
.types = "double or string",
.mandatory = FALSE,
},
{NULL} {NULL}
}, "Allows to add a clip to a given layer", FALSE); }, "Allows to add a clip to a given layer", FALSE);