mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
[595/906] update for filter API change
gleffects needed a similar change
This commit is contained in:
parent
e969f6d904
commit
30ec55853e
25 changed files with 86 additions and 87 deletions
|
@ -58,7 +58,7 @@ gst_gl_effects_bulge_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -66,6 +66,6 @@ gst_gl_effects_bulge (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_bulge_callback, effects);
|
effects->outtexture, gst_gl_effects_bulge_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ gst_gl_effects_fisheye_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -66,6 +66,6 @@ gst_gl_effects_fisheye (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_fisheye_callback, effects);
|
effects->outtexture, gst_gl_effects_fisheye_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ gst_gl_effects_glow_step_one (gint width, gint height, guint texture,
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -102,7 +102,7 @@ gst_gl_effects_glow_step_two (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
|
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -141,7 +141,7 @@ gst_gl_effects_glow_step_three (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
|
gst_gl_shader_set_uniform_1fv (shader, "kernel", 7, gauss_kernel);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -188,7 +188,7 @@ gst_gl_effects_glow_step_four (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1f (shader, "beta", (gfloat) 1 / 3.5f);
|
gst_gl_shader_set_uniform_1f (shader, "beta", (gfloat) 1 / 3.5f);
|
||||||
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -197,14 +197,14 @@ gst_gl_effects_glow (GstGLEffects * effects)
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
/* threshold */
|
/* threshold */
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->midtexture[0], gst_gl_effects_glow_step_one, effects);
|
effects->midtexture[0], gst_gl_effects_glow_step_one, effects);
|
||||||
/* blur */
|
/* blur */
|
||||||
gst_gl_filter_render_to_target (filter, effects->midtexture[0],
|
gst_gl_filter_render_to_target (filter, FALSE, effects->midtexture[0],
|
||||||
effects->midtexture[1], gst_gl_effects_glow_step_two, effects);
|
effects->midtexture[1], gst_gl_effects_glow_step_two, effects);
|
||||||
gst_gl_filter_render_to_target (filter, effects->midtexture[1],
|
gst_gl_filter_render_to_target (filter, FALSE, effects->midtexture[1],
|
||||||
effects->midtexture[2], gst_gl_effects_glow_step_three, effects);
|
effects->midtexture[2], gst_gl_effects_glow_step_three, effects);
|
||||||
/* add blurred luma to intexture */
|
/* add blurred luma to intexture */
|
||||||
gst_gl_filter_render_to_target (filter, effects->midtexture[2],
|
gst_gl_filter_render_to_target (filter, FALSE, effects->midtexture[2],
|
||||||
effects->outtexture, gst_gl_effects_glow_step_four, effects);
|
effects->outtexture, gst_gl_effects_glow_step_four, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,8 @@ gst_gl_effects_identity_callback (gint width, gint height, guint texture,
|
||||||
glMatrixMode (GL_PROJECTION);
|
glMatrixMode (GL_PROJECTION);
|
||||||
glLoadIdentity ();
|
glLoadIdentity ();
|
||||||
#else
|
#else
|
||||||
GstGLShader *shader = g_hash_table_lookup (effects->shaderstable, "identity0");
|
GstGLShader *shader =
|
||||||
|
g_hash_table_lookup (effects->shaderstable, "identity0");
|
||||||
|
|
||||||
if (!shader) {
|
if (!shader) {
|
||||||
shader = gst_gl_shader_new ();
|
shader = gst_gl_shader_new ();
|
||||||
|
@ -66,7 +67,7 @@ gst_gl_effects_identity_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -74,6 +75,6 @@ gst_gl_effects_identity (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_identity_callback, effects);
|
effects->outtexture, gst_gl_effects_identity_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
|
||||||
|
|
||||||
glDisable (GL_TEXTURE_1D);
|
glDisable (GL_TEXTURE_1D);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -99,7 +99,7 @@ gst_gl_effects_heat (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_heat_callback, effects);
|
effects->outtexture, gst_gl_effects_heat_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ gst_gl_effects_sepia (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_sepia_callback, effects);
|
effects->outtexture, gst_gl_effects_sepia_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,6 +137,6 @@ gst_gl_effects_luma_xpro (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_luma_xpro_callback, effects);
|
effects->outtexture, gst_gl_effects_luma_xpro_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ gst_gl_effects_mirror_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -93,6 +93,6 @@ gst_gl_effects_mirror (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_mirror_callback, effects);
|
effects->outtexture, gst_gl_effects_mirror_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
|
||||||
|
|
||||||
glDisable (GL_TEXTURE_1D);
|
glDisable (GL_TEXTURE_1D);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -99,6 +99,6 @@ gst_gl_effects_xpro (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_xpro_callback, effects);
|
effects->outtexture, gst_gl_effects_xpro_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ gst_gl_effects_sin_callback (gint width, gint height, guint texture,
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 0);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -63,6 +63,6 @@ gst_gl_effects_sin (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_sin_callback, effects);
|
effects->outtexture, gst_gl_effects_sin_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ gst_gl_effects_square_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -66,6 +66,6 @@ gst_gl_effects_square (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_square_callback, effects);
|
effects->outtexture, gst_gl_effects_square_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ gst_gl_effects_squeeze_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -93,6 +93,6 @@ gst_gl_effects_squeeze (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_squeeze_callback, effects);
|
effects->outtexture, gst_gl_effects_squeeze_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ gst_gl_effects_stretch_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -66,6 +66,6 @@ gst_gl_effects_stretch (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_stretch_callback, effects);
|
effects->outtexture, gst_gl_effects_stretch_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ gst_gl_effects_tunnel_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -66,6 +66,6 @@ gst_gl_effects_tunnel (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_tunnel_callback, effects);
|
effects->outtexture, gst_gl_effects_tunnel_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ gst_gl_effects_twirl_callback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "width", (gfloat) width / 2.0f);
|
||||||
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
gst_gl_shader_set_uniform_1f (shader, "height", (gfloat) height / 2.0f);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -66,6 +66,6 @@ gst_gl_effects_twirl (GstGLEffects * effects)
|
||||||
{
|
{
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->outtexture, gst_gl_effects_twirl_callback, effects);
|
effects->outtexture, gst_gl_effects_twirl_callback, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ gst_gl_effects_xray_step_two (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
|
gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -115,7 +115,7 @@ gst_gl_effects_xray_step_three (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
|
gst_gl_shader_set_uniform_1fv (shader, "kernel", 9, gauss_kernel);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* multipass separable sobel */
|
/* multipass separable sobel */
|
||||||
|
@ -153,7 +153,7 @@ gst_gl_effects_xray_desaturate (gint width, gint height, guint texture,
|
||||||
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -190,7 +190,7 @@ gst_gl_effects_xray_sobel_hconv (gint width, gint height, guint texture,
|
||||||
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -227,7 +227,7 @@ gst_gl_effects_xray_sobel_vconv (gint width, gint height, guint texture,
|
||||||
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -265,7 +265,7 @@ gst_gl_effects_xray_sobel_length (gint width, gint height, guint texture,
|
||||||
|
|
||||||
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
gst_gl_shader_set_uniform_1i (shader, "tex", 1);
|
||||||
gst_gl_shader_set_uniform_1i (shader, "invert", TRUE);
|
gst_gl_shader_set_uniform_1i (shader, "invert", TRUE);
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* end of sobel passes */
|
/* end of sobel passes */
|
||||||
|
@ -313,7 +313,7 @@ gst_gl_effects_xray_step_five (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1f (shader, "alpha", (gfloat) 0.5f);
|
gst_gl_shader_set_uniform_1f (shader, "alpha", (gfloat) 0.5f);
|
||||||
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
gst_gl_shader_set_uniform_1i (shader, "blend", 1);
|
||||||
|
|
||||||
gst_gl_effects_draw_texture (effects, texture);
|
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -322,13 +322,13 @@ gst_gl_effects_xray (GstGLEffects * effects)
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||||
|
|
||||||
/* map luma to xray curve */
|
/* map luma to xray curve */
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->midtexture[0], gst_gl_effects_xray_step_one, effects);
|
effects->midtexture[0], gst_gl_effects_xray_step_one, effects);
|
||||||
/* horizontal blur */
|
/* horizontal blur */
|
||||||
gst_gl_filter_render_to_target (filter, effects->midtexture[0],
|
gst_gl_filter_render_to_target (filter, FALSE, effects->midtexture[0],
|
||||||
effects->midtexture[1], gst_gl_effects_xray_step_two, effects);
|
effects->midtexture[1], gst_gl_effects_xray_step_two, effects);
|
||||||
/* vertical blur */
|
/* vertical blur */
|
||||||
gst_gl_filter_render_to_target (filter, effects->midtexture[1],
|
gst_gl_filter_render_to_target (filter, FALSE, effects->midtexture[1],
|
||||||
effects->midtexture[2], gst_gl_effects_xray_step_three, effects);
|
effects->midtexture[2], gst_gl_effects_xray_step_three, effects);
|
||||||
/* detect edges with Sobel */
|
/* detect edges with Sobel */
|
||||||
/* the old version used edges from the blurred texture, this uses
|
/* the old version used edges from the blurred texture, this uses
|
||||||
|
@ -336,18 +336,18 @@ gst_gl_effects_xray (GstGLEffects * effects)
|
||||||
* more. This one gives better edges obviously but behaves badly
|
* more. This one gives better edges obviously but behaves badly
|
||||||
* with noise */
|
* with noise */
|
||||||
/* desaturate */
|
/* desaturate */
|
||||||
gst_gl_filter_render_to_target (filter, effects->intexture,
|
gst_gl_filter_render_to_target (filter, TRUE, effects->intexture,
|
||||||
effects->midtexture[3], gst_gl_effects_xray_desaturate, effects);
|
effects->midtexture[3], gst_gl_effects_xray_desaturate, effects);
|
||||||
/* horizonal convolution */
|
/* horizonal convolution */
|
||||||
gst_gl_filter_render_to_target (filter, effects->midtexture[3],
|
gst_gl_filter_render_to_target (filter, FALSE, effects->midtexture[3],
|
||||||
effects->midtexture[4], gst_gl_effects_xray_sobel_hconv, effects);
|
effects->midtexture[4], gst_gl_effects_xray_sobel_hconv, effects);
|
||||||
/* vertical convolution */
|
/* vertical convolution */
|
||||||
gst_gl_filter_render_to_target (filter, effects->midtexture[4],
|
gst_gl_filter_render_to_target (filter, FALSE, effects->midtexture[4],
|
||||||
effects->midtexture[3], gst_gl_effects_xray_sobel_vconv, effects);
|
effects->midtexture[3], gst_gl_effects_xray_sobel_vconv, effects);
|
||||||
/* gradient length */
|
/* gradient length */
|
||||||
gst_gl_filter_render_to_target (filter, effects->midtexture[3],
|
gst_gl_filter_render_to_target (filter, FALSE, effects->midtexture[3],
|
||||||
effects->midtexture[4], gst_gl_effects_xray_sobel_length, effects);
|
effects->midtexture[4], gst_gl_effects_xray_sobel_length, effects);
|
||||||
/* multiply edges with the blurred image */
|
/* multiply edges with the blurred image */
|
||||||
gst_gl_filter_render_to_target (filter, effects->midtexture[4],
|
gst_gl_filter_render_to_target (filter, FALSE, effects->midtexture[4],
|
||||||
effects->outtexture, gst_gl_effects_xray_step_five, effects);
|
effects->outtexture, gst_gl_effects_xray_step_five, effects);
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,7 +163,7 @@ gst_gl_deinterlace_filter_texture (GstGLFilter * filter, guint in_tex,
|
||||||
GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (filter);
|
GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (filter);
|
||||||
|
|
||||||
//blocking call, use a FBO
|
//blocking call, use a FBO
|
||||||
gst_gl_filter_render_to_target (filter, in_tex, out_tex,
|
gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex,
|
||||||
gst_gl_deinterlace_callback, deinterlace_filter);
|
gst_gl_deinterlace_callback, deinterlace_filter);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -483,7 +483,7 @@ gst_gl_differencematte_filter_texture (GstGLFilter * filter, guint in_tex,
|
||||||
|
|
||||||
/* save current frame, needed to calculate difference between
|
/* save current frame, needed to calculate difference between
|
||||||
* this frame and next ones */
|
* this frame and next ones */
|
||||||
gst_gl_filter_render_to_target (filter, in_tex,
|
gst_gl_filter_render_to_target (filter, TRUE, in_tex,
|
||||||
differencematte->savedbgtexture,
|
differencematte->savedbgtexture,
|
||||||
gst_gl_differencematte_save_texture, differencematte);
|
gst_gl_differencematte_save_texture, differencematte);
|
||||||
|
|
||||||
|
@ -496,19 +496,19 @@ gst_gl_differencematte_filter_texture (GstGLFilter * filter, guint in_tex,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (differencematte->savedbgtexture != 0) {
|
if (differencematte->savedbgtexture != 0) {
|
||||||
gst_gl_filter_render_to_target (filter, in_tex,
|
gst_gl_filter_render_to_target (filter, TRUE, in_tex,
|
||||||
differencematte->midtexture[0], gst_gl_differencematte_diff,
|
differencematte->midtexture[0], gst_gl_differencematte_diff,
|
||||||
differencematte);
|
differencematte);
|
||||||
gst_gl_filter_render_to_target (filter, differencematte->midtexture[0],
|
gst_gl_filter_render_to_target (filter, FALSE,
|
||||||
differencematte->midtexture[1], gst_gl_differencematte_hblur,
|
differencematte->midtexture[0], differencematte->midtexture[1],
|
||||||
differencematte);
|
gst_gl_differencematte_hblur, differencematte);
|
||||||
gst_gl_filter_render_to_target (filter, differencematte->midtexture[1],
|
gst_gl_filter_render_to_target (filter, FALSE,
|
||||||
differencematte->midtexture[2], gst_gl_differencematte_vblur,
|
differencematte->midtexture[1], differencematte->midtexture[2],
|
||||||
differencematte);
|
gst_gl_differencematte_vblur, differencematte);
|
||||||
gst_gl_filter_render_to_target (filter, in_tex, out_tex,
|
gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex,
|
||||||
gst_gl_differencematte_interp, differencematte);
|
gst_gl_differencematte_interp, differencematte);
|
||||||
} else {
|
} else {
|
||||||
gst_gl_filter_render_to_target (filter, in_tex, out_tex,
|
gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex,
|
||||||
gst_gl_differencematte_identity, differencematte);
|
gst_gl_differencematte_identity, differencematte);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -267,11 +267,10 @@ gst_gl_effects_class_init (GstGLEffectsClass * klass)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex)
|
gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex, guint width,
|
||||||
|
guint height)
|
||||||
{
|
{
|
||||||
#ifndef OPENGL_ES2
|
#ifndef OPENGL_ES2
|
||||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
|
||||||
|
|
||||||
glActiveTexture (GL_TEXTURE0);
|
glActiveTexture (GL_TEXTURE0);
|
||||||
glEnable (GL_TEXTURE_RECTANGLE_ARB);
|
glEnable (GL_TEXTURE_RECTANGLE_ARB);
|
||||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, tex);
|
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, tex);
|
||||||
|
@ -280,12 +279,11 @@ gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex)
|
||||||
|
|
||||||
glTexCoord2f (0.0, 0.0);
|
glTexCoord2f (0.0, 0.0);
|
||||||
glVertex2f (-1.0, -1.0);
|
glVertex2f (-1.0, -1.0);
|
||||||
glTexCoord2f ((gfloat) GST_VIDEO_INFO_WIDTH (&filter->out_info), 0.0);
|
glTexCoord2f ((gfloat) width, 0.0);
|
||||||
glVertex2f (1.0, -1.0);
|
glVertex2f (1.0, -1.0);
|
||||||
glTexCoord2f ((gfloat) GST_VIDEO_INFO_WIDTH (&filter->out_info),
|
glTexCoord2f ((gfloat) width, (gfloat) height);
|
||||||
(gfloat) GST_VIDEO_INFO_HEIGHT (&filter->out_info));
|
|
||||||
glVertex2f (1.0, 1.0);
|
glVertex2f (1.0, 1.0);
|
||||||
glTexCoord2f (0.0, (gfloat) GST_VIDEO_INFO_HEIGHT (&filter->out_info));
|
glTexCoord2f (0.0, (gfloat) height);
|
||||||
glVertex2f (-1.0, 1.0);
|
glVertex2f (-1.0, 1.0);
|
||||||
|
|
||||||
glEnd ();
|
glEnd ();
|
||||||
|
|
|
@ -92,7 +92,7 @@ enum
|
||||||
|
|
||||||
GType gst_gl_effects_get_type (void);
|
GType gst_gl_effects_get_type (void);
|
||||||
|
|
||||||
void gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex);
|
void gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex, guint width, guint height);
|
||||||
|
|
||||||
void gst_gl_effects_identity (GstGLEffects *effects);
|
void gst_gl_effects_identity (GstGLEffects *effects);
|
||||||
void gst_gl_effects_mirror (GstGLEffects *effects);
|
void gst_gl_effects_mirror (GstGLEffects *effects);
|
||||||
|
|
|
@ -192,7 +192,7 @@ gst_gl_filter_app_filter_texture (GstGLFilter * filter, guint in_tex,
|
||||||
//default
|
//default
|
||||||
else {
|
else {
|
||||||
//blocking call, use a FBO
|
//blocking call, use a FBO
|
||||||
gst_gl_filter_render_to_target (filter, in_tex, out_tex,
|
gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex,
|
||||||
gst_gl_filter_app_callback, NULL);
|
gst_gl_filter_app_callback, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -190,10 +190,10 @@ gst_gl_filterblur_filter_texture (GstGLFilter * filter, guint in_tex,
|
||||||
{
|
{
|
||||||
GstGLFilterBlur *filterblur = GST_GL_FILTERBLUR (filter);
|
GstGLFilterBlur *filterblur = GST_GL_FILTERBLUR (filter);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, in_tex,
|
gst_gl_filter_render_to_target (filter, TRUE, in_tex,
|
||||||
filterblur->midtexture, gst_gl_filterblur_hcallback, filterblur);
|
filterblur->midtexture, gst_gl_filterblur_hcallback, filterblur);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, filterblur->midtexture,
|
gst_gl_filter_render_to_target (filter, FALSE, filterblur->midtexture,
|
||||||
out_tex, gst_gl_filterblur_vcallback, filterblur);
|
out_tex, gst_gl_filterblur_vcallback, filterblur);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -220,7 +220,7 @@ gst_gl_filterblur_hcallback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1fv (filterblur->shader0, "kernel", 7,
|
gst_gl_shader_set_uniform_1fv (filterblur->shader0, "kernel", 7,
|
||||||
filterblur->gauss_kernel);
|
filterblur->gauss_kernel);
|
||||||
|
|
||||||
gst_gl_filter_draw_texture (filter, texture);
|
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -245,5 +245,5 @@ gst_gl_filterblur_vcallback (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1fv (filterblur->shader1, "kernel", 7,
|
gst_gl_shader_set_uniform_1fv (filterblur->shader1, "kernel", 7,
|
||||||
filterblur->gauss_kernel);
|
filterblur->gauss_kernel);
|
||||||
|
|
||||||
gst_gl_filter_draw_texture (filter, texture);
|
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,7 +178,7 @@ gst_gl_filter_laplacian_filter_texture (GstGLFilter * filter, guint in_tex,
|
||||||
|
|
||||||
|
|
||||||
//blocking call, use a FBO
|
//blocking call, use a FBO
|
||||||
gst_gl_filter_render_to_target (filter, in_tex, out_tex,
|
gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex,
|
||||||
gst_gl_filter_laplacian_callback, laplacian_filter);
|
gst_gl_filter_laplacian_callback, laplacian_filter);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -121,13 +121,13 @@ gst_gl_filter_reflected_screen_class_init (GstGLFilterReflectedScreenClass *
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_ASPECT,
|
g_object_class_install_property (gobject_class, PROP_ASPECT,
|
||||||
g_param_spec_double ("aspect", "Aspect",
|
g_param_spec_double ("aspect", "Aspect",
|
||||||
"Field of view in the x direction", 0.0, 100, 0.0,
|
"Field of view in the x direction", 1.0, 100, 1.0,
|
||||||
G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_ZNEAR,
|
g_object_class_install_property (gobject_class, PROP_ZNEAR,
|
||||||
g_param_spec_double ("znear", "Znear",
|
g_param_spec_double ("znear", "Znear",
|
||||||
"Specifies the distance from the viewer to the near clipping plane",
|
"Specifies the distance from the viewer to the near clipping plane",
|
||||||
0.0, 100.0, 0.1, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
0.0000000001, 100.0, 0.1, G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, PROP_ZFAR,
|
g_object_class_install_property (gobject_class, PROP_ZFAR,
|
||||||
g_param_spec_double ("zfar", "Zfar",
|
g_param_spec_double ("zfar", "Zfar",
|
||||||
|
@ -145,8 +145,8 @@ gst_gl_filter_reflected_screen_init (GstGLFilterReflectedScreen * filter)
|
||||||
filter->active_graphic_mode = TRUE;
|
filter->active_graphic_mode = TRUE;
|
||||||
filter->separated_screen = FALSE;
|
filter->separated_screen = FALSE;
|
||||||
filter->show_floor = TRUE;
|
filter->show_floor = TRUE;
|
||||||
filter->fovy = 80;
|
filter->fovy = 90;
|
||||||
filter->aspect = 0;
|
filter->aspect = 1.0;
|
||||||
filter->znear = 0.1;
|
filter->znear = 0.1;
|
||||||
filter->zfar = 1000;
|
filter->zfar = 1000;
|
||||||
}
|
}
|
||||||
|
|
|
@ -325,7 +325,7 @@ gst_gl_filtershader_filter_texture (GstGLFilter * filter, guint in_tex,
|
||||||
{
|
{
|
||||||
GstGLFilterShader *filtershader = GST_GL_FILTERSHADER (filter);
|
GstGLFilterShader *filtershader = GST_GL_FILTERSHADER (filter);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, in_tex, out_tex,
|
gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex,
|
||||||
gst_gl_filtershader_hcallback, filtershader);
|
gst_gl_filtershader_hcallback, filtershader);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -364,6 +364,6 @@ gst_gl_filtershader_hcallback (gint width, gint height, guint texture,
|
||||||
hfilter_fragment_variables[1] = 0;
|
hfilter_fragment_variables[1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_gl_filter_draw_texture (filter, texture);
|
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,15 +220,15 @@ gst_gl_filtersobel_filter_texture (GstGLFilter * filter, guint in_tex,
|
||||||
{
|
{
|
||||||
GstGLFilterSobel *filtersobel = GST_GL_FILTERSOBEL (filter);
|
GstGLFilterSobel *filtersobel = GST_GL_FILTERSOBEL (filter);
|
||||||
|
|
||||||
gst_gl_filter_render_to_target_with_shader (filter, in_tex,
|
gst_gl_filter_render_to_target_with_shader (filter, TRUE, in_tex,
|
||||||
filtersobel->midtexture[0], filtersobel->desat);
|
filtersobel->midtexture[0], filtersobel->desat);
|
||||||
gst_gl_filter_render_to_target_with_shader (filter,
|
gst_gl_filter_render_to_target_with_shader (filter, FALSE,
|
||||||
filtersobel->midtexture[0], filtersobel->midtexture[1],
|
filtersobel->midtexture[0], filtersobel->midtexture[1],
|
||||||
filtersobel->hconv);
|
filtersobel->hconv);
|
||||||
gst_gl_filter_render_to_target_with_shader (filter,
|
gst_gl_filter_render_to_target_with_shader (filter, FALSE,
|
||||||
filtersobel->midtexture[1], filtersobel->midtexture[0],
|
filtersobel->midtexture[1], filtersobel->midtexture[0],
|
||||||
filtersobel->vconv);
|
filtersobel->vconv);
|
||||||
gst_gl_filter_render_to_target (filter, filtersobel->midtexture[0],
|
gst_gl_filter_render_to_target (filter, FALSE, filtersobel->midtexture[0],
|
||||||
out_tex, gst_gl_filtersobel_length, filtersobel);
|
out_tex, gst_gl_filtersobel_length, filtersobel);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -255,5 +255,5 @@ gst_gl_filtersobel_length (gint width, gint height, guint texture,
|
||||||
gst_gl_shader_set_uniform_1i (filtersobel->len, "invert",
|
gst_gl_shader_set_uniform_1i (filtersobel->len, "invert",
|
||||||
filtersobel->invert);
|
filtersobel->invert);
|
||||||
|
|
||||||
gst_gl_filter_draw_texture (filter, texture);
|
gst_gl_filter_draw_texture (filter, texture, width, height);
|
||||||
}
|
}
|
||||||
|
|
|
@ -607,7 +607,7 @@ gst_gl_overlay_filter_texture (GstGLFilter * filter, guint in_tex,
|
||||||
overlay->pbuf_has_changed = FALSE;
|
overlay->pbuf_has_changed = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_gl_filter_render_to_target (filter, in_tex, out_tex,
|
gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex,
|
||||||
gst_gl_overlay_callback, overlay);
|
gst_gl_overlay_callback, overlay);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue