[gst-cvs] gst-plugins-good: shagadelictv: Use guint8/gint8 instead of char ( which can be signed or unsigned)
Sebastian Dröge
slomo at kemper.freedesktop.org
Mon Jun 15 12:13:45 PDT 2009
Module: gst-plugins-good
Branch: master
Commit: aaf8c8769d5420be69c455100d54989009a4f4d3
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=aaf8c8769d5420be69c455100d54989009a4f4d3
Author: Sebastian Dröge <sebastian.droege at collabora.co.uk>
Date: Mon Jun 15 20:36:39 2009 +0200
shagadelictv: Use guint8/gint8 instead of char (which can be signed or unsigned)
---
gst/effectv/gstshagadelic.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/gst/effectv/gstshagadelic.c b/gst/effectv/gstshagadelic.c
index 685cd9c..8499449 100644
--- a/gst/effectv/gstshagadelic.c
+++ b/gst/effectv/gstshagadelic.c
@@ -58,9 +58,9 @@ struct _GstShagadelicTV
gint width, height;
gint stat;
- gchar *ripple;
- gchar *spiral;
- guchar phase;
+ guint8 *ripple;
+ guint8 *spiral;
+ guint8 phase;
gint rx, ry;
gint bx, by;
gint rvx, rvy;
@@ -108,8 +108,8 @@ gst_shagadelictv_set_caps (GstBaseTransform * btrans, GstCaps * incaps,
g_free (filter->ripple);
g_free (filter->spiral);
- filter->ripple = (gchar *) g_malloc (area * 4);
- filter->spiral = (gchar *) g_malloc (area);
+ filter->ripple = (guint8 *) g_malloc (area * 4);
+ filter->spiral = (guint8 *) g_malloc (area);
gst_shagadelic_initialize (filter);
ret = TRUE;
@@ -214,7 +214,7 @@ gst_shagadelictv_transform (GstBaseTransform * trans, GstBuffer * in,
guint32 *src, *dest;
gint x, y;
guint32 v;
- guchar r, g, b;
+ guint8 r, g, b;
gint width, height;
GstFlowReturn ret = GST_FLOW_OK;
@@ -233,11 +233,11 @@ gst_shagadelictv_transform (GstBaseTransform * trans, GstBuffer * in,
* v = *src++;
* *dest++ = v & ((r<<16)|(g<<8)|b);
*/
- r = (gchar) (filter->ripple[(filter->ry + y) * width * 2 + filter->rx +
- x] + filter->phase * 2) >> 7;
- g = (gchar) (filter->spiral[y * width + x] + filter->phase * 3) >> 7;
- b = (gchar) (filter->ripple[(filter->by + y) * width * 2 + filter->bx +
- x] - filter->phase) >> 7;
+ r = ((gint8) (filter->ripple[(filter->ry + y) * width * 2 + filter->rx +
+ x] + filter->phase * 2)) >> 7;
+ g = ((gint8) (filter->spiral[y * width + x] + filter->phase * 3)) >> 7;
+ b = ((gint8) (filter->ripple[(filter->by + y) * width * 2 + filter->bx +
+ x] - filter->phase)) >> 7;
*dest++ = v & ((r << 16) | (g << 8) | b);
}
}
More information about the Gstreamer-commits
mailing list