summaryrefslogtreecommitdiffstats
path: root/gst/videofilter
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
commit6cc1c73d2baa95c46edc04f57cbe9ed690dc2f21 (patch)
tree82b5546809a42a56a7bc18bacf8ed6e209ad006e /gst/videofilter
parentd07ec45fa47fbd0e36224e11bcd8ba2faee1a78c (diff)
don't mix tabs and spaces
Original commit message from CVS: don't mix tabs and spaces
Diffstat (limited to 'gst/videofilter')
-rw-r--r--gst/videofilter/gstgamma.c25
-rw-r--r--gst/videofilter/gstvideobalance.c32
-rw-r--r--gst/videofilter/gstvideofilter.c39
-rw-r--r--gst/videofilter/gstvideoflip.c58
-rw-r--r--gst/videofilter/gstvideotemplate.c9
5 files changed, 84 insertions, 79 deletions
diff --git a/gst/videofilter/gstgamma.c b/gst/videofilter/gstgamma.c
index 7cc2b0fd..118c99f4 100644
--- a/gst/videofilter/gstgamma.c
+++ b/gst/videofilter/gstgamma.c
@@ -119,8 +119,9 @@ gst_gamma_get_type (void)
0,
gst_gamma_init,
};
+
gamma_type = g_type_register_static (GST_TYPE_VIDEOFILTER,
- "GstGamma", &gamma_info, 0);
+ "GstGamma", &gamma_info, 0);
}
return gamma_type;
}
@@ -165,16 +166,16 @@ gst_gamma_class_init (gpointer g_class, gpointer class_data)
g_object_class_install_property (gobject_class, ARG_GAMMA,
g_param_spec_double ("gamma", "Gamma", "gamma",
- 0.01, 10, 1, G_PARAM_READWRITE));
+ 0.01, 10, 1, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_GAMMA_R,
g_param_spec_double ("redgamma", "Gamma_r",
- "gamma value for the red channel", 0.01, 10, 1, G_PARAM_READWRITE));
+ "gamma value for the red channel", 0.01, 10, 1, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_GAMMA_G,
g_param_spec_double ("greengamma", "Gamma_g",
- "gamma value for the green channel", 0.01, 10, 1, G_PARAM_READWRITE));
+ "gamma value for the green channel", 0.01, 10, 1, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_GAMMA_B,
g_param_spec_double ("bluegamma", "Gamma_b",
- "gamma value for the blue channel", 0.01, 10, 1, G_PARAM_READWRITE));
+ "gamma value for the blue channel", 0.01, 10, 1, G_PARAM_READWRITE));
gobject_class->set_property = gst_gamma_set_property;
gobject_class->get_property = gst_gamma_get_property;
@@ -353,10 +354,10 @@ gst_gamma_planar411 (GstVideofilter * videofilter, void *dest, void *src)
int x, y;
for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++) {
- cdest[y * width + x] =
- gamma->gamma_table[(unsigned char) csrc[y * width + x]];
- }
+ for (x = 0; x < width; x++) {
+ cdest[y * width + x] =
+ gamma->gamma_table[(unsigned char) csrc[y * width + x]];
+ }
}
}
}
@@ -421,10 +422,10 @@ gst_gamma_rgb32 (GstVideofilter * videofilter, void *dest, void *src)
i = 0;
while (i < width * height * 4) {
if ((i % 4) != 3)
- *cdest++ = gamma->gamma_table[*csrc++];
+ *cdest++ = gamma->gamma_table[*csrc++];
else {
- cdest++;
- csrc++;
+ cdest++;
+ csrc++;
}
i++;
}
diff --git a/gst/videofilter/gstvideobalance.c b/gst/videofilter/gstvideobalance.c
index 2acad7c3..083e5e8a 100644
--- a/gst/videofilter/gstvideobalance.c
+++ b/gst/videofilter/gstvideobalance.c
@@ -107,12 +107,12 @@ gst_videobalance_get_type (void)
};
videobalance_type = g_type_register_static (GST_TYPE_VIDEOFILTER,
- "GstVideobalance", &videobalance_info, 0);
+ "GstVideobalance", &videobalance_info, 0);
g_type_add_interface_static (videobalance_type,
- GST_TYPE_IMPLEMENTS_INTERFACE, &iface_info);
+ GST_TYPE_IMPLEMENTS_INTERFACE, &iface_info);
g_type_add_interface_static (videobalance_type, GST_TYPE_COLOR_BALANCE,
- &colorbalance_info);
+ &colorbalance_info);
}
return videobalance_type;
}
@@ -138,7 +138,7 @@ gst_videobalance_base_init (gpointer g_class)
for (i = 0; i < G_N_ELEMENTS (gst_videobalance_formats); i++) {
gst_videofilter_class_add_format (videofilter_class,
- gst_videobalance_formats + i);
+ gst_videobalance_formats + i);
}
gst_videofilter_class_add_pad_templates (GST_VIDEOFILTER_CLASS (g_class));
@@ -189,15 +189,15 @@ gst_videobalance_class_init (gpointer g_class, gpointer class_data)
g_object_class_install_property (gobject_class, ARG_CONTRAST,
g_param_spec_double ("contrast", "Contrast", "contrast",
- 0, 2, 1, G_PARAM_READWRITE));
+ 0, 2, 1, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_BRIGHTNESS,
g_param_spec_double ("brightness", "Brightness", "brightness",
- -1, 1, 0, G_PARAM_READWRITE));
+ -1, 1, 0, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_HUE,
g_param_spec_double ("hue", "Hue", "hue", -1, 1, 0, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_SATURATION,
g_param_spec_double ("saturation", "Saturation", "saturation",
- 0, 2, 1, G_PARAM_READWRITE));
+ 0, 2, 1, G_PARAM_READWRITE));
gobject_class->set_property = gst_videobalance_set_property;
gobject_class->get_property = gst_videobalance_get_property;
@@ -473,13 +473,13 @@ gst_videobalance_update_tables_planar411 (GstVideobalance * vb)
u = 128 + ((i * hue_cos + j * hue_sin) * vb->saturation);
v = 128 + ((-i * hue_sin + j * hue_cos) * vb->saturation);
if (u < 0)
- u = 0;
+ u = 0;
else if (u > 255)
- u = 255;
+ u = 255;
if (v < 0)
- v = 0;
+ v = 0;
else if (v > 255)
- v = 255;
+ v = 255;
vb->tableu[i + 128][j + 128] = rint (u);
vb->tablev[i + 128][j + 128] = rint (v);
}
@@ -526,7 +526,7 @@ gst_videobalance_planar411 (GstVideofilter * videofilter, void *dest, void *src)
for (y = 0; y < height; y++) {
tablelookup_u8 (cdest + y * width, 1, csrc + y * width, 1,
- videobalance->tabley, 1, width);
+ videobalance->tabley, 1, width);
}
}
@@ -542,10 +542,10 @@ gst_videobalance_planar411 (GstVideofilter * videofilter, void *dest, void *src)
for (y = 0; y < height / 2; y++) {
for (x = 0; x < width / 2; x++) {
- u1 = usrc[y * (width / 2) + x];
- v1 = vsrc[y * (width / 2) + x];
- udest[y * (width / 2) + x] = videobalance->tableu[u1][v1];
- vdest[y * (width / 2) + x] = videobalance->tablev[u1][v1];
+ u1 = usrc[y * (width / 2) + x];
+ v1 = vsrc[y * (width / 2) + x];
+ udest[y * (width / 2) + x] = videobalance->tableu[u1][v1];
+ vdest[y * (width / 2) + x] = videobalance->tablev[u1][v1];
}
}
}
diff --git a/gst/videofilter/gstvideofilter.c b/gst/videofilter/gstvideofilter.c
index 590616bc..f46d69e7 100644
--- a/gst/videofilter/gstvideofilter.c
+++ b/gst/videofilter/gstvideofilter.c
@@ -74,8 +74,9 @@ gst_videofilter_get_type (void)
0,
gst_videofilter_init,
};
+
videofilter_type = g_type_register_static (GST_TYPE_ELEMENT,
- "GstVideofilter", &videofilter_info, G_TYPE_FLAG_ABSTRACT);
+ "GstVideofilter", &videofilter_info, G_TYPE_FLAG_ABSTRACT);
}
return videofilter_type;
}
@@ -129,15 +130,15 @@ gst_videofilter_format_get_structure (GstVideofilterFormat * format)
if (format->depth) {
structure = gst_structure_new ("video/x-raw-rgb",
- "depth", G_TYPE_INT, format->depth,
- "bpp", G_TYPE_INT, format->bpp,
- "endianness", G_TYPE_INT, format->endianness,
- "red_mask", G_TYPE_INT, format->red_mask,
- "green_mask", G_TYPE_INT, format->green_mask,
- "blue_mask", G_TYPE_INT, format->blue_mask, NULL);
+ "depth", G_TYPE_INT, format->depth,
+ "bpp", G_TYPE_INT, format->bpp,
+ "endianness", G_TYPE_INT, format->endianness,
+ "red_mask", G_TYPE_INT, format->red_mask,
+ "green_mask", G_TYPE_INT, format->green_mask,
+ "blue_mask", G_TYPE_INT, format->blue_mask, NULL);
} else {
structure = gst_structure_new ("video/x-raw-yuv",
- "format", GST_TYPE_FOURCC, fourcc, NULL);
+ "format", GST_TYPE_FOURCC, fourcc, NULL);
}
gst_structure_set (structure,
@@ -158,8 +159,8 @@ gst_videofilter_class_get_capslist (GstVideofilterClass * klass)
caps = gst_caps_new_empty ();
for (i = 0; i < klass->formats->len; i++) {
structure =
- gst_videofilter_format_get_structure (g_ptr_array_index (klass->formats,
- i));
+ gst_videofilter_format_get_structure (g_ptr_array_index (klass->formats,
+ i));
gst_caps_append_structure (caps, structure);
}
@@ -201,8 +202,8 @@ gst_videofilter_getcaps (GstPad * pad)
GstCaps *fromcaps;
fromcaps =
- gst_caps_new_full (gst_videofilter_format_get_structure
- (g_ptr_array_index (klass->formats, i)), NULL);
+ gst_caps_new_full (gst_videofilter_format_get_structure
+ (g_ptr_array_index (klass->formats, i)), NULL);
icaps = gst_caps_intersect (fromcaps, peercaps);
if (icaps != NULL) {
@@ -342,7 +343,7 @@ gst_videofilter_chain (GstPad * pad, GstData * _data)
if (size > videofilter->from_buf_size) {
GST_INFO ("buffer size %ld larger than expected (%d)",
- size, videofilter->from_buf_size);
+ size, videofilter->from_buf_size);
}
outbuf = gst_pad_alloc_buffer (videofilter->srcpad, GST_BUFFER_OFFSET_NONE,
@@ -505,7 +506,7 @@ gst_videofilter_find_format_by_structure (GstVideofilter * videofilter,
format = g_ptr_array_index (klass->formats, i);
format_fourcc = GST_STR_FOURCC (format->fourcc);
if (format->depth == 0 && format_fourcc == fourcc) {
- return format;
+ return format;
}
}
} else if (strcmp (gst_structure_get_name (structure), "video/x-raw-rgb")
@@ -528,9 +529,9 @@ gst_videofilter_find_format_by_structure (GstVideofilter * videofilter,
for (i = 0; i < klass->formats->len; i++) {
format = g_ptr_array_index (klass->formats, i);
if (format->bpp == bpp && format->depth == depth &&
- format->endianness == endianness && format->red_mask == red_mask &&
- format->green_mask == green_mask && format->blue_mask == blue_mask) {
- return format;
+ format->endianness == endianness && format->red_mask == red_mask &&
+ format->green_mask == green_mask && format->blue_mask == blue_mask) {
+ return format;
}
}
}
@@ -553,11 +554,11 @@ gst_videofilter_class_add_pad_templates (GstVideofilterClass *
gst_element_class_add_pad_template (element_class,
gst_pad_template_new ("src", GST_PAD_SRC, GST_PAD_ALWAYS,
- gst_videofilter_class_get_capslist (videofilter_class)));
+ gst_videofilter_class_get_capslist (videofilter_class)));
gst_element_class_add_pad_template (element_class,
gst_pad_template_new ("sink", GST_PAD_SINK, GST_PAD_ALWAYS,
- gst_videofilter_class_get_capslist (videofilter_class)));
+ gst_videofilter_class_get_capslist (videofilter_class)));
}
static gboolean
diff --git a/gst/videofilter/gstvideoflip.c b/gst/videofilter/gstvideoflip.c
index 32157b61..a434107a 100644
--- a/gst/videofilter/gstvideoflip.c
+++ b/gst/videofilter/gstvideoflip.c
@@ -72,14 +72,15 @@ gst_videoflip_method_get_type (void)
{GST_VIDEOFLIP_METHOD_HORIZ, "4", "Flip horizontally"},
{GST_VIDEOFLIP_METHOD_VERT, "5", "Flip vertically"},
{GST_VIDEOFLIP_METHOD_TRANS, "6",
- "Flip across upper left/lower right diagonal"},
+ "Flip across upper left/lower right diagonal"},
{GST_VIDEOFLIP_METHOD_OTHER, "7",
- "Flip across upper right/lower left diagonal"},
+ "Flip across upper right/lower left diagonal"},
{0, NULL, NULL},
};
+
if (!videoflip_method_type) {
videoflip_method_type = g_enum_register_static ("GstVideoflipMethod",
- videoflip_methods);
+ videoflip_methods);
}
return videoflip_method_type;
}
@@ -101,8 +102,9 @@ gst_videoflip_get_type (void)
0,
gst_videoflip_init,
};
+
videoflip_type = g_type_register_static (GST_TYPE_VIDEOFILTER,
- "GstVideoflip", &videoflip_info, 0);
+ "GstVideoflip", &videoflip_info, 0);
}
return videoflip_type;
}
@@ -130,7 +132,7 @@ gst_videoflip_base_init (gpointer g_class)
for (i = 0; i < G_N_ELEMENTS (gst_videoflip_formats); i++) {
gst_videofilter_class_add_format (videofilter_class,
- gst_videoflip_formats + i);
+ gst_videoflip_formats + i);
}
gst_videofilter_class_add_pad_templates (GST_VIDEOFILTER_CLASS (g_class));
@@ -147,8 +149,8 @@ gst_videoflip_class_init (gpointer g_class, gpointer class_data)
g_object_class_install_property (gobject_class, ARG_METHOD,
g_param_spec_enum ("method", "method", "method",
- GST_TYPE_VIDEOFLIP_METHOD, GST_VIDEOFLIP_METHOD_90R,
- G_PARAM_READWRITE));
+ GST_TYPE_VIDEOFLIP_METHOD, GST_VIDEOFLIP_METHOD_90R,
+ G_PARAM_READWRITE));
gobject_class->set_property = gst_videoflip_set_property;
gobject_class->get_property = gst_videoflip_get_property;
@@ -332,51 +334,51 @@ gst_videoflip_flip (GstVideoflip * videoflip, unsigned char *dest,
switch (videoflip->method) {
case GST_VIDEOFLIP_METHOD_90R:
for (y = 0; y < dh; y++) {
- for (x = 0; x < dw; x++) {
- dest[y * dw + x] = src[(sh - 1 - x) * sw + y];
- }
+ for (x = 0; x < dw; x++) {
+ dest[y * dw + x] = src[(sh - 1 - x) * sw + y];
+ }
}
break;
case GST_VIDEOFLIP_METHOD_90L:
for (y = 0; y < dh; y++) {
- for (x = 0; x < dw; x++) {
- dest[y * dw + x] = src[x * sw + (sw - 1 - y)];
- }
+ for (x = 0; x < dw; x++) {
+ dest[y * dw + x] = src[x * sw + (sw - 1 - y)];
+ }
}
break;
case GST_VIDEOFLIP_METHOD_180:
for (y = 0; y < dh; y++) {
- for (x = 0; x < dw; x++) {
- dest[y * dw + x] = src[(sh - 1 - y) * sw + (sw - 1 - x)];
- }
+ for (x = 0; x < dw; x++) {
+ dest[y * dw + x] = src[(sh - 1 - y) * sw + (sw - 1 - x)];
+ }
}
break;
case GST_VIDEOFLIP_METHOD_HORIZ:
for (y = 0; y < dh; y++) {
- for (x = 0; x < dw; x++) {
- dest[y * dw + x] = src[y * sw + (sw - 1 - x)];
- }
+ for (x = 0; x < dw; x++) {
+ dest[y * dw + x] = src[y * sw + (sw - 1 - x)];
+ }
}
break;
case GST_VIDEOFLIP_METHOD_VERT:
for (y = 0; y < dh; y++) {
- for (x = 0; x < dw; x++) {
- dest[y * dw + x] = src[(sh - 1 - y) * sw + x];
- }
+ for (x = 0; x < dw; x++) {
+ dest[y * dw + x] = src[(sh - 1 - y) * sw + x];
+ }
}
break;
case GST_VIDEOFLIP_METHOD_TRANS:
for (y = 0; y < dh; y++) {
- for (x = 0; x < dw; x++) {
- dest[y * dw + x] = src[x * sw + y];
- }
+ for (x = 0; x < dw; x++) {
+ dest[y * dw + x] = src[x * sw + y];
+ }
}
break;
case GST_VIDEOFLIP_METHOD_OTHER:
for (y = 0; y < dh; y++) {
- for (x = 0; x < dw; x++) {
- dest[y * dw + x] = src[(sh - 1 - x) * sw + (sw - 1 - y)];
- }
+ for (x = 0; x < dw; x++) {
+ dest[y * dw + x] = src[(sh - 1 - x) * sw + (sw - 1 - y)];
+ }
}
break;
default:
diff --git a/gst/videofilter/gstvideotemplate.c b/gst/videofilter/gstvideotemplate.c
index abe699fe..aa64ef89 100644
--- a/gst/videofilter/gstvideotemplate.c
+++ b/gst/videofilter/gstvideotemplate.c
@@ -103,8 +103,9 @@ gst_videotemplate_get_type (void)
0,
gst_videotemplate_init,
};
+
videotemplate_type = g_type_register_static (GST_TYPE_VIDEOFILTER,
- "GstVideotemplate", &videotemplate_info, 0);
+ "GstVideotemplate", &videotemplate_info, 0);
}
return videotemplate_type;
}
@@ -130,7 +131,7 @@ gst_videotemplate_base_init (gpointer g_class)
for (i = 0; i < G_N_ELEMENTS (gst_videotemplate_formats); i++) {
gst_videofilter_class_add_format (videofilter_class,
- gst_videotemplate_formats + i);
+ gst_videotemplate_formats + i);
}
gst_videofilter_class_add_pad_templates (GST_VIDEOFILTER_CLASS (g_class));
@@ -148,8 +149,8 @@ gst_videotemplate_class_init (gpointer g_class, gpointer class_data)
#if 0
g_object_class_install_property (gobject_class, ARG_METHOD,
g_param_spec_enum ("method", "method", "method",
- GST_TYPE_VIDEOTEMPLATE_METHOD, GST_VIDEOTEMPLATE_METHOD_1,
- G_PARAM_READWRITE));
+ GST_TYPE_VIDEOTEMPLATE_METHOD, GST_VIDEOTEMPLATE_METHOD_1,
+ G_PARAM_READWRITE));
#endif
gobject_class->set_property = gst_videotemplate_set_property;