mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +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, "height", (gfloat) height / 2.0f);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -66,6 +66,6 @@ gst_gl_effects_bulge (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -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, "height", (gfloat) height / 2.0f);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -66,6 +66,6 @@ gst_gl_effects_fisheye (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -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_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
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_1fv (shader, "kernel", 7, gauss_kernel);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
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_1fv (shader, "kernel", 7, gauss_kernel);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
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_1i (shader, "blend", 1);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -197,14 +197,14 @@ gst_gl_effects_glow (GstGLEffects * effects)
|
|||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||
|
||||
/* 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);
|
||||
/* 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);
|
||||
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);
|
||||
/* 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);
|
||||
}
|
||||
|
|
|
@ -30,7 +30,8 @@ gst_gl_effects_identity_callback (gint width, gint height, guint texture,
|
|||
glMatrixMode (GL_PROJECTION);
|
||||
glLoadIdentity ();
|
||||
#else
|
||||
GstGLShader *shader = g_hash_table_lookup (effects->shaderstable, "identity0");
|
||||
GstGLShader *shader =
|
||||
g_hash_table_lookup (effects->shaderstable, "identity0");
|
||||
|
||||
if (!shader) {
|
||||
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);
|
||||
#endif
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -74,6 +75,6 @@ gst_gl_effects_identity (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ gst_gl_effects_luma_to_curve (GstGLEffects * effects,
|
|||
|
||||
glDisable (GL_TEXTURE_1D);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -99,7 +99,7 @@ gst_gl_effects_heat (GstGLEffects * 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);
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ gst_gl_effects_sepia (GstGLEffects * 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);
|
||||
}
|
||||
|
||||
|
@ -137,6 +137,6 @@ gst_gl_effects_luma_xpro (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
#endif
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -93,6 +93,6 @@ gst_gl_effects_mirror (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ gst_gl_effects_rgb_to_curve (GstGLEffects * effects,
|
|||
|
||||
glDisable (GL_TEXTURE_1D);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -99,6 +99,6 @@ gst_gl_effects_xpro (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -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_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -63,6 +63,6 @@ gst_gl_effects_sin (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -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, "height", (gfloat) height / 2.0f);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -66,6 +66,6 @@ gst_gl_effects_square (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
#endif
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -93,6 +93,6 @@ gst_gl_effects_squeeze (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -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, "height", (gfloat) height / 2.0f);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -66,6 +66,6 @@ gst_gl_effects_stretch (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -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, "height", (gfloat) height / 2.0f);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -66,6 +66,6 @@ gst_gl_effects_tunnel (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -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, "height", (gfloat) height / 2.0f);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -66,6 +66,6 @@ gst_gl_effects_twirl (GstGLEffects * 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);
|
||||
}
|
||||
|
|
|
@ -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_1fv (shader, "kernel", 9, gauss_kernel);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
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_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 */
|
||||
|
@ -153,7 +153,7 @@ gst_gl_effects_xray_desaturate (gint width, gint height, guint texture,
|
|||
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
||||
|
||||
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
|
||||
|
@ -190,7 +190,7 @@ gst_gl_effects_xray_sobel_hconv (gint width, gint height, guint texture,
|
|||
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
||||
|
||||
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
|
||||
|
@ -227,7 +227,7 @@ gst_gl_effects_xray_sobel_vconv (gint width, gint height, guint texture,
|
|||
glDisable (GL_TEXTURE_RECTANGLE_ARB);
|
||||
|
||||
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
|
||||
|
@ -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, "invert", TRUE);
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
/* 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_1i (shader, "blend", 1);
|
||||
|
||||
gst_gl_effects_draw_texture (effects, texture);
|
||||
gst_gl_effects_draw_texture (effects, texture, width, height);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -322,13 +322,13 @@ gst_gl_effects_xray (GstGLEffects * effects)
|
|||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||
|
||||
/* 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);
|
||||
/* 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);
|
||||
/* 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);
|
||||
/* detect edges with Sobel */
|
||||
/* 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
|
||||
* with noise */
|
||||
/* 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);
|
||||
/* 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);
|
||||
/* 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);
|
||||
/* 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);
|
||||
/* 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);
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ gst_gl_deinterlace_filter_texture (GstGLFilter * filter, guint in_tex,
|
|||
GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (filter);
|
||||
|
||||
//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);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -483,7 +483,7 @@ gst_gl_differencematte_filter_texture (GstGLFilter * filter, guint in_tex,
|
|||
|
||||
/* save current frame, needed to calculate difference between
|
||||
* 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,
|
||||
gst_gl_differencematte_save_texture, differencematte);
|
||||
|
||||
|
@ -496,19 +496,19 @@ gst_gl_differencematte_filter_texture (GstGLFilter * filter, guint in_tex,
|
|||
}
|
||||
|
||||
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);
|
||||
gst_gl_filter_render_to_target (filter, differencematte->midtexture[0],
|
||||
differencematte->midtexture[1], gst_gl_differencematte_hblur,
|
||||
differencematte);
|
||||
gst_gl_filter_render_to_target (filter, differencematte->midtexture[1],
|
||||
differencematte->midtexture[2], gst_gl_differencematte_vblur,
|
||||
differencematte);
|
||||
gst_gl_filter_render_to_target (filter, in_tex, out_tex,
|
||||
gst_gl_filter_render_to_target (filter, FALSE,
|
||||
differencematte->midtexture[0], differencematte->midtexture[1],
|
||||
gst_gl_differencematte_hblur, differencematte);
|
||||
gst_gl_filter_render_to_target (filter, FALSE,
|
||||
differencematte->midtexture[1], differencematte->midtexture[2],
|
||||
gst_gl_differencematte_vblur, differencematte);
|
||||
gst_gl_filter_render_to_target (filter, TRUE, in_tex, out_tex,
|
||||
gst_gl_differencematte_interp, differencematte);
|
||||
} 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);
|
||||
}
|
||||
|
||||
|
|
|
@ -267,11 +267,10 @@ gst_gl_effects_class_init (GstGLEffectsClass * klass)
|
|||
}
|
||||
|
||||
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
|
||||
GstGLFilter *filter = GST_GL_FILTER (effects);
|
||||
|
||||
glActiveTexture (GL_TEXTURE0);
|
||||
glEnable (GL_TEXTURE_RECTANGLE_ARB);
|
||||
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, tex);
|
||||
|
@ -280,12 +279,11 @@ gst_gl_effects_draw_texture (GstGLEffects * effects, GLuint tex)
|
|||
|
||||
glTexCoord2f (0.0, 0.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);
|
||||
glTexCoord2f ((gfloat) GST_VIDEO_INFO_WIDTH (&filter->out_info),
|
||||
(gfloat) GST_VIDEO_INFO_HEIGHT (&filter->out_info));
|
||||
glTexCoord2f ((gfloat) width, (gfloat) height);
|
||||
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);
|
||||
|
||||
glEnd ();
|
||||
|
|
|
@ -92,7 +92,7 @@ enum
|
|||
|
||||
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_mirror (GstGLEffects *effects);
|
||||
|
|
|
@ -192,7 +192,7 @@ gst_gl_filter_app_filter_texture (GstGLFilter * filter, guint in_tex,
|
|||
//default
|
||||
else {
|
||||
//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);
|
||||
}
|
||||
|
||||
|
|
|
@ -190,10 +190,10 @@ gst_gl_filterblur_filter_texture (GstGLFilter * filter, guint in_tex,
|
|||
{
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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,
|
||||
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,
|
||||
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
|
||||
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);
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -121,13 +121,13 @@ gst_gl_filter_reflected_screen_class_init (GstGLFilterReflectedScreenClass *
|
|||
|
||||
g_object_class_install_property (gobject_class, PROP_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_object_class_install_property (gobject_class, PROP_ZNEAR,
|
||||
g_param_spec_double ("znear", "Znear",
|
||||
"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_param_spec_double ("zfar", "Zfar",
|
||||
|
@ -145,8 +145,8 @@ gst_gl_filter_reflected_screen_init (GstGLFilterReflectedScreen * filter)
|
|||
filter->active_graphic_mode = TRUE;
|
||||
filter->separated_screen = FALSE;
|
||||
filter->show_floor = TRUE;
|
||||
filter->fovy = 80;
|
||||
filter->aspect = 0;
|
||||
filter->fovy = 90;
|
||||
filter->aspect = 1.0;
|
||||
filter->znear = 0.1;
|
||||
filter->zfar = 1000;
|
||||
}
|
||||
|
|
|
@ -325,7 +325,7 @@ gst_gl_filtershader_filter_texture (GstGLFilter * filter, guint in_tex,
|
|||
{
|
||||
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);
|
||||
|
||||
return TRUE;
|
||||
|
@ -364,6 +364,6 @@ gst_gl_filtershader_hcallback (gint width, gint height, guint texture,
|
|||
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);
|
||||
|
||||
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);
|
||||
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->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->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);
|
||||
|
||||
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",
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
return TRUE;
|
||||
|
|
Loading…
Reference in a new issue