summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2008-04-22 00:18:52 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2008-04-22 00:18:52 +0000
commit4e11c343001a69660a5d84836975405a401be3e6 (patch)
treea960e7899d060fc9efc3ef18b46080bbe951499c
parentd2af0c69a161ff7bc9acabec4ecb3fa665dbf66e (diff)
gst/goom/: Free a bunch of stuff, and initialise things to fix leaks and valgrind warnings in the testsuite.
Original commit message from CVS: * gst/goom/config_param.c: (goom_plugin_parameters_free): * gst/goom/convolve_fx.c: (convolve_init), (convolve_free): * gst/goom/filters.c: (zoomFilterVisualFXWrapper_free): * gst/goom/flying_stars_fx.c: (fs_free): * gst/goom/goom_config_param.h: * gst/goom/goom_core.c: (goom_init), (goom_close): * gst/goom/goom_plugin_info.h: * gst/goom/gstgoom.c: (gst_goom_finalize): * gst/goom/lines.c: (goom_lines_free): * gst/goom/plugin_info.c: (plugin_info_init), (plugin_info_free): * gst/goom/surf3d.c: (grid3d_free): * gst/goom/surf3d.h: * gst/goom/tentacle3d.c: (tentacle_free): Free a bunch of stuff, and initialise things to fix leaks and valgrind warnings in the testsuite. Fixes: #529268
-rw-r--r--ChangeLog20
-rw-r--r--gst/goom/config_param.c6
-rw-r--r--gst/goom/convolve_fx.c6
-rw-r--r--gst/goom/filters.c13
-rw-r--r--gst/goom/flying_stars_fx.c5
-rw-r--r--gst/goom/goom_config_param.h1
-rw-r--r--gst/goom/goom_core.c19
-rw-r--r--gst/goom/goom_plugin_info.h1
-rw-r--r--gst/goom/gstgoom.c1
-rw-r--r--gst/goom/lines.c1
-rw-r--r--gst/goom/plugin_info.c14
-rw-r--r--gst/goom/surf3d.c11
-rw-r--r--gst/goom/surf3d.h1
-rw-r--r--gst/goom/tentacle3d.c8
14 files changed, 97 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index eab9c248..dd8609f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+2008-04-22 Jan Schmidt <jan.schmidt@sun.com>
+
+ * gst/goom/config_param.c: (goom_plugin_parameters_free):
+ * gst/goom/convolve_fx.c: (convolve_init), (convolve_free):
+ * gst/goom/filters.c: (zoomFilterVisualFXWrapper_free):
+ * gst/goom/flying_stars_fx.c: (fs_free):
+ * gst/goom/goom_config_param.h:
+ * gst/goom/goom_core.c: (goom_init), (goom_close):
+ * gst/goom/goom_plugin_info.h:
+ * gst/goom/gstgoom.c: (gst_goom_finalize):
+ * gst/goom/lines.c: (goom_lines_free):
+ * gst/goom/plugin_info.c: (plugin_info_init), (plugin_info_free):
+ * gst/goom/surf3d.c: (grid3d_free):
+ * gst/goom/surf3d.h:
+ * gst/goom/tentacle3d.c: (tentacle_free):
+ Free a bunch of stuff, and initialise things to fix leaks
+ and valgrind warnings in the testsuite.
+
+ Fixes: #529268
+
2008-04-21 Wim Taymans <wim.taymans@collabora.co.uk>
* gst/rtsp/gstrtspsrc.c: (gst_rtspsrc_init), (request_pt_map),
diff --git a/gst/goom/config_param.c b/gst/goom/config_param.c
index 4c4cebd9..da07a34a 100644
--- a/gst/goom/config_param.c
+++ b/gst/goom/config_param.c
@@ -111,6 +111,12 @@ goom_plugin_parameters (const char *name, int nb)
return p;
}
+void
+goom_plugin_parameters_free (PluginParameters * p)
+{
+ free (p->params);
+}
+
/*---------------------------------------------------------------------------*/
void
diff --git a/gst/goom/convolve_fx.c b/gst/goom/convolve_fx.c
index d1b06d84..9e0498a8 100644
--- a/gst/goom/convolve_fx.c
+++ b/gst/goom/convolve_fx.c
@@ -105,6 +105,8 @@ convolve_init (VisualFX * _this, PluginInfo * info)
data->params.params[3] = &data->factor_p;
data->params.params[4] = 0;
+ data->h_height = 0;
+
/* init rotozoom tables */
compute_tables (_this, info);
data->theta = 0;
@@ -119,6 +121,10 @@ convolve_init (VisualFX * _this, PluginInfo * info)
static void
convolve_free (VisualFX * _this)
{
+ ConvData *data = (ConvData *) _this->fx_data;
+
+ goom_plugin_parameters_free (&data->params);
+
free (_this->fx_data);
}
diff --git a/gst/goom/filters.c b/gst/goom/filters.c
index 822d4a1c..3014c352 100644
--- a/gst/goom/filters.c
+++ b/gst/goom/filters.c
@@ -793,6 +793,19 @@ zoomFilterVisualFXWrapper_init (struct _VISUAL_FX *_this, PluginInfo * info)
static void
zoomFilterVisualFXWrapper_free (struct _VISUAL_FX *_this)
{
+ ZoomFilterFXWrapperData *data = (ZoomFilterFXWrapperData *) _this->fx_data;
+
+ if (data->freebrutT)
+ free (data->freebrutT);
+ if (data->freebrutS)
+ free (data->freebrutS);
+ if (data->freebrutD)
+ free (data->freebrutD);
+ if (data->firedec)
+ free (data->firedec);
+
+ goom_plugin_parameters_free (_this->params);
+
free (_this->fx_data);
}
diff --git a/gst/goom/flying_stars_fx.c b/gst/goom/flying_stars_fx.c
index 384b54aa..9906c053 100644
--- a/gst/goom/flying_stars_fx.c
+++ b/gst/goom/flying_stars_fx.c
@@ -136,6 +136,11 @@ fs_init (VisualFX * _this, PluginInfo * info)
static void
fs_free (VisualFX * _this)
{
+ FSData *data = (FSData *) _this->fx_data;
+
+ goom_plugin_parameters_free (&data->params);
+
+ free (data->stars);
free (_this->fx_data);
}
diff --git a/gst/goom/goom_config_param.h b/gst/goom/goom_config_param.h
index 3c6838d3..e3a75147 100644
--- a/gst/goom/goom_config_param.h
+++ b/gst/goom/goom_config_param.h
@@ -100,6 +100,7 @@ typedef struct _PARAMETERS {
} PluginParameters;
PluginParameters goom_plugin_parameters(const char *name, int nb);
+void goom_plugin_parameters_free(PluginParameters *p);
#define secure_param goom_secure_param
#define secure_f_param goom_secure_f_param
diff --git a/gst/goom/goom_core.c b/gst/goom/goom_core.c
index 5b222ab9..5bc64b6d 100644
--- a/gst/goom/goom_core.c
+++ b/gst/goom/goom_core.c
@@ -64,6 +64,15 @@ goom_init (guint32 resx, guint32 resy)
plugin_info_init (goomInfo, 4);
+ goomInfo->screen.width = resx;
+ goomInfo->screen.height = resy;
+ goomInfo->screen.size = resx * resy;
+
+ init_buffers (goomInfo, goomInfo->screen.size);
+ goomInfo->gRandom = goom_random_init ((uintptr_t) goomInfo->pixel);
+
+ goomInfo->cycle = 0;
+
goomInfo->star_fx = flying_star_create ();
goomInfo->star_fx.init (&goomInfo->star_fx, goomInfo);
@@ -81,15 +90,6 @@ goom_init (guint32 resx, guint32 resy)
plugin_info_add_visual (goomInfo, 2, &goomInfo->star_fx);
plugin_info_add_visual (goomInfo, 3, &goomInfo->convolve_fx);
- goomInfo->screen.width = resx;
- goomInfo->screen.height = resy;
- goomInfo->screen.size = resx * resy;
-
- init_buffers (goomInfo, goomInfo->screen.size);
- goomInfo->gRandom = goom_random_init ((uintptr_t) goomInfo->pixel);
-
- goomInfo->cycle = 0;
-
goomInfo->ifs_fx = ifs_visualfx_create ();
goomInfo->ifs_fx.init (&goomInfo->ifs_fx, goomInfo);
@@ -782,6 +782,7 @@ goom_close (PluginInfo * goomInfo)
goomInfo->tentacles_fx.free (&goomInfo->tentacles_fx);
goomInfo->zoomFilter_fx.free (&goomInfo->zoomFilter_fx);
+ plugin_info_free (goomInfo);
free (goomInfo);
}
diff --git a/gst/goom/goom_plugin_info.h b/gst/goom/goom_plugin_info.h
index 30c3d102..a745fea2 100644
--- a/gst/goom/goom_plugin_info.h
+++ b/gst/goom/goom_plugin_info.h
@@ -155,6 +155,7 @@ struct _PLUGIN_INFO {
};
void plugin_info_init(PluginInfo *p, int nbVisual);
+void plugin_info_free(PluginInfo *p);
/* i = [0..p->nbVisual-1] */
void plugin_info_add_visual(PluginInfo *p, int i, VisualFX *visual);
diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c
index f1cf31b5..e7c43d9d 100644
--- a/gst/goom/gstgoom.c
+++ b/gst/goom/gstgoom.c
@@ -196,6 +196,7 @@ gst_goom_finalize (GObject * object)
GstGoom *goom = GST_GOOM (object);
goom_close (goom->plugin);
+ goom->plugin = NULL;
g_object_unref (goom->adapter);
diff --git a/gst/goom/lines.c b/gst/goom/lines.c
index a2a94d43..027263aa 100644
--- a/gst/goom/lines.c
+++ b/gst/goom/lines.c
@@ -199,6 +199,7 @@ goom_lines_init (PluginInfo * goomInfo, int rx, int ry,
void
goom_lines_free (GMLine ** l)
{
+ free ((*l)->points2);
free ((*l)->points);
free (*l);
l = NULL;
diff --git a/gst/goom/plugin_info.c b/gst/goom/plugin_info.c
index 7ef1a715..b5e1f463 100644
--- a/gst/goom/plugin_info.c
+++ b/gst/goom/plugin_info.c
@@ -98,6 +98,9 @@ plugin_info_init (PluginInfo * pp, int nbVisuals)
p.sound.prov_max = 0;
p.sound.goom_limit = 1;
p.sound.allTimesMax = 1;
+ p.sound.timeSinceLastGoom = 1;
+ p.sound.timeSinceLastBigGoom = 1;
+ p.sound.cycle = 0;
p.sound.volume_p = secure_f_feedback ("Sound Volume");
p.sound.accel_p = secure_f_feedback ("Sound Acceleration");
@@ -122,6 +125,7 @@ plugin_info_init (PluginInfo * pp, int nbVisuals)
p.sound.params = plugin_parameters ("Sound", 11);
p.nbParams = 0;
+ p.params = NULL;
p.nbVisuals = nbVisuals;
p.visuals = (VisualFX **) malloc (sizeof (VisualFX *) * nbVisuals);
@@ -225,3 +229,13 @@ plugin_info_add_visual (PluginInfo * p, int i, VisualFX * visual)
}
}
}
+
+void
+plugin_info_free (PluginInfo * p)
+{
+ goom_plugin_parameters_free (&p->sound.params);
+
+ if (p->params)
+ free (p->params);
+ free (p->visuals);
+}
diff --git a/gst/goom/surf3d.c b/gst/goom/surf3d.c
index f6810f85..6df9a926 100644
--- a/gst/goom/surf3d.c
+++ b/gst/goom/surf3d.c
@@ -37,6 +37,17 @@ grid3d_new (int sizex, int defx, int sizez, int defz, v3d center)
}
void
+grid3d_free (grid3d * g)
+{
+ surf3d *s = &(g->surf);
+
+ free (s->vertex);
+ free (s->svertex);
+
+ free (g);
+}
+
+void
grid3d_draw (PluginInfo * plug, grid3d * g, int color, int colorlow,
int dist, Pixel * buf, Pixel * back, int W, int H)
{
diff --git a/gst/goom/surf3d.h b/gst/goom/surf3d.h
index 482b6a09..1592dfdf 100644
--- a/gst/goom/surf3d.h
+++ b/gst/goom/surf3d.h
@@ -27,6 +27,7 @@ typedef struct {
/* works on grid3d */
grid3d *grid3d_new (int sizex, int defx, int sizez, int defz, v3d center);
+void grid3d_free (grid3d *g);
void grid3d_update (grid3d *s, float angle, float *vals, float dist);
/* low level */
diff --git a/gst/goom/tentacle3d.c b/gst/goom/tentacle3d.c
index e1f3e78d..b283aa90 100644
--- a/gst/goom/tentacle3d.c
+++ b/gst/goom/tentacle3d.c
@@ -125,8 +125,14 @@ tentacle_fx_create (void)
static void
tentacle_free (TentacleFXData * data)
{
- /* TODO : un vrai FREE GRID!! */
+ int tmp;
+
+ /* FREE GRID */
+ for (tmp = 0; tmp < nbgrid; tmp++)
+ grid3d_free (data->grille[tmp]);
free (data->vals);
+
+ goom_plugin_parameters_free (&data->params);
}
static void