From: Thibault Saunier Date: Sat, 13 Dec 2014 22:12:30 +0000 (+0100) Subject: validate:scenario: Add a Flag fore ActionType that need clocks sync X-Git-Tag: 1.19.3~491^2~1420 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c74f33bd177d5573a88b5170581cf19467b8ddb9;p=platform%2Fupstream%2Fgstreamer.git validate:scenario: Add a Flag fore ActionType that need clocks sync And cleanly use it to set the need-clock-sync field in the scenario properties https://bugzilla.gnome.org/show_bug.cgi?id=743994 --- diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index 557e11f..e15f672 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -1937,14 +1937,13 @@ _parse_scenario (GFile * f, GKeyFile * kf) 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) { @@ -2401,7 +2400,7 @@ init_scenarios (void) "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, @@ -2418,7 +2417,8 @@ init_scenarios (void) }), "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); @@ -2505,7 +2505,7 @@ init_scenarios (void) {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 []) { diff --git a/validate/gst/validate/gst-validate-scenario.h b/validate/gst/validate/gst-validate-scenario.h index f8e61bd..778aef4 100644 --- a/validate/gst/validate/gst-validate-scenario.h +++ b/validate/gst/validate/gst-validate-scenario.h @@ -113,6 +113,8 @@ typedef struct _GstValidateActionType GstValidateActionType; * @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 { @@ -120,6 +122,7 @@ 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