From 757f80b23e034465f34dff436c5248963365a285 Mon Sep 17 00:00:00 2001 From: Sebastian Dröge Date: Tue, 16 Jun 2009 20:16:13 +0200 Subject: effectv: Define the fast PRNG function at a central place --- gst/effectv/gstaging.c | 10 +--------- gst/effectv/gstdice.c | 9 +-------- gst/effectv/gsteffectv.h | 8 ++++++++ gst/effectv/gstquark.c | 9 +-------- gst/effectv/gstshagadelic.c | 9 +-------- 5 files changed, 12 insertions(+), 33 deletions(-) diff --git a/gst/effectv/gstaging.c b/gst/effectv/gstaging.c index 6b2841c6..b7fd149a 100644 --- a/gst/effectv/gstaging.c +++ b/gst/effectv/gstaging.c @@ -32,6 +32,7 @@ #include #include "gstaging.h" +#include "gsteffectv.h" #include #include @@ -88,15 +89,6 @@ gst_agingtv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, return ret; } -static inline guint -fastrand (void) -{ - static guint fastrand_val; - - return (fastrand_val = fastrand_val * 1103515245 + 12345); -} - - static void coloraging (guint32 * src, guint32 * dest, gint video_area, gint * c) { diff --git a/gst/effectv/gstdice.c b/gst/effectv/gstdice.c index 3ab5ae4c..1c4a392d 100644 --- a/gst/effectv/gstdice.c +++ b/gst/effectv/gstdice.c @@ -33,6 +33,7 @@ #include #include "gstdice.h" +#include "gsteffectv.h" #include #include @@ -96,14 +97,6 @@ gst_dicetv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, return ret; } -static inline guint -fastrand (void) -{ - static guint fastrand_val; - - return (fastrand_val = fastrand_val * 1103515245 + 12345); -} - static GstFlowReturn gst_dicetv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) { diff --git a/gst/effectv/gsteffectv.h b/gst/effectv/gsteffectv.h index 30b09e78..a9539919 100644 --- a/gst/effectv/gsteffectv.h +++ b/gst/effectv/gsteffectv.h @@ -23,3 +23,11 @@ #include +static inline guint +fastrand (void) +{ + static guint fastrand_val; + + return (fastrand_val = fastrand_val * 1103515245 + 12345); +} + diff --git a/gst/effectv/gstquark.c b/gst/effectv/gstquark.c index afd629bd..74791e2e 100644 --- a/gst/effectv/gstquark.c +++ b/gst/effectv/gstquark.c @@ -32,6 +32,7 @@ #include #include "gstquark.h" +#include "gsteffectv.h" #include @@ -84,14 +85,6 @@ gst_quarktv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, return ret; } -static inline guint -fastrand (void) -{ - static guint fastrand_val; - - return (fastrand_val = fastrand_val * 1103515245 + 12345); -} - static GstFlowReturn gst_quarktv_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) diff --git a/gst/effectv/gstshagadelic.c b/gst/effectv/gstshagadelic.c index c2afec1a..1eea4df6 100644 --- a/gst/effectv/gstshagadelic.c +++ b/gst/effectv/gstshagadelic.c @@ -30,6 +30,7 @@ #include #include "gstshagadelic.h" +#include "gsteffectv.h" #include @@ -83,14 +84,6 @@ gst_shagadelictv_set_caps (GstBaseTransform * btrans, GstCaps * incaps, return ret; } -static inline guint -fastrand (void) -{ - static guint fastrand_val; - - return (fastrand_val = fastrand_val * 1103515245 + 12345); -} - static void gst_shagadelic_initialize (GstShagadelicTV * filter) { -- cgit