Top | ![]() |
![]() |
![]() |
![]() |
GstValidateScenarioGstValidateScenario — A GstValidateScenario represents a set of actions to be executed on a pipeline. |
GstValidateExecuteActionReturn | (*GstValidateExecuteAction) () |
gboolean | gst_validate_print_action_types () |
gboolean | gst_validate_list_scenarios () |
GstValidateActionType * | gst_validate_register_action_type () |
gboolean | gst_validate_action_get_clocktime () |
gboolean | gst_validate_scenario_execute_seek () |
void | gst_validate_action_set_done () |
GstValidateScenario * | gst_validate_action_get_scenario () |
gboolean | execute-on-idle | Read / Write |
gboolean | handles-states | Read |
GstValidateRunner * | validate-runner | Read / Write / Construct Only |
GBoxed ├── GstValidateAction ╰── GstValidateActionType GObject ╰── GInitiallyUnowned ╰── GstObject ╰── 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.
GstValidateExecuteActionReturn (*GstValidateExecuteAction) (GstValidateScenario *scenario
,GstValidateAction *action
);
A function that executes a GstValidateAction
scenario |
The GstValidateScenario from which the |
|
action |
The GstValidateAction being executed |
gboolean gst_validate_print_action_types (const gchar **wanted_types
,gint num_wanted_types
);
Prints the action types details wanted in wanted_types
gboolean gst_validate_list_scenarios (gchar **scenarios
,gint num_scenarios
,gchar *output_file
);
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 overriden by that new definition
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 register inside a plugin. |
|
function |
The function to be called to execute the action. |
[scope notified] |
parameters |
The GstValidateActionParameter usable as parameter of the type. |
[allow-none][array zero-terminated=1][element-type GstValidateActionParameter] |
description |
A description of the new type |
|
flags |
The GstValidateActionTypeFlags to set on the new action type |
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 retrieved 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.
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 |
The name of the parameter for which to retrieve a time |
|
retval |
The return value for the wanted time. |
[out] |
gboolean 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' pipeline. You should always use that method when you want to execute a seek inside a new action types 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
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 |
GstValidateScenario *
gst_validate_action_get_scenario (GstValidateAction *action
);
Retrieve the scenario from which action
is executed.
typedef struct { GstMiniObject mini_object; const gchar *type; const gchar *name; GstStructure *structure; GstValidateScenario *scenario; } GstValidateAction;
The GstValidateAction defined to be executed as part of a scenario
Only access it from the default main context.
GstMiniObject |
||
const gchar * |
The type of the GstValidateAction, which is the name of the GstValidateActionType registered with gst_validate_register_action_type |
|
const gchar * |
The name of the action, set from the user in the scenario |
|
GstStructure * |
the GstStructure defining the action |
|
GstValidateScenario * |
The scenario for this action. This is not thread safe and should be accessed exculsively from the main thread. If you need to access it from another thread use the gst_validate_action_get_scenario method |
struct GstValidateActionParameter { const gchar *name; const gchar *description; gboolean mandatory; const gchar *types; const gchar *possible_variables; const gchar *def; };
const gchar * |
The name of the parameter |
|
const gchar * |
The description of the parameter |
|
gboolean |
Whether the parameter is mandatory for a specific action type |
|
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. |
|
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. |
|
const gchar * |
The default value of a parameter as a string, should be |
typedef struct { GstMiniObject mini_object; gchar *name; gchar *implementer_namespace; GstValidatePrepareAction prepare; GstValidateExecuteAction execute; GstValidateActionParameter *parameters; gchar *description; GstValidateActionTypeFlags flags; GstRank rank; GstValidateActionType *overriden_type; } GstValidateActionType;
GstMiniObject |
||
gchar * |
The name of the new action type to add |
|
gchar * |
The namespace of the implementer of the action type |
|
GstValidateExecuteAction |
The function to be called to execute the action |
|
GstValidateActionParameter * |
The GstValidateActionParameter usable as parameter of the type. |
[allow-none][array zero-terminated=1][element-type GstValidateActionParameter] |
gchar * |
A description of the new type |
|
The flags of the action type |
||
GstRank |
||
GstValidateActionType * |
“execute-on-idle”
property“execute-on-idle” gboolean
Always execute actions on idle and do not chain them to execute as fast as possible. That is usefull if action execution can lead to the addition of source on the same main loop. It allows those other GSources to have a chance to be dispatch between validate actions execution.
Flags: Read / Write
Default value: FALSE
“handles-states”
property“handles-states” gboolean
True if the application should not set handle the first state change False if it is application responsibility.
Flags: Read
Default value: FALSE
“validate-runner”
property“validate-runner” GstValidateRunner *
The Validate runner to report errors to.
Flags: Read / Write / Construct Only
“done”
signalvoid user_function (GstValidateScenario *scenario, gpointer user_data)
Emitted once all actions have been executed
scenario |
The scenario runing |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last