summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2012-06-14 23:52:41 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2012-06-15 10:26:57 +0100
commit7eecd8f56f0b2c587b8e111b466fe70a5c5efcd1 (patch)
tree3df501bb7ca80b640f684468a71d9ad48fc17336 /gst
parentb4a9a2f79e0e32fff4cebb9b6af96461b93b90d0 (diff)
event: no need to store the size of the structure inside the structure
Diffstat (limited to 'gst')
-rw-r--r--gst/gstevent.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/gst/gstevent.c b/gst/gstevent.c
index c4359692b..965ccb315 100644
--- a/gst/gstevent.c
+++ b/gst/gstevent.c
@@ -92,12 +92,9 @@ typedef struct
{
GstEvent event;
- gsize slice_size;
-
GstStructure *structure;
} GstEventImpl;
-#define GST_EVENT_SLICE_SIZE(e) (((GstEventImpl *)(e))->slice_size)
#define GST_EVENT_STRUCTURE(e) (((GstEventImpl *)(e))->structure)
typedef struct
@@ -232,11 +229,10 @@ _gst_event_free (GstEvent * event)
gst_structure_free (s);
}
- g_slice_free1 (GST_EVENT_SLICE_SIZE (event), event);
+ g_slice_free1 (sizeof (GstEventImpl), event);
}
-static void gst_event_init (GstEventImpl * event, gsize size,
- GstEventType type);
+static void gst_event_init (GstEventImpl * event, GstEventType type);
static GstEvent *
_gst_event_copy (GstEvent * event)
@@ -246,7 +242,7 @@ _gst_event_copy (GstEvent * event)
copy = g_slice_new0 (GstEventImpl);
- gst_event_init (copy, sizeof (GstEventImpl), GST_EVENT_TYPE (event));
+ gst_event_init (copy, GST_EVENT_TYPE (event));
GST_EVENT_TIMESTAMP (copy) = GST_EVENT_TIMESTAMP (event);
GST_EVENT_SEQNUM (copy) = GST_EVENT_SEQNUM (event);
@@ -263,15 +259,13 @@ _gst_event_copy (GstEvent * event)
}
static void
-gst_event_init (GstEventImpl * event, gsize size, GstEventType type)
+gst_event_init (GstEventImpl * event, GstEventType type)
{
gst_mini_object_init (GST_MINI_OBJECT_CAST (event), _gst_event_type);
event->event.mini_object.copy = (GstMiniObjectCopyFunction) _gst_event_copy;
event->event.mini_object.free = (GstMiniObjectFreeFunction) _gst_event_free;
- GST_EVENT_SLICE_SIZE (event) = size;
-
GST_EVENT_TYPE (event) = type;
GST_EVENT_TIMESTAMP (event) = GST_CLOCK_TIME_NONE;
GST_EVENT_SEQNUM (event) = gst_util_seqnum_next ();
@@ -314,7 +308,7 @@ gst_event_new_custom (GstEventType type, GstStructure * structure)
goto had_parent;
}
- gst_event_init (event, sizeof (GstEventImpl), type);
+ gst_event_init (event, type);
GST_EVENT_STRUCTURE (event) = structure;
@@ -323,7 +317,7 @@ gst_event_new_custom (GstEventType type, GstStructure * structure)
/* ERRORS */
had_parent:
{
- g_slice_free1 (GST_EVENT_SLICE_SIZE (event), event);
+ g_slice_free1 (sizeof (GstEventImpl), event);
g_warning ("structure is already owned by another object");
return NULL;
}