GstValidateScenario

A GstValidateScenario represents the scenario that will be executed on a GstPipeline. It is basically an ordered list of GstValidateAction that will be executed during the execution of the pipeline.

Possible configurations (see GST_VALIDATE_CONFIG):

  • scenario-action-execution-interval: Sets the interval in milliseconds (1/1000ths of a second), between which actions will be executed, setting it to 0 means "execute in idle". The default value is 10ms.

GstValidateAction

The GstValidateAction defined to be executed as part of a scenario

Only access it from the default main context.

Members

mini_object (GstMiniObject) –
No description available
type (const gchar *) –

The type of the GstValidateAction, which is the name of the GstValidateActionType registered with gst_validate_register_action_type

name (const gchar *) –

The name of the action, set from the user in the scenario

structure (GstStructure *) –

the GstStructure defining the action


Constructors

gst_validate_action_new

GstValidateAction *
gst_validate_action_new (GstValidateScenario * scenario,
                         GstValidateActionType * action_type,
                         GstStructure * structure,
                         gboolean add_to_lists)

Parameters:

scenario ( [allow-none])

The scenario executing the action

action_type

The action type

structure

The structure containing the action arguments

add_to_lists

Weather the action should be added to the scenario action list

Returns

A newly created GstValidateAction


Methods

gst_validate_action_get_scenario

GstValidateScenario *
gst_validate_action_get_scenario (GstValidateAction * action)

Retrieve the scenario from which action is executed.

Parameters:

action

The action for which to retrieve the scenario

Returns ( [transfer: full][nullable])

The scenario from which the action is being executed.


gst_validate_action_ref

GstValidateAction *
gst_validate_action_ref (GstValidateAction * action)

Parameters:

action
No description available
Returns
No description available

gst_validate_action_set_done

gst_validate_action_set_done (GstValidateAction * action)

Parameters:

action
No description available

gst_validate_action_unref

gst_validate_action_unref (GstValidateAction * action)

Parameters:

action
No description available

Functions

gst_validate_action_get_clocktime

gboolean
gst_validate_action_get_clocktime (GstValidateScenario * scenario,
                                   GstValidateAction * action,
                                   const gchar * name,
                                   GstClockTime * retval)

Get a time value for the name parameter of an action. This method should be called to retrieve and compute a timed value of a given action. It will first try to retrieve the value as a double, then get it as a string and execute any formula taking into account the 'position' and 'duration' variables. And it will always convert that value to a GstClockTime.

Parameters:

scenario

The GstValidateScenario from which to get a time for a parameter of an action

action

The action from which to retrieve the time for name parameter.

name

The name of the parameter for which to retrieve a time

retval ( [out])

The return value for the wanted time

Returns

TRUE if the time value could be retrieved/computed or FALSE otherwise


GstValidateActionParameter

Members

name (const gchar *) –

The name of the parameter

description (const gchar *) –

The description of the parameter

mandatory (gboolean) –

Whether the parameter is mandatory for a specific action type

types (const gchar *) –

The types the parameter can take described as a string. It can be precisely describing how the typing works using '\n' between the various acceptable types. NOTE: The types should end with (GstClockTime) if its final type is a GstClockTime, this way it will be processed when preparing the actions.

possible_variables (const gchar *) –

The name of the variables that can be used to compute the value of the parameter. For example for the start value of a seek action, we will accept to take 'duration' which will be replace by the total duration of the stream on which the action is executed.

def (const gchar *) –

The default value of a parameter as a string, should be NULL for mandatory streams.

free (GDestroyNotify) –

Function that frees the various members of the structure when done using


GstValidateActionType

Members

mini_object (GstMiniObject) –
No description available
name (gchar *) –

The name of the new action type to add

implementer_namespace (gchar *) –

The namespace of the implementer of the action type

prepare (GstValidatePrepareAction) –
No description available
execute (GstValidateExecuteAction) –

The function to be called to execute the action

parameters (GstValidateActionParameter *) –

The GstValidateActionParameter usable as parameter of the type

description (gchar *) –

A description of the new type

The flags of the action type

rank (GstRank) –
No description available
overriden_type (GstValidateActionType *) –
No description available
priv (GstValidateActionTypePrivate*) –
No description available

GstValidateScenario

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstValidateScenario

Members

parent (GstObject) –
No description available
description (GstStructure *) –
No description available

Class structure

GstValidateScenarioClass

Fields
parent_class (GstObjectClass) –
No description available

