GST_TYPE_GL_EFFECTS_EFFECT,
GST_GL_EFFECT_IDENTITY,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property (
+ gobject_class,
+ PROP_HSWAP,
+ g_param_spec_boolean ("hswap",
+ "Horizontal Swap",
+ "Switch video texture left to right, useful with webcams",
+ FALSE,
+ G_PARAM_READWRITE));
}
void
glEnd ();
}
-/* static void */
-/* set_orizonthal_switch (GstGLDisplay *display, gpointer data) */
-/* { */
-/* // GstGLEffects *effects = GST_GL_EFFECTS (data); */
+static void
+set_horizontal_swap (GstGLDisplay *display, gpointer data)
+{
+// GstGLEffects *effects = GST_GL_EFFECTS (data);
-/* const double mirrormatrix[16] = { */
-/* -1.0, 0.0, 0.0, 0.0, */
-/* 0.0, 1.0, 0.0, 0.0, */
-/* 0.0, 0.0, 1.0, 0.0, */
-/* 0.0, 0.0, 0.0, 1.0 */
-/* }; */
+ const double mirrormatrix[16] = {
+ -1.0, 0.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0, 0.0,
+ 0.0, 0.0, 1.0, 0.0,
+ 0.0, 0.0, 0.0, 1.0
+ };
-/* glMatrixMode (GL_MODELVIEW); */
-/* glLoadMatrixd (mirrormatrix); */
-/* } */
+ glMatrixMode (GL_MODELVIEW);
+ glLoadMatrixd (mirrormatrix);
+}
static void
gst_gl_effects_init (GstGLEffects * effects, GstGLEffectsClass * klass)
}
effects->effect = gst_gl_effects_identity;
+ effects->horizontal_swap = FALSE;
}
static void
case PROP_EFFECT:
gst_gl_effects_set_effect (effects, g_value_get_enum (value));
break;
+ case PROP_HSWAP:
+ effects->horizontal_swap = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
case PROP_EFFECT:
g_value_set_enum (value, effects->current_effect);
break;
+ case PROP_HSWAP:
+ g_value_set_boolean (value, effects->horizontal_swap);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
effects->intexture = inbuf->texture;
effects->outtexture = outbuf->texture;
+ if (effects->horizontal_swap == TRUE)
+ gst_gl_display_thread_add (filter->display, set_horizontal_swap, effects);
+
effects->effect (effects);
return TRUE;