seek, name=Fast-forward-seek, playback-time="min(20.0, $(duration) * 0.125)", rate=8.0, start=0.0, flags="$(default_flags)"
seek, name=Fast-forward-seek, playback-time="min(40.0, $(duration) * 0.25)", rate=16.0, start=0.0, flags="$(default_flags)"
seek, name=Fast-forward-seek, playback-time="min(80.0, $(duration) * 0.50)", rate=32.0, start=0.0, flags="$(default_flags)"
-wait, message-type=eos
-stop
\ No newline at end of file
+stop, playback-time="min($(duration) - 0.3, 160.0)", on-message="eos"
seek, name=First-forward-seek, playback-time="min(5.0, ($(duration)/8))", start="min(10, 2*($(duration)/8))", flags="$(default_flags)"
seek, name=Second-forward-seek, playback-time="min(15.0, 3*($(duration)/8))", start="min(20, 4*($(duration)/8))", flags="$(default_flags)"
seek, name=Third-forward-seek, playback-time="min(25, 5*($(duration)/8))", start="min(30.0, 6*($(duration)/8))", flags="$(default_flags)"
-stop, playback-time="min($(duration) - 1, 35)"
+stop, playback-time="min($(duration) - 1, 35)", on-eos=true
\ No newline at end of file
.def = "0.0"
};
+ GstValidateActionParameter on_message_param = {
+ .name = "on-message",
+ .description =
+ "Specify on what message type the action will be executed.\n"
+ " If both 'playback-time' and 'on-message' is specified, the action will be executed\n"
+ " on whatever happens first.",
+ .mandatory = FALSE,
+ .types = "string",
+ .possible_variables = NULL,
+ .def = NULL
+ };
+
+
GstValidateActionType *type = GST_VALIDATE_ACTION_TYPE (source);
g_string_assign (string, "\nAction type:");
g_string_append_printf (string, "\n\n Description: \n %s", desc);
g_free (desc);
- if (!IS_CONFIG_ACTION_TYPE (type->flags))
+ if (!IS_CONFIG_ACTION_TYPE (type->flags)) {
+ g_string_append_printf (string, "\n\n Parameters:");
print_action_parameter (string, type, &playback_time_param);
+ print_action_parameter (string, type, &on_message_param);
+ }
if (type->parameters) {
+ if (IS_CONFIG_ACTION_TYPE (type->flags))
+ g_string_append_printf (string, "\n\n Parameters:");
has_parameters = TRUE;
- g_string_append_printf (string, "\n\n Parameters:");
for (i = 0; type->parameters[i].name; i++) {
print_action_parameter (string, type, &type->parameters[i]);
}
}
static gboolean
+_check_message_type (GstValidateScenario * scenario, GstValidateAction * act,
+ GstMessage * message)
+{
+ return act && message
+ && !g_strcmp0 (gst_structure_get_string (act->structure, "on-message"),
+ gst_message_type_get_name (GST_MESSAGE_TYPE (message)));
+}
+
+static gboolean
_should_execute_action (GstValidateScenario * scenario, GstValidateAction * act,
GstClockTime position, gdouble rate)
{
* synchronously
*/
static gboolean
-execute_next_action (GstValidateScenario * scenario)
+execute_next_action_full (GstValidateScenario * scenario, GstMessage * message)
{
GList *tmp;
gdouble rate = 1.0;
}
}
- if (!_check_position (scenario, act, &position, &rate))
+ if (message) {
+ if (!_check_message_type (scenario, act, message))
+ return G_SOURCE_CONTINUE;
+ } else if (!_check_position (scenario, act, &position, &rate)) {
return G_SOURCE_CONTINUE;
+ }
if (!_should_execute_action (scenario, act, position, rate)) {
_add_execute_actions_gsource (scenario);
" at %" GST_TIME_FORMAT, act->structure, GST_TIME_ARGS (position));
priv->seeked_in_pause = FALSE;
+ if (message)
+ gst_structure_remove_field (act->structure, "playback-time");
+ else
+ gst_structure_remove_field (act->structure, "on-message");
+
act->priv->state = gst_validate_execute_action (type, act);
if (act->priv->state == GST_VALIDATE_EXECUTE_ACTION_ERROR) {
gchar *str = gst_structure_to_string (act->structure);
}
static gboolean
+execute_next_action (GstValidateScenario * scenario)
+{
+ return execute_next_action_full (scenario, NULL);
+}
+
+static gboolean
stop_waiting (GstValidateAction * action)
{
GstValidateScenario *scenario = gst_validate_action_get_scenario (action);
if (priv->message_type)
_check_waiting_for_message (scenario, message);
+ execute_next_action_full (scenario, message);
+
return TRUE;
}