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)
–
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
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
The scenario from which the action is being executed.
gst_validate_action_ref
GstValidateAction * gst_validate_action_ref (GstValidateAction * action)
Parameters:
action
–
gst_validate_action_set_done
gst_validate_action_set_done (GstValidateAction * action)
Parameters:
action
–
gst_validate_action_unref
gst_validate_action_unref (GstValidateAction * action)
Parameters:
action
–
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
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)
–
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)
–
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
flags
(GstValidateActionTypeFlags)
–
The flags of the action type
rank
(GstRank)
–
overriden_type
(GstValidateActionType *)
–
priv
(GstValidateActionTypePrivate*)
–
GstValidateScenario
GObject ╰──GInitiallyUnowned ╰──GstObject ╰──GstValidateScenario
Members
parent
(GstObject)
–
description
(GstStructure *)
–
Class structure
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
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
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
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
Current target state.
Functions
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
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
–
action
–
The GstValidateAction that is done running
user_data
–
Flags: Run Last
Since : 1.20
done
done_callback (GstValidateScenario * self, gpointer user_data)
Emitted once all actions have been executed
Parameters:
self
–
user_data
–
Flags: Run Last
stopping
stopping_callback (GstValidateScenario * self, gpointer user_data)
Emitted when the 'stop' action is fired
Parameters:
self
–
user_data
–
Flags: Run Last
Since : 1.26
Properties
Functions
gst_validate_action_return_get_name
const gchar * gst_validate_action_return_get_name (GstValidateActionReturn r)
Parameters:
r
–
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
gst_validate_get_action_type
GstValidateActionType * gst_validate_get_action_type (const gchar * type_name)
Parameters:
type_name
–
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
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
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
The newly created action type or the already registered action type if it had a higher rank
Function Macros
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)
–
GST_VALIDATE_EXECUTE_ACTION_OK
(1)
–
GST_VALIDATE_EXECUTE_ACTION_ASYNC
(2)
–
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)
–
GST_VALIDATE_EXECUTE_ACTION_ERROR_REPORTED
(4)
–
GST_VALIDATE_EXECUTE_ACTION_IN_PROGRESS
(5)
–
GST_VALIDATE_EXECUTE_ACTION_NONE
(6)
–
GST_VALIDATE_EXECUTE_ACTION_DONE
(7)
–
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)
–
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)
–
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.
Constants
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
The results of the search are