GList *tmp, *structures = structs_parse_from_gfile (f);
for (tmp = structures; tmp; tmp = tmp->next) {
- if (gst_structure_has_name (tmp->data, "description")) {
+ GstValidateActionType *type =
+ _find_action_type (gst_structure_get_name (tmp->data));
+
+ if (gst_structure_has_name (tmp->data, "description"))
desc = gst_structure_copy (tmp->data);
- } else if (gst_structure_has_name (tmp->data, "pause") ||
- (gst_structure_has_name (tmp->data, "set-state") &&
- g_strcmp0 (gst_structure_get_string (tmp->data, "state"),
- "paused") == 0)) {
+ else if (type && type->flags & GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK)
needs_clock_sync = TRUE;
- }
}
if (needs_clock_sync) {
"Seeks into the stream, example of a seek happening when the stream reaches 5 seconds\n"
"or 1 eighth of its duration and seeks at 10sec or 2 eighth of its duration:\n"
" seek, playback-time=\"min(5.0, (duration/8))\", start=\"min(10, 2*(duration/8))\", flags=accurate+flush",
- GST_VALIDATE_ACTION_TYPE_NONE
+ GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK
);
REGISTER_ACTION_TYPE ("pause", _execute_pause,
}),
"Sets pipeline to PAUSED. You can add a 'duration'\n"
"parametter so the pipeline goes back to playing after that duration\n"
- "(in second)", GST_VALIDATE_ACTION_TYPE_NONE);
+ "(in second)",
+ GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK & GST_VALIDATE_ACTION_TYPE_ASYNC);
REGISTER_ACTION_TYPE ("play", _execute_play, NULL,
"Sets the pipeline state to PLAYING", GST_VALIDATE_ACTION_TYPE_NONE);
{NULL}
}),
"Changes the state of the pipeline to any GstState",
- GST_VALIDATE_ACTION_TYPE_ASYNC);
+ GST_VALIDATE_ACTION_TYPE_ASYNC & GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK);
REGISTER_ACTION_TYPE ("set-property", _execute_set_property,
((GstValidateActionParameter []) {
* @GST_VALIDATE_ACTION_TYPE_INTERLACED: The action will be executed async
* but without blocking further actions
* to be executed
+ * @GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK: The pipeline will need to be synchronized with the clock
+ * for that action type to be used.
*/
typedef enum
{
GST_VALIDATE_ACTION_TYPE_CONFIG = 1 << 1,
GST_VALIDATE_ACTION_TYPE_ASYNC = 1 << 2,
GST_VALIDATE_ACTION_TYPE_INTERLACED = 1 << 3,
+ GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK = 1 << 5,
} GstValidateActionTypeFlags;
struct _GstValidateActionType