summaryrefslogtreecommitdiffstats
path: root/gst/virtualdub
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2004-03-15 19:32:27 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2004-03-15 19:32:27 +0000
commit4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69 (patch)
tree8f41b30e571aa6ed88b53f5471d5e38461136e60 /gst/virtualdub
parent9f4226fe55f09cf5809376b467aa3f46dbf7b5c2 (diff)
downloadgst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.tar.gz
gst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.tar.bz2
gst-plugins-bad-4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69.zip
don't mix tabs and spaces
Original commit message from CVS: don't mix tabs and spaces
Diffstat (limited to 'gst/virtualdub')
-rw-r--r--gst/virtualdub/gstvirtualdub.c66
-rw-r--r--gst/virtualdub/gstxsharpen.c128
2 files changed, 97 insertions, 97 deletions
diff --git a/gst/virtualdub/gstvirtualdub.c b/gst/virtualdub/gstvirtualdub.c
index 2495d449..cdaccf9f 100644
--- a/gst/virtualdub/gstvirtualdub.c
+++ b/gst/virtualdub/gstvirtualdub.c
@@ -46,21 +46,21 @@ gst_virtualdub_src_factory (void)
if (!templ) {
templ = GST_PAD_TEMPLATE_NEW ("src",
- GST_PAD_SRC,
- GST_PAD_ALWAYS,
- GST_CAPS_NEW ("virtualdub_src",
- "video/x-raw-rgb",
- "bpp", GST_PROPS_INT (32),
- "depth", GST_PROPS_INT (32),
- "endianness", GST_PROPS_INT (G_BYTE_ORDER),
- "red_mask", GST_PROPS_INT (0xff0000),
- "green_mask", GST_PROPS_INT (0xff00),
- "blue_mask", GST_PROPS_INT (0xff),
- "width", GST_PROPS_INT_RANGE (16, 4096),
- "height", GST_PROPS_INT_RANGE (16, 4096),
- "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT)
- )
- );
+ GST_PAD_SRC,
+ GST_PAD_ALWAYS,
+ GST_CAPS_NEW ("virtualdub_src",
+ "video/x-raw-rgb",
+ "bpp", GST_PROPS_INT (32),
+ "depth", GST_PROPS_INT (32),
+ "endianness", GST_PROPS_INT (G_BYTE_ORDER),
+ "red_mask", GST_PROPS_INT (0xff0000),
+ "green_mask", GST_PROPS_INT (0xff00),
+ "blue_mask", GST_PROPS_INT (0xff),
+ "width", GST_PROPS_INT_RANGE (16, 4096),
+ "height", GST_PROPS_INT_RANGE (16, 4096),
+ "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT)
+ )
+ );
}
return templ;
}
@@ -72,21 +72,21 @@ gst_virtualdub_sink_factory (void)
if (!templ) {
templ = GST_PAD_TEMPLATE_NEW ("sink",
- GST_PAD_SINK,
- GST_PAD_ALWAYS,
- GST_CAPS_NEW ("virtualdub_sink",
- "video/x-raw-rgb",
- "bpp", GST_PROPS_INT (32),
- "depth", GST_PROPS_INT (32),
- "endianness", GST_PROPS_INT (G_BYTE_ORDER),
- "red_mask", GST_PROPS_INT (0xff0000),
- "green_mask", GST_PROPS_INT (0xff00),
- "blue_mask", GST_PROPS_INT (0xff),
- "width", GST_PROPS_INT_RANGE (16, 4096),
- "height", GST_PROPS_INT_RANGE (16, 4096),
- "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT)
- )
- );
+ GST_PAD_SINK,
+ GST_PAD_ALWAYS,
+ GST_CAPS_NEW ("virtualdub_sink",
+ "video/x-raw-rgb",
+ "bpp", GST_PROPS_INT (32),
+ "depth", GST_PROPS_INT (32),
+ "endianness", GST_PROPS_INT (G_BYTE_ORDER),
+ "red_mask", GST_PROPS_INT (0xff0000),
+ "green_mask", GST_PROPS_INT (0xff00),
+ "blue_mask", GST_PROPS_INT (0xff),
+ "width", GST_PROPS_INT_RANGE (16, 4096),
+ "height", GST_PROPS_INT_RANGE (16, 4096),
+ "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT)
+ )
+ );
}
return templ;
}
@@ -99,16 +99,16 @@ plugin_init (GModule * module, GstPlugin * plugin)
while (_elements[i].name) {
factory = gst_element_factory_new (_elements[i].name,
- (_elements[i].type) (), _elements[i].details);
+ (_elements[i].type) (), _elements[i].details);
if (!factory) {
g_warning ("gst_virtualdub_new failed for `%s'", _elements[i].name);
continue;
}
gst_element_factory_add_pad_template (factory,
- gst_virtualdub_src_factory ());
+ gst_virtualdub_src_factory ());
gst_element_factory_add_pad_template (factory,
- gst_virtualdub_sink_factory ());
+ gst_virtualdub_sink_factory ());
gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory));
if (_elements[i].factoryinit) {
diff --git a/gst/virtualdub/gstxsharpen.c b/gst/virtualdub/gstxsharpen.c
index df4d4547..a8d5413c 100644
--- a/gst/virtualdub/gstxsharpen.c
+++ b/gst/virtualdub/gstxsharpen.c
@@ -107,8 +107,8 @@ gst_xsharpen_get_type (void)
};
xsharpen_type =
- g_type_register_static (GST_TYPE_ELEMENT, "GstXsharpen", &xsharpen_info,
- 0);
+ g_type_register_static (GST_TYPE_ELEMENT, "GstXsharpen", &xsharpen_info,
+ 0);
}
return xsharpen_type;
}
@@ -126,11 +126,11 @@ gst_xsharpen_class_init (GstXsharpenClass * klass)
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STRENGTH,
g_param_spec_int ("strength", "strength", "strength",
- 0, 255, 255, (GParamFlags) G_PARAM_READWRITE));
+ 0, 255, 255, (GParamFlags) G_PARAM_READWRITE));
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_THRESHOLD,
g_param_spec_int ("threshold", "threshold", "threshold",
- 0, 255, 255, (GParamFlags) G_PARAM_READWRITE));
+ 0, 255, 255, (GParamFlags) G_PARAM_READWRITE));
gobject_class->set_property = gst_xsharpen_set_property;
gobject_class->get_property = gst_xsharpen_get_property;
@@ -204,10 +204,10 @@ gst_xsharpen_chain (GstPad * pad, GstData * _data)
src =
(Pixel *) ((char *) src_buf + (xsharpen->height -
- 1) * xsharpen->srcpitch);
+ 1) * xsharpen->srcpitch);
dst =
(Pixel *) ((char *) dst_buf + (xsharpen->height -
- 1) * xsharpen->dstpitch);
+ 1) * xsharpen->dstpitch);
for (x = 0; x < xsharpen->width; x++) {
dst[x] = src[x];
@@ -252,100 +252,100 @@ gst_xsharpen_chain (GstPad * pad, GstData * _data)
p = ((Pixel32 *) ((char *) src - xsharpen->srcpitch))[x - 1];
luma = p >> 24;
if (luma > lumamax) {
- lumamax = luma;
- max = p;
+ lumamax = luma;
+ max = p;
}
if (luma < lumamin) {
- lumamin = luma;
- min = p;
+ lumamin = luma;
+ min = p;
}
p = ((Pixel32 *) ((char *) src - xsharpen->srcpitch))[x];
luma = p >> 24;
if (luma > lumamax) {
- lumamax = luma;
- max = p;
+ lumamax = luma;
+ max = p;
}
if (luma < lumamin) {
- lumamin = luma;
- min = p;
+ lumamin = luma;
+ min = p;
}
p = ((Pixel32 *) ((char *) src - xsharpen->srcpitch))[x + 1];
luma = p >> 24;
if (luma > lumamax) {
- lumamax = luma;
- max = p;
+ lumamax = luma;
+ max = p;
}
if (luma < lumamin) {
- lumamin = luma;
- min = p;
+ lumamin = luma;
+ min = p;
}
p = src[x - 1];
luma = p >> 24;
if (luma > lumamax) {
- lumamax = luma;
- max = p;
+ lumamax = luma;
+ max = p;
}
if (luma < lumamin) {
- lumamin = luma;
- min = p;
+ lumamin = luma;
+ min = p;
}
p = src[x];
lumac = luma = p >> 24;
if (luma > lumamax) {
- lumamax = luma;
- max = p;
+ lumamax = luma;
+ max = p;
}
if (luma < lumamin) {
- lumamin = luma;
- min = p;
+ lumamin = luma;
+ min = p;
}
p = src[x + 1];
luma = p >> 24;
if (luma > lumamax) {
- lumamax = luma;
- max = p;
+ lumamax = luma;
+ max = p;
}
if (luma < lumamin) {
- lumamin = luma;
- min = p;
+ lumamin = luma;
+ min = p;
}
p = ((Pixel32 *) ((char *) src + xsharpen->srcpitch))[x - 1];
luma = p >> 24;
if (luma > lumamax) {
- lumamax = luma;
- max = p;
+ lumamax = luma;
+ max = p;
}
if (luma < lumamin) {
- lumamin = luma;
- min = p;
+ lumamin = luma;
+ min = p;
}
p = ((Pixel32 *) ((char *) src + xsharpen->srcpitch))[x];
luma = p >> 24;
if (luma > lumamax) {
- lumamax = luma;
- max = p;
+ lumamax = luma;
+ max = p;
}
if (luma < lumamin) {
- lumamin = luma;
- min = p;
+ lumamin = luma;
+ min = p;
}
p = ((Pixel32 *) ((char *) src + xsharpen->srcpitch))[x + 1];
luma = p >> 24;
if (luma > lumamax) {
- lumamax = luma;
- max = p;
+ lumamax = luma;
+ max = p;
}
if (luma < lumamin) {
- lumamin = luma;
- min = p;
+ lumamin = luma;
+ min = p;
}
/* Determine whether the current pixel is closer to the
@@ -356,32 +356,32 @@ gst_xsharpen_chain (GstPad * pad, GstData * _data)
p = -1;
if (xsharpen->strength != 0) {
- mindiff = lumac - lumamin;
- maxdiff = lumamax - lumac;
- if (mindiff > maxdiff) {
- if (maxdiff < xsharpen->threshold) {
- p = max;
- }
- } else {
- if (mindiff < xsharpen->threshold) {
- p = min;
- }
- }
+ mindiff = lumac - lumamin;
+ maxdiff = lumamax - lumac;
+ if (mindiff > maxdiff) {
+ if (maxdiff < xsharpen->threshold) {
+ p = max;
+ }
+ } else {
+ if (mindiff < xsharpen->threshold) {
+ p = min;
+ }
+ }
}
if (p == -1) {
- dst[x] = src[x];
+ dst[x] = src[x];
} else {
- R = (src[x] >> 16) & 0xff;
- G = (src[x] >> 8) & 0xff;
- B = src[x] & 0xff;
- r = (p >> 16) & 0xff;
- g = (p >> 8) & 0xff;
- b = p & 0xff;
- r = (xsharpen->strength * r + xsharpen->strengthinv * R) / 255;
- g = (xsharpen->strength * g + xsharpen->strengthinv * G) / 255;
- b = (xsharpen->strength * b + xsharpen->strengthinv * B) / 255;
- dst[x] = (r << 16) | (g << 8) | b;
+ R = (src[x] >> 16) & 0xff;
+ G = (src[x] >> 8) & 0xff;
+ B = src[x] & 0xff;
+ r = (p >> 16) & 0xff;
+ g = (p >> 8) & 0xff;
+ b = p & 0xff;
+ r = (xsharpen->strength * r + xsharpen->strengthinv * R) / 255;
+ g = (xsharpen->strength * g + xsharpen->strengthinv * G) / 255;
+ b = (xsharpen->strength * b + xsharpen->strengthinv * B) / 255;
+ dst[x] = (r << 16) | (g << 8) | b;
}
}
src = (Pixel *) ((char *) src + xsharpen->srcpitch);