Methods

gst_validate_scenario_execute_seek

gint
gst_validate_scenario_execute_seek (GstValidateScenario * scenario,
                                    GstValidateAction * action,
                                    gdouble rate,
                                    GstFormat format,
                                    GstSeekFlags flags,
                                    GstSeekType start_type,
                                    GstClockTime start,
                                    GstSeekType stop_type,
                                    GstClockTime stop)

Executes a seek event on the scenario's pipeline. You should always use this method when you want to execute a seek inside a new action type so that the scenario state is updated taking into account that seek.

For more information you should have a look at gst_event_new_seek

Parameters:

scenario

The GstValidateScenario for which to execute a seek action

action

The seek action to execute

rate

The playback rate of the seek

format

The GstFormat of the seek

flags

The GstSeekFlags of the seek

start_type

The GstSeekType of the start value of the seek

start

The start time of the seek

stop_type

The GstSeekType of the stop value of the seek

stop

The stop time of the seek

Returns

TRUE if the seek could be executed, FALSE otherwise


gst_validate_scenario_get_actions

GList *
gst_validate_scenario_get_actions (GstValidateScenario * scenario)

Get remaining actions from scenario.

Parameters:

scenario

The scenario to retrieve remaining actions for

Returns ( [transfer: full][element-typeGstValidateAction])

A list of GstValidateAction.


gst_validate_scenario_get_pipeline

GstElement *
gst_validate_scenario_get_pipeline (GstValidateScenario * scenario)

Parameters:

scenario

The scenario to retrieve a pipeline from

Returns ( [transfer: full][nullable])

The GstPipeline the scenario is running against


gst_validate_scenario_get_target_state

GstState
gst_validate_scenario_get_target_state (GstValidateScenario * scenario)

Get current target state from scenario.

Parameters:

scenario

The scenario to retrieve the current target state for

Returns

Current target state.


Functions

gst_validate_scenario_deinit

gst_validate_scenario_deinit ()

gst_validate_scenario_factory_create

GstValidateScenario *
gst_validate_scenario_factory_create (GstValidateRunner * runner,
                                      GstElement * pipeline,
                                      const gchar * scenario_name)

Parameters:

runner

The GstValidateRunner to use to report issues

pipeline

The pipeline to run the scenario on

scenario_name

The name (or path) of the scenario to run

Returns ( [transfer: full][nullable])

A GstValidateScenario or NULL


Signals

action-done

action_done_callback (GstValidateScenario * self,
                      GstValidateAction * action,
                      gpointer user_data)

Emitted when an action is done.

Parameters:

self
No description available
action

The GstValidateAction that is done running

user_data
No description available

Flags: Run Last

Since : 1.20


done

done_callback (GstValidateScenario * self,
               gpointer user_data)

Emitted once all actions have been executed

Parameters:

self
No description available
user_data
No description available

Flags: Run Last


stopping

stopping_callback (GstValidateScenario * self,
                   gpointer user_data)

Emitted when the 'stop' action is fired

Parameters:

self
No description available
user_data
No description available

Flags: Run Last

Since : 1.26


Properties

execute-on-idle

“execute-on-idle” gboolean

Flags : Read / Write


handles-states

“handles-states” gboolean

Flags : Read


validate-runner

“validate-runner” GstValidateRunner *

Flags : Read / Write / Construct Only


Functions

gst_validate_action_return_get_name

const gchar *
gst_validate_action_return_get_name (GstValidateActionReturn r)

Parameters:

r
No description available
Returns
No description available

gst_validate_execute_action

gint
gst_validate_execute_action (GstValidateActionType * action_type,
                             GstValidateAction * action)

Executes action

Parameters:

action_type

The GstValidateActionType to execute

action ( [transfer: full])

The GstValidateAction to execute

Returns
No description available

gst_validate_get_action_type

GstValidateActionType *
gst_validate_get_action_type (const gchar * type_name)

Parameters:

type_name
No description available
Returns
No description available

gst_validate_list_scenarios

gboolean
gst_validate_list_scenarios (gchar ** scenarios,
                             gint num_scenarios,
                             gchar * output_file)

Parameters:

scenarios
No description available
num_scenarios
No description available
output_file
No description available
Returns
No description available

gst_validate_print_action_types

gboolean
gst_validate_print_action_types (const gchar ** wanted_types,
                                 gint num_wanted_types)

Prints the action types details wanted in wanted_types

Parameters:

