From 0d62c41cd44e7f763debebc16d811f65daa17aeb Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Sat, 10 Apr 2010 15:43:33 +1200 Subject: [PATCH] move static variables into sparrow object (for multi-threading) --- gstsparrow.c | 10 +++------- gstsparrow.h | 3 +++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gstsparrow.c b/gstsparrow.c index d14f394..9bd341a 100644 --- a/gstsparrow.c +++ b/gstsparrow.c @@ -101,7 +101,6 @@ static gboolean gst_sparrow_set_caps (GstBaseTransform * base, GstCaps * incaps, static GstFlowReturn gst_sparrow_transform_ip (GstBaseTransform * transform, GstBuffer * buf); -//static void gst_sparrow_RGB_ip (GstSparrow * sparrow, guint8 * data, gint size); GST_BOILERPLATE (GstSparrow, gst_sparrow, GstVideoFilter, GST_TYPE_VIDEO_FILTER); @@ -277,18 +276,15 @@ gamma_negation(guint8 * bytes, guint size){ } -static guint32 calibrate_offset = 1; - static void -calibrate(guint8 * bytes, GstSparrow *sparrow){ +calibrate(guint8 * bytes, GstSparrow * sparrow){ memset(bytes, 0, sparrow->size); - calibrate_offset = ((calibrate_offset + 3) * 11) % sparrow->height; - memset(bytes + sparrow->width * calibrate_offset * 4, + calibrate_offset = ((sparrow->calibrate_offset + 3) * 11) % sparrow->height; + memset(bytes + sparrow->width * sparrow->calibrate_offset * 4, 255, sparrow->width * 4); } - static GstFlowReturn gst_sparrow_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) { diff --git a/gstsparrow.h b/gstsparrow.h index cc5591a..d1001ef 100644 --- a/gstsparrow.h +++ b/gstsparrow.h @@ -59,11 +59,14 @@ struct _GstSparrow { GstVideoFilter videofilter; + /* format */ gint width; gint height; gint size; + guint32 calibrate_offset = 1; + /* properties */ gint calibrate; /* tables */ -- 2.11.4.GIT