motioncells: turn two global vars into static variables

Move 2 variable to motioncells_warpper and make them static.
This commit is contained in:
Stefan Sauer 2011-08-04 13:33:20 +02:00
parent 3d86389e06
commit f241dafe5c
3 changed files with 7 additions and 9 deletions

View file

@ -105,9 +105,6 @@ GST_DEBUG_CATEGORY_STATIC (gst_motion_cells_debug);
POINTER = NULL;\
}
int instanceCounter = 0;
gboolean element_id_was_max = false;
/* Filter signals and args */
enum
{
@ -396,8 +393,7 @@ gst_motion_cells_init (GstMotioncells * filter, GstMotioncellsClass * gclass)
filter->datafileidx = 0;
g_mutex_lock (filter->propset_mutex);
filter->id = instanceCounter;
motion_cells_init ();
filter->id = motion_cells_init ();
g_mutex_unlock (filter->propset_mutex);
}

View file

@ -46,12 +46,13 @@
#include <limits.h>
#include "motioncells_wrapper.h"
extern int instanceCounter;
extern bool element_id_was_max;
static int instanceCounter = 0;
static gboolean element_id_was_max = false;
MotionCells *mc;
char p_str[] = "idx failed";
void
int
motion_cells_init ()
{
mc = new MotionCells ();
@ -67,6 +68,7 @@ motion_cells_init ()
instanceCounter = motioncellsfreeids.back ();
motioncellsfreeids.pop_back ();
}
return tmpmc.id;
}
int

View file

@ -62,7 +62,7 @@ extern "C"
{
#endif
void motion_cells_init ();
int motion_cells_init ();
int perform_detection_motion_cells (IplImage * p_image, double p_sensitivity,
double p_framerate, int p_gridx, int p_gridy,
long int p_timestamp_millisec, bool p_isVisible, bool p_useAlpha,