validate: doc: Enhance the way we render action type parameters

And update gst-validate-action-types.md

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5803>
This commit is contained in:
Thibault Saunier 2023-12-12 18:24:55 -03:00 committed by GStreamer Marge Bot
parent f1e34de800
commit 93f1ffe715
5 changed files with 1478 additions and 642 deletions

File diff suppressed because it is too large Load diff

View file

@ -14,4 +14,4 @@ configs = {
Note: Since this is GstStructure syntax, we need to have the structures in the Note: Since this is GstStructure syntax, we need to have the structures in the
array as strings/within quotes. array as strings/within quotes.
**Warning**: This field is validate only for [`.validatetest`](gst-validate-test.md) files, and not `.scenario`. **Warning**: This field is validate only for [`.validatetest`](gst-validate-test-file.md) files, and not `.scenario`.

View file

@ -10,7 +10,7 @@ expected-issues = {
"expected-issue, issue-id=scenario::not-ended", "expected-issue, issue-id=scenario::not-ended",
} }
``` ```
Note: Since this is GstStructure syntax, we need to have the structures in the Note: Since this is [`GstStructure`](GstStructure) syntax, we need to have the structures in the
array as strings/within quotes. array as strings/within quotes.
**Each issue has the following fields**: **Each issue has the following fields**:
@ -20,10 +20,10 @@ array as strings/within quotes.
* `details`: Regex string to match the issue details `detected-on`: (string): * `details`: Regex string to match the issue details `detected-on`: (string):
The name of the element the issue happened on `level`: (string): The name of the element the issue happened on `level`: (string):
Issue level Issue level
* `sometimes`: (boolean): Default: `false` - Wheteher the issue happens only * `sometimes`: (boolean): Default: `false` - Whether the issue happens only
sometimes if `false` and the issue doesn't happen, an error will sometimes if `false` and the issue doesn't happen, an error will
be issued. be issued.
* `issue-url`: (string): The url of the issue in the bug tracker if the issue is * `issue-url`: (string): The url of the issue in the bug tracker if the issue is
a bug. a bug.
**Warning**: This field is validate only for [`.validatetest`](gst-validate-test.md) files, and not `.scenario`. **Warning**: This field is validate only for [`.validatetest`](gst-validate-test-file.md) files, and not `.scenario`.

View file

@ -1041,7 +1041,7 @@ print_action_parameter (GString * string, GstValidateActionType * type,
GstValidateActionParameter * param) GstValidateActionParameter * param)
{ {
gchar *desc; gchar *desc;
g_string_append_printf (string, "\n\n* `%s`:(%s): ", param->name, g_string_append_printf (string, "\n\n#### `%s` (_%s_)\n\n", param->name,
param->mandatory ? "mandatory" : "optional"); param->mandatory ? "mandatory" : "optional");
if (g_strcmp0 (param->description, "")) { if (g_strcmp0 (param->description, "")) {
@ -1057,16 +1057,18 @@ print_action_parameter (GString * string, GstValidateActionType * type,
desc = desc =
g_regex_replace (newline_regex, g_regex_replace (newline_regex,
param->possible_variables, -1, 0, "\n\n * ", 0, NULL); param->possible_variables, -1, 0, "\n\n * ", 0, NULL);
g_string_append_printf (string, "\n\n Possible variables:\n\n * %s", g_string_append_printf (string, "\n\n**Possible variables**:\n\n * %s",
desc); desc);
} }
if (param->types) if (param->types)
g_string_append_printf (string, "\n\n Possible types: `%s`", param->types); g_string_append_printf (string, "\n\n**Possible types**: `%s`",
param->types);
if (!param->mandatory) if (!param->mandatory)
g_string_append_printf (string, "\n\n Default: %s", param->def); g_string_append_printf (string, "\n\n**Default**: %s", param->def);
g_string_append (string, "\n\n---");
} }
static void static void
@ -1180,7 +1182,7 @@ gst_validate_printf_valist (gpointer source, const gchar * format, va_list args)
g_string_append_printf (string, "\n%s", type->description); g_string_append_printf (string, "\n%s", type->description);
g_string_append_printf (string, g_string_append_printf (string,
"\n * Implementer namespace: %s", type->implementer_namespace); "\n\n**Implementer namespace**: %s", type->implementer_namespace);
if (IS_CONFIG_ACTION_TYPE (type->flags)) if (IS_CONFIG_ACTION_TYPE (type->flags))
g_string_append_printf (string, g_string_append_printf (string,

View file

@ -7826,7 +7826,9 @@ register_action_types (void)
}), }),
"Seeks into the stream. This is an example of a seek happening when the stream reaches 5 seconds\n" "Seeks into the stream. This is an example of a seek happening when the stream reaches 5 seconds\n"
"or 1 eighth of its duration and seeks to 10s or 2 eighths of its duration:\n" "or 1 eighth of its duration and seeks to 10s or 2 eighths of its duration:\n"
" seek, playback-time=\"min(5.0, (duration/8))\", start=\"min(10, 2*(duration/8))\", flags=accurate+flush", "\n\n```\n"
" seek, playback-time=\"min(5.0, (duration/8))\", start=\"min(10, 2*(duration/8))\", flags=accurate+flush"
"\n```\n",
GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK
); );