wanted_types ( [arraylength=num_wanted_types])

(optional): List of types to be printed

num_wanted_types

Length of wanted_types

Returns

True if all types could be printed


gst_validate_register_action_type

GstValidateActionType *
gst_validate_register_action_type (const gchar * type_name,
                                   const gchar * implementer_namespace,
                                   GstValidateExecuteAction function,
                                   GstValidateActionParameter * parameters,
                                   const gchar * description,
                                   GstValidateActionTypeFlags flags)

Register a new action type to the action type system. If the action type already exists, it will be overridden by the new definition

Parameters:

type_name

The name of the new action type to add

implementer_namespace

The namespace of the implementer of the action type. That should always be the name of the GstPlugin as retrieved with gst_plugin_get_name when the action type is registered inside a plugin.

function ( [scope notified])

The function to be called to execute the action

parameters ( [allow-none][arrayzero-terminated=1][element-typeGstValidateActionParameter])

The GstValidateActionParameter usable as parameter of the type

description

A description of the new type

flags

The GstValidateActionTypeFlags to set on the new action type

Returns ( [transfer: none])

The newly created action type or the already registered action type if it had a higher rank


gst_validate_register_action_type_dynamic

GstValidateActionType *
gst_validate_register_action_type_dynamic (GstPlugin * plugin,
                                           const gchar * type_name,
                                           GstRank rank,
                                           GstValidateExecuteAction function,
                                           GstValidateActionParameter * parameters,
                                           const gchar * description,
                                           GstValidateActionTypeFlags flags)

Parameters:

plugin ( [allow-none])

The GstPlugin that register the action type, or NULL for a static element.

type_name

The name of the new action type to add

rank

The ranking of that implementation of the action type called type_name. If an action type has been registered with the same name with a higher rank, the new implementation will not be used, and the already registered action type is returned. If the already registered implementation has a lower rank, the new implementation will be used and returned.

function ( [scope notified])

The function to be called to execute the action

parameters ( [allow-none][arrayzero-terminated=1][element-typeGstValidateActionParameter])

The GstValidateActionParameter usable as parameter of the type

description

A description of the new type

flags

The GstValidateActionTypeFlags to be set on the new action type

Returns ( [transfer: none])

The newly created action type or the already registered action type if it had a higher rank


Function Macros

GST_IS_VALIDATE_ACTION

#define GST_IS_VALIDATE_ACTION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_ACTION))

GST_IS_VALIDATE_ACTION_TYPE

#define GST_IS_VALIDATE_ACTION_TYPE(obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_ACTION_TYPE))

GST_IS_VALIDATE_SCENARIO

#define GST_IS_VALIDATE_SCENARIO(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VALIDATE_SCENARIO))

GST_IS_VALIDATE_SCENARIO_CLASS

#define GST_IS_VALIDATE_SCENARIO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VALIDATE_SCENARIO))

GST_VALIDATE_ACTION_DEBUG

#define GST_VALIDATE_ACTION_DEBUG(action) (((GstValidateAction*) action)->debug)

GST_VALIDATE_ACTION_FILENAME

#define GST_VALIDATE_ACTION_FILENAME(action) (((GstValidateAction*) action)->filename)

GST_VALIDATE_ACTION_GET_TYPE

#define GST_VALIDATE_ACTION_GET_TYPE(obj)   ((GstValidateActionType*)gst_validate_get_action_type(((GstValidateAction*)obj)->type))

GST_VALIDATE_ACTION_LINENO

#define GST_VALIDATE_ACTION_LINENO(action) (((GstValidateAction*) action)->lineno)

GST_VALIDATE_ACTION_N_REPEATS

#define GST_VALIDATE_ACTION_N_REPEATS(action) (((GstValidateAction*) action)->n_repeats)

GST_VALIDATE_ACTION_RANGE_NAME

#define GST_VALIDATE_ACTION_RANGE_NAME(action) (((GstValidateAction*) action)->rangename)

GST_VALIDATE_SCENARIO_EOS_HANDLING_LOCK

#define GST_VALIDATE_SCENARIO_EOS_HANDLING_LOCK(scenario) (g_mutex_lock(&(scenario)->eos_handling_lock))

GST_VALIDATE_SCENARIO_EOS_HANDLING_UNLOCK

#define GST_VALIDATE_SCENARIO_EOS_HANDLING_UNLOCK(scenario) (g_mutex_unlock(&(scenario)->eos_handling_lock))

Enumerations

GstValidateActionReturn

GST_VALIDATE_EXECUTE_ACTION_ERROR: GST_VALIDATE_EXECUTE_ACTION_OK: GST_VALIDATE_EXECUTE_ACTION_ASYNC: GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED: GST_VALIDATE_EXECUTE_ACTION_IN_PROGRESS: GST_VALIDATE_EXECUTE_ACTION_NONE: GST_VALIDATE_EXECUTE_ACTION_DONE:

Members
GST_VALIDATE_EXECUTE_ACTION_ERROR (0) –
No description available
GST_VALIDATE_EXECUTE_ACTION_OK (1) –
No description available
GST_VALIDATE_EXECUTE_ACTION_ASYNC (2) –
No description available
GST_VALIDATE_EXECUTE_ACTION_NON_BLOCKING (3) –

The action will be executed asynchronously without blocking further actions to be executed

(Since: 1.20)
GST_VALIDATE_EXECUTE_ACTION_INTERLACED (3) –
No description available
GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED (4) –
No description available
GST_VALIDATE_EXECUTE_ACTION_IN_PROGRESS (5) –
No description available
GST_VALIDATE_EXECUTE_ACTION_NONE (6) –
No description available
GST_VALIDATE_EXECUTE_ACTION_DONE (7) –
No description available

GstValidateActionTypeFlags

Members
GST_VALIDATE_ACTION_TYPE_NONE (0) –

No special flag

GST_VALIDATE_ACTION_TYPE_CONFIG (2) –

The action is a config

GST_VALIDATE_ACTION_TYPE_ASYNC (4) –

The action can be executed ASYNC

GST_VALIDATE_ACTION_TYPE_NON_BLOCKING (8) –

The action can be executed asynchronously but without blocking further actions execution.

(Since: 1.20)
GST_VALIDATE_ACTION_TYPE_INTERLACED (8) –
No description available
GST_VALIDATE_ACTION_TYPE_CAN_EXECUTE_ON_ADDITION (16) –

The action will be executed on 'element-added' for a particular element type if no playback-time is specified

GST_VALIDATE_ACTION_TYPE_NEEDS_CLOCK (32) –

The pipeline will need to be synchronized with the clock for that action type to be used.

GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL (64) –

Do not consider the non execution of the action as a fatal error.

GST_VALIDATE_ACTION_TYPE_CAN_BE_OPTIONAL (128) –

The action can use the 'optional' keyword. Such action instances will have the GST_VALIDATE_ACTION_TYPE_NO_EXECUTION_NOT_FATAL flag set and won't be considered as fatal if they fail.

GST_VALIDATE_ACTION_TYPE_DOESNT_NEED_PIPELINE (256) –
No description available
GST_VALIDATE_ACTION_TYPE_HANDLED_IN_CONFIG (512) –

The action can be used in config files even if it is not strictly a config action (ie. it needs a scenario to run).

GST_VALIDATE_ACTION_TYPE_CHECK (1024) –

The action is checking some state from objects in the pipeline. It means that it can be used as 'check' in different action which have a check "sub action", such as the 'wait' action type. This implies that the action can be executed from any thread and not only from the scenario thread as other types.

(Since: 1.22)

Constants

GST_TYPE_VALIDATE_ACTION

#define GST_TYPE_VALIDATE_ACTION            (gst_validate_action_get_type ())

GST_TYPE_VALIDATE_ACTION_TYPE

#define GST_TYPE_VALIDATE_ACTION_TYPE       (gst_validate_action_type_get_type ())

GST_TYPE_VALIDATE_SCENARIO

#define GST_TYPE_VALIDATE_SCENARIO            (gst_validate_scenario_get_type ())

GstValidateExecuteActionReturn

#define GstValidateExecuteActionReturn gint

Callbacks

GstValidateExecuteAction

gint
(*GstValidateExecuteAction) (GstValidateScenario * scenario,
                             GstValidateAction * action)

A function that executes a GstValidateAction

Parameters:

scenario

The GstValidateScenario from which the action is executed

action

The GstValidateAction being executed


GstValidatePrepareAction

gint
(*GstValidatePrepareAction) (GstValidateAction * action)

A function that prepares action so it can be executed right after. Most of the time this function is used to parse and set fields with equations in the action structure.

Parameters:

action

The GstValidateAction to prepare before execution

Returns

TRUE if the action could be prepared and is ready to be run , FALSE otherwise


The results of the search are