Revert "validate:scenario: Add a way to specify action structure size"
authorThibault Saunier <tsaunier@gnome.org>
Tue, 10 Feb 2015 12:50:23 +0000 (13:50 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Sat, 14 Feb 2015 15:32:12 +0000 (16:32 +0100)
This reverts commit b976319ef7f977b8ce910c4b8aa1a843da3b264f.

Now that the exact same structure can be used to represent different
action types, we can not rely on the structure size to stuff
informations into the action.  Users should just make use of
GstMiniObject.qdata.

validate/gst/validate/gst-validate-scenario.c
validate/gst/validate/gst-validate-scenario.h

index 1db3326..25cc325 100644 (file)
@@ -198,7 +198,7 @@ _action_free (GstValidateAction * action)
   if (action->main_structure)
     gst_structure_free (action->main_structure);
 
-  g_slice_free1 (_find_action_type (action->type)->action_struct_size, action);
+  g_slice_free (GstValidateAction, action);
 }
 
 static void
@@ -219,7 +219,7 @@ static GstValidateAction *
 gst_validate_action_new (GstValidateScenario * scenario,
     GstValidateActionType * action_type)
 {
-  GstValidateAction *action = g_slice_alloc0 (action_type->action_struct_size);
+  GstValidateAction *action = g_slice_new0 (GstValidateAction);
 
   gst_validate_action_init (action);
   action->playback_time = GST_CLOCK_TIME_NONE;
@@ -2372,7 +2372,6 @@ gst_validate_register_action_type_dynamic (GstPlugin * plugin,
 
   type->description = g_strdup (description);
   type->flags = flags;
-  type->action_struct_size = sizeof (GstValidateActionType);
   type->rank = rank;
 
   if ((tmptype = _find_action_type (type_name))) {
@@ -2403,15 +2402,6 @@ gst_validate_register_action_type_dynamic (GstPlugin * plugin,
   return type;
 }
 
-void
-gst_validate_action_type_set_action_struct_size (GstValidateActionType * type,
-    gsize action_struct_size)
-{
-  g_return_if_fail (action_struct_size >= sizeof (GstValidateAction));
-
-  type->action_struct_size = sizeof (GstValidateActionType);
-}
-
 GstValidateActionType *
 gst_validate_get_action_type (const gchar * type_name)
 {
index 0186b3a..7096f9e 100644 (file)
@@ -155,11 +155,10 @@ struct _GstValidateActionType
   gchar *description;
   GstValidateActionTypeFlags flags;
 
-  gsize action_struct_size;
   GstRank rank;
 
   /*< private >*/
-  gpointer _gst_reserved[GST_PADDING_LARGE - sizeof(gsize) -  sizeof (GstRank)];
+  gpointer _gst_reserved[GST_PADDING_LARGE - sizeof (GstRank)];
 };
 
 #define GST_TYPE_VALIDATE_ACTION_TYPE       (gst_validate_action_type_get_type ())
@@ -257,10 +256,6 @@ gst_validate_register_action_type_dynamic (GstPlugin *plugin,
                                            GstValidateActionTypeFlags flags);
 
 
-void
-gst_validate_action_type_set_action_struct_size (GstValidateActionType *type,
-                                                 gsize action_struct_size);
-
 gboolean gst_validate_action_get_clocktime (GstValidateScenario * scenario,
                                             GstValidateAction *action,
                                             const gchar * name,