From dae4051ed62d19ef5f8547f24c729b07d608e47c Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Wed, 4 Feb 2015 15:14:04 +0100 Subject: [PATCH] validate: Use plugin name as implementer_namespace when registering action type And document it as a good practice as it will allow us to map plugins and action types https://bugzilla.gnome.org/show_bug.cgi?id=743994 --- validate/gst/plugins/fault_injection/socket_interposer.c | 4 +++- validate/gst/validate/gst-validate-scenario.c | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/validate/gst/plugins/fault_injection/socket_interposer.c b/validate/gst/plugins/fault_injection/socket_interposer.c index 8e90fd5..8b0cf56 100644 --- a/validate/gst/plugins/fault_injection/socket_interposer.c +++ b/validate/gst/plugins/fault_injection/socket_interposer.c @@ -336,7 +336,8 @@ _execute_corrupt_socket_recv (GstValidateScenario * scenario, static gboolean socket_interposer_init (GstPlugin * plugin) { - gst_validate_register_action_type ("corrupt-socket-recv", "fault-injector", +/* *INDENT-OFF* */ + gst_validate_register_action_type ("corrupt-socket-recv", gst_plugin_get_name (plugin), _execute_corrupt_socket_recv, ((GstValidateActionParameter[]) { { .name = "port",.description = @@ -351,6 +352,7 @@ socket_interposer_init (GstPlugin * plugin) NULL} }), "corrupt the next socket receive", GST_VALIDATE_ACTION_TYPE_ASYNC); +/* *INDENT-ON* */ return TRUE; } diff --git a/validate/gst/validate/gst-validate-scenario.c b/validate/gst/validate/gst-validate-scenario.c index adc2656..5fafd08 100644 --- a/validate/gst/validate/gst-validate-scenario.c +++ b/validate/gst/validate/gst-validate-scenario.c @@ -2160,7 +2160,10 @@ gst_validate_action_set_done (GstValidateAction * action) /** * gst_validate_register_action_type: * @type_name: The name of the new action type to add - * @implementer_namespace: The namespace of the implementer of the action type + * @implementer_namespace: The namespace of the implementer of the action type. + * That should always be the name of the GstPlugin as + * retrived with #gst_plugin_get_name when the action type + * is register inside a plugin. * @function: (scope notified): The function to be called to execute the action * @parameters: (allow-none) (array zero-terminated=1) (element-type GstValidate.ActionParameter): The #GstValidateActionParameter usable as parameter of the type * @description: A description of the new type -- 2.7.4