From 0c59e3ce2a86149d611a6caac777f1b45a0c62e1 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 14 Nov 2022 07:27:28 +0100 Subject: [PATCH] validate-scenario: Avoid timeouts on EOS If there is an EOS and the next action is waiting for a playback time, execute it since we are guaranteed the position won't change anymore. Part-of: --- .../gst-devtools/validate/gst/validate/gst-validate-report.c | 2 ++ .../gst-devtools/validate/gst/validate/gst-validate-report.h | 6 ++++++ .../gst-devtools/validate/gst/validate/gst-validate-scenario.c | 10 ++++++++++ 3 files changed, 18 insertions(+) diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.c b/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.c index 1d7a250..0ab9e25 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.c +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.c @@ -534,6 +534,8 @@ gst_validate_report_load_issues (void) GST_VALIDATE_ISSUE_FLAGS_FULL_DETAILS); REGISTER_VALIDATE_ISSUE (ISSUE, SCENARIO_ACTION_EXECUTION_ISSUE, "An issue happened during the execution of a scenario", NULL); + REGISTER_VALIDATE_ISSUE (WARNING, SCENARIO_ACTION_ENDED_EARLY, + "Got EOS before an action playback time", NULL); REGISTER_VALIDATE_ISSUE (CRITICAL, CONFIG_LATENCY_TOO_HIGH, "The pipeline latency is higher than the maximum allowed by the scenario", NULL); diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.h b/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.h index 8a24a87..1f8acd2 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.h +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-report.h @@ -138,6 +138,12 @@ typedef enum { #define SCENARIO_ACTION_CHECK_ERROR _QUARK("scenario::check-error") #define SCENARIO_ACTION_TIMEOUT _QUARK("scenario::action-timeout") #define SCENARIO_ACTION_EXECUTION_ISSUE _QUARK("scenario::execution-issue") +/** + * SCENARIO_ACTION_ENDED_EARLY: + * + * Since: 1.22 + */ +#define SCENARIO_ACTION_ENDED_EARLY _QUARK("scenario::action-ended-early") #define CONFIG_LATENCY_TOO_HIGH _QUARK("config::latency-too-high") #define CONFIG_TOO_MANY_BUFFERS_DROPPED _QUARK("config::too-many-buffers-dropped") diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c b/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c index 696f856..47fec1e 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c @@ -2688,6 +2688,15 @@ execute_next_action_full (GstValidateScenario * scenario, GstMessage * message) return G_SOURCE_CONTINUE; } + if (message && GST_MESSAGE_TYPE (message) == GST_MESSAGE_EOS + && act->playback_time != GST_CLOCK_TIME_NONE) { + GST_VALIDATE_REPORT_ACTION (scenario, act, + SCENARIO_ACTION_ENDED_EARLY, + "Got EOS before action playback time %" GST_TIME_FORMAT, + GST_TIME_ARGS (act->playback_time)); + goto execute_action; + } + switch (act->priv->state) { case GST_VALIDATE_EXECUTE_ACTION_NONE: case GST_VALIDATE_EXECUTE_ACTION_NON_BLOCKING: @@ -2734,6 +2743,7 @@ execute_next_action_full (GstValidateScenario * scenario, GstMessage * message) return G_SOURCE_CONTINUE; } +execute_action: type = _find_action_type (act->type); GST_DEBUG_OBJECT (scenario, "Executing %" GST_PTR_FORMAT -- 2.7.4