Re: gst-devtools: validate: Add a way to use config actions in GST_VALIDATE_CONFIG files

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: gst-devtools: validate: Add a way to use config actions in GST_VALIDATE_CONFIG files

Reynaldo H. Verdejo Pinochet
Hi

On 06/07/2017 08:20 AM, Thibault Saunier wrote:

> [...]
> @@ -4222,6 +4240,33 @@ init_scenarios (void)
>        GST_VALIDATE_ACTION_TYPE_NONE);
>    /*  *INDENT-ON* */
>
> +  for (tmp = gst_validate_plugin_get_config (NULL); tmp; tmp = tmp->next) {
> +    const gchar *action_typename;
> +
> +    if ((action_typename = gst_structure_get_string (tmp->data, "action"))) {
> +      GstValidateAction *action;
> +      GstValidateActionType *atype = _find_action_type (action_typename);
> +
> +      if (!atype) {
> +        g_error ("[CONFIG ERROR] Action type %s not found", action_typename);
> +
> +        continue;
> +      }
> +
> +      if (!(atype->flags & GST_VALIDATE_ACTION_TYPE_CONFIG) &&
> +          !(_action_type_has_parameter (atype, "as-config"))) {
> +        g_error ("[CONFIG ERROR] Action is not a config action");
> +
> +        continue;
> +      }
> +

Are these g_error() calls intentional or something
you forgot to remove before pushing? The two here
will call abort() before ever reaching your
"continue"s. You should not use g_error() on
any condition you wouldn't use an assert() on.

Bests,

--
Reynaldo H. Verdejo Pinochet
Open Source Group - Samsung Research America
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst-devtools: validate: Add a way to use config actions in GST_VALIDATE_CONFIG files

Thibault Saunier-4
Those g_error() are meant to abort yes.

On Wed, Jun 7, 2017 at 1:34 PM, Reynaldo H. Verdejo Pinochet
<[hidden email]> wrote:

> Hi
>
> On 06/07/2017 08:20 AM, Thibault Saunier wrote:
>>
>> [...]
>> @@ -4222,6 +4240,33 @@ init_scenarios (void)
>>        GST_VALIDATE_ACTION_TYPE_NONE);
>>    /*  *INDENT-ON* */
>>
>> +  for (tmp = gst_validate_plugin_get_config (NULL); tmp; tmp = tmp->next)
>> {
>> +    const gchar *action_typename;
>> +
>> +    if ((action_typename = gst_structure_get_string (tmp->data,
>> "action"))) {
>> +      GstValidateAction *action;
>> +      GstValidateActionType *atype = _find_action_type (action_typename);
>> +
>> +      if (!atype) {
>> +        g_error ("[CONFIG ERROR] Action type %s not found",
>> action_typename);
>> +
>> +        continue;
>> +      }
>> +
>> +      if (!(atype->flags & GST_VALIDATE_ACTION_TYPE_CONFIG) &&
>> +          !(_action_type_has_parameter (atype, "as-config"))) {
>> +        g_error ("[CONFIG ERROR] Action is not a config action");
>> +
>> +        continue;
>> +      }
>> +
>
>
> Are these g_error() calls intentional or something
> you forgot to remove before pushing? The two here
> will call abort() before ever reaching your
> "continue"s. You should not use g_error() on
> any condition you wouldn't use an assert() on.
>
> Bests,
>
> --
> Reynaldo H. Verdejo Pinochet
> Open Source Group - Samsung Research America
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel