From 3613ecfd0a5a838fbc1df90bdb372576936c8066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 26 Apr 2015 21:39:06 +0200 Subject: [PATCH] glfilter: Remove onStart/onStop vfuncs, and unused onReset() onStart/onStop are just duplicates of the basetransform ones, onReset was never called but was used everywhere when stop should've been used. --- ext/gl/gstglcolorscale.c | 17 ++++++++++------- ext/gl/gstgldeinterlace.c | 17 ++++++++++------- ext/gl/gstgldifferencematte.c | 17 ----------------- ext/gl/gstgleffects.c | 28 +++++++++++++++++----------- ext/gl/gstglfiltercube.c | 18 +++++++++++------- ext/gl/gstglfilterglass.c | 19 +++++++++++-------- ext/gl/gstglfiltershader.c | 22 +++++++++++++--------- ext/gl/gstgloverlay.c | 8 -------- gst-libs/gst/gl/gstglfilter.c | 18 ------------------ gst-libs/gst/gl/gstglfilter.h | 6 ------ 10 files changed, 72 insertions(+), 98 deletions(-) diff --git a/ext/gl/gstglcolorscale.c b/ext/gl/gstglcolorscale.c index fa22bf9a9b..ce85e8a140 100644 --- a/ext/gl/gstglcolorscale.c +++ b/ext/gl/gstglcolorscale.c @@ -61,7 +61,7 @@ enum #define DEBUG_INIT \ GST_DEBUG_CATEGORY_INIT (gst_gl_colorscale_debug, "glcolorscale", 0, "glcolorscale element"); - +#define gst_gl_colorscale_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLColorscale, gst_gl_colorscale, GST_TYPE_GL_FILTER, DEBUG_INIT); @@ -71,7 +71,7 @@ static void gst_gl_colorscale_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static gboolean gst_gl_colorscale_gen_gl_resources (GstGLFilter * filter); -static void gst_gl_colorscale_del_gl_resources (GstGLFilter * filter); +static gboolean gst_gl_colorscale_del_gl_resources (GstBaseTransform * trans); static gboolean gst_gl_colorscale_filter_texture (GstGLFilter * filter, guint in_tex, guint out_tex); @@ -99,10 +99,11 @@ gst_gl_colorscale_class_init (GstGLColorscaleClass * klass) filter_class->onInitFBO = GST_DEBUG_FUNCPTR (gst_gl_colorscale_gen_gl_resources); - filter_class->onStop = GST_DEBUG_FUNCPTR (gst_gl_colorscale_del_gl_resources); filter_class->filter_texture = gst_gl_colorscale_filter_texture; + basetransform_class->stop = + GST_DEBUG_FUNCPTR (gst_gl_colorscale_del_gl_resources); basetransform_class->passthrough_on_same_caps = TRUE; GST_GL_BASE_FILTER_CLASS (klass)->supported_gl_api = GST_GL_API_OPENGL | GST_GL_API_OPENGL3 | GST_GL_API_GLES2; @@ -173,16 +174,18 @@ gst_gl_colorscale_gen_gl_resources (GstGLFilter * filter) return TRUE; } -static void -gst_gl_colorscale_del_gl_resources (GstGLFilter * filter) +static gboolean +gst_gl_colorscale_del_gl_resources (GstBaseTransform * trans) { - GstGLColorscale *colorscale = GST_GL_COLORSCALE (filter); + GstGLColorscale *colorscale = GST_GL_COLORSCALE (trans); if (colorscale->shader) { - gst_gl_context_del_shader (GST_GL_BASE_FILTER (filter)->context, + gst_gl_context_del_shader (GST_GL_BASE_FILTER (trans)->context, colorscale->shader); colorscale->shader = NULL; } + + return GST_BASE_TRANSFORM_CLASS (parent_class)->stop (trans); } static gboolean diff --git a/ext/gl/gstgldeinterlace.c b/ext/gl/gstgldeinterlace.c index bf969f2dc4..74f27efdc3 100644 --- a/ext/gl/gstgldeinterlace.c +++ b/ext/gl/gstgldeinterlace.c @@ -48,7 +48,7 @@ enum #define DEBUG_INIT \ GST_DEBUG_CATEGORY_INIT (gst_gl_deinterlace_debug, "gldeinterlace", 0, "gldeinterlace element"); - +#define gst_gl_deinterlace_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLDeinterlace, gst_gl_deinterlace, GST_TYPE_GL_FILTER, DEBUG_INIT); @@ -57,7 +57,7 @@ static void gst_gl_deinterlace_set_property (GObject * object, static void gst_gl_deinterlace_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_gl_deinterlace_reset (GstGLFilter * filter); +static gboolean gst_gl_deinterlace_reset (GstBaseTransform * trans); static gboolean gst_gl_deinterlace_init_shader (GstGLFilter * filter); static gboolean gst_gl_deinterlace_filter (GstGLFilter * filter, GstBuffer * inbuf, GstBuffer * outbuf); @@ -163,11 +163,12 @@ gst_gl_deinterlace_class_init (GstGLDeinterlaceClass * klass) "Deinterlacing based on fragment shaders", "Julien Isorce "); + GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_deinterlace_reset; + GST_GL_FILTER_CLASS (klass)->filter = gst_gl_deinterlace_filter; GST_GL_FILTER_CLASS (klass)->filter_texture = gst_gl_deinterlace_filter_texture; GST_GL_FILTER_CLASS (klass)->onInitFBO = gst_gl_deinterlace_init_shader; - GST_GL_FILTER_CLASS (klass)->onReset = gst_gl_deinterlace_reset; GST_GL_BASE_FILTER_CLASS (klass)->supported_gl_api = GST_GL_API_OPENGL; } @@ -180,18 +181,20 @@ gst_gl_deinterlace_init (GstGLDeinterlace * filter) filter->prev_tex = 0; } -static void -gst_gl_deinterlace_reset (GstGLFilter * filter) +static gboolean +gst_gl_deinterlace_reset (GstBaseTransform * trans) { - GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (filter); + GstGLDeinterlace *deinterlace_filter = GST_GL_DEINTERLACE (trans); gst_buffer_replace (&deinterlace_filter->prev_buffer, NULL); //blocking call, wait the opengl thread has destroyed the shader if (deinterlace_filter->shader) - gst_gl_context_del_shader (GST_GL_BASE_FILTER (filter)->context, + gst_gl_context_del_shader (GST_GL_BASE_FILTER (trans)->context, deinterlace_filter->shader); deinterlace_filter->shader = NULL; + + return GST_BASE_TRANSFORM_CLASS (parent_class)->stop (trans); } static void diff --git a/ext/gl/gstgldifferencematte.c b/ext/gl/gstgldifferencematte.c index 479358d229..4f0a8f6be8 100644 --- a/ext/gl/gstgldifferencematte.c +++ b/ext/gl/gstgldifferencematte.c @@ -61,9 +61,6 @@ static void gst_gl_differencematte_set_property (GObject * object, static void gst_gl_differencematte_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_gl_differencematte_init_resources (GstGLFilter * filter); -static void gst_gl_differencematte_reset_resources (GstGLFilter * filter); - static gboolean gst_gl_differencematte_filter_texture (GstGLFilter * filter, guint in_tex, guint out_tex); @@ -180,8 +177,6 @@ gst_gl_differencematte_class_init (GstGLDifferenceMatteClass * klass) gst_gl_differencematte_init_gl_resources; GST_GL_FILTER_CLASS (klass)->display_reset_cb = gst_gl_differencematte_reset_gl_resources; - GST_GL_FILTER_CLASS (klass)->onStart = gst_gl_differencematte_init_resources; - GST_GL_FILTER_CLASS (klass)->onStop = gst_gl_differencematte_reset_resources; g_object_class_install_property (gobject_class, PROP_LOCATION, @@ -214,12 +209,6 @@ gst_gl_differencematte_init (GstGLDifferenceMatte * differencematte) fill_gaussian_kernel (differencematte->kernel, 7, 30.0); } -static void -gst_gl_differencematte_reset_resources (GstGLFilter * filter) -{ -// GstGLDifferenceMatte* differencematte = GST_GL_DIFFERENCEMATTE(filter); -} - static void gst_gl_differencematte_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) @@ -255,12 +244,6 @@ gst_gl_differencematte_get_property (GObject * object, guint prop_id, } } -static void -gst_gl_differencematte_init_resources (GstGLFilter * filter) -{ -// GstGLDifferenceMatte *differencematte = GST_GL_DIFFERENCEMATTE (filter); -} - static void gst_gl_differencematte_save_texture (gint width, gint height, guint texture, gpointer stuff) diff --git a/ext/gl/gstgleffects.c b/ext/gl/gstgleffects.c index a9d43325a3..532e65f829 100644 --- a/ext/gl/gstgleffects.c +++ b/ext/gl/gstgleffects.c @@ -53,6 +53,7 @@ enum #define DEBUG_INIT \ GST_DEBUG_CATEGORY_INIT (gst_gl_effects_debug, "gleffects", 0, "gleffects element"); +#define gst_gl_effects_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLEffects, gst_gl_effects, GST_TYPE_GL_FILTER, DEBUG_INIT); @@ -61,8 +62,8 @@ static void gst_gl_effects_set_property (GObject * object, guint prop_id, static void gst_gl_effects_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_gl_effects_init_resources (GstGLFilter * filter); -static void gst_gl_effects_reset_resources (GstGLFilter * filter); +static gboolean gst_gl_effects_init_resources (GstBaseTransform * trans); +static gboolean gst_gl_effects_reset_resources (GstBaseTransform * trans); static gboolean gst_gl_effects_on_init_gl_context (GstGLFilter * filter); @@ -318,13 +319,14 @@ gst_gl_effects_class_init (GstGLEffectsClass * klass) { GstElementClass *element_class = GST_ELEMENT_CLASS (klass); + GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_effects_init_resources; + GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_effects_reset_resources; + GST_GL_FILTER_CLASS (klass)->filter_texture = gst_gl_effects_filter_texture; GST_GL_FILTER_CLASS (klass)->display_init_cb = gst_gl_effects_init_gl_resources; GST_GL_FILTER_CLASS (klass)->display_reset_cb = gst_gl_effects_reset_gl_resources; - GST_GL_FILTER_CLASS (klass)->onStart = gst_gl_effects_init_resources; - GST_GL_FILTER_CLASS (klass)->onStop = gst_gl_effects_reset_resources; GST_GL_FILTER_CLASS (klass)->onInitFBO = gst_gl_effects_on_init_gl_context; klass->filter_descriptor = NULL; @@ -423,20 +425,22 @@ gst_gl_effects_ghash_func_clean (gpointer key, gpointer value, gpointer data) value = NULL; } -static void -gst_gl_effects_reset_resources (GstGLFilter * filter) +static gboolean +gst_gl_effects_reset_resources (GstBaseTransform * trans) { - GstGLEffects *effects = GST_GL_EFFECTS (filter); + GstGLEffects *effects = GST_GL_EFFECTS (trans); /* release shaders in the gl thread */ g_hash_table_foreach (effects->shaderstable, gst_gl_effects_ghash_func_clean, - filter); + effects); /* clean the htable without calling values destructors * because shaders have been released in the glthread * through the foreach func */ g_hash_table_unref (effects->shaderstable); effects->shaderstable = NULL; + + return GST_BASE_TRANSFORM_CLASS (parent_class)->stop (trans); } static void @@ -483,10 +487,10 @@ gst_gl_effects_get_property (GObject * object, guint prop_id, } } -static void -gst_gl_effects_init_resources (GstGLFilter * filter) +static gboolean +gst_gl_effects_init_resources (GstBaseTransform * trans) { - GstGLEffects *effects = GST_GL_EFFECTS (filter); + GstGLEffects *effects = GST_GL_EFFECTS (trans); gint i; effects->shaderstable = g_hash_table_new (g_str_hash, g_str_equal); @@ -497,6 +501,8 @@ gst_gl_effects_init_resources (GstGLFilter * filter) for (i = 0; i < GST_GL_EFFECTS_N_CURVES; i++) { effects->curve[i] = 0; } + + return GST_BASE_TRANSFORM_CLASS (parent_class)->start (trans); } static gboolean diff --git a/ext/gl/gstglfiltercube.c b/ext/gl/gstglfiltercube.c index 518b295671..beb5e50e40 100644 --- a/ext/gl/gstglfiltercube.c +++ b/ext/gl/gstglfiltercube.c @@ -64,7 +64,7 @@ enum #define DEBUG_INIT \ GST_DEBUG_CATEGORY_INIT (gst_gl_filter_cube_debug, "glfiltercube", 0, "glfiltercube element"); - +#define gst_gl_filter_cube_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLFilterCube, gst_gl_filter_cube, GST_TYPE_GL_FILTER, DEBUG_INIT); @@ -73,9 +73,10 @@ static void gst_gl_filter_cube_set_property (GObject * object, guint prop_id, static void gst_gl_filter_cube_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); +static gboolean gst_gl_filter_cube_stop (GstBaseTransform * trans); + static gboolean gst_gl_filter_cube_set_caps (GstGLFilter * filter, GstCaps * incaps, GstCaps * outcaps); -static void gst_gl_filter_cube_reset (GstGLFilter * filter); static void gst_gl_filter_cube_reset_gl (GstGLFilter * filter); static gboolean gst_gl_filter_cube_init_shader (GstGLFilter * filter); static void _callback (gpointer stuff); @@ -138,8 +139,9 @@ gst_gl_filter_cube_class_init (GstGLFilterCubeClass * klass) gobject_class->set_property = gst_gl_filter_cube_set_property; gobject_class->get_property = gst_gl_filter_cube_get_property; + GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_filter_cube_stop; + GST_GL_FILTER_CLASS (klass)->onInitFBO = gst_gl_filter_cube_init_shader; - GST_GL_FILTER_CLASS (klass)->onReset = gst_gl_filter_cube_reset; GST_GL_FILTER_CLASS (klass)->display_reset_cb = gst_gl_filter_cube_reset_gl; GST_GL_FILTER_CLASS (klass)->set_caps = gst_gl_filter_cube_set_caps; GST_GL_FILTER_CLASS (klass)->filter_texture = @@ -292,16 +294,18 @@ gst_gl_filter_cube_reset_gl (GstGLFilter * filter) } } -static void -gst_gl_filter_cube_reset (GstGLFilter * filter) +static gboolean +gst_gl_filter_cube_stop (GstBaseTransform * trans) { - GstGLFilterCube *cube_filter = GST_GL_FILTER_CUBE (filter); + GstGLFilterCube *cube_filter = GST_GL_FILTER_CUBE (trans); /* blocking call, wait the opengl thread has destroyed the shader */ if (cube_filter->shader) - gst_gl_context_del_shader (GST_GL_BASE_FILTER (filter)->context, + gst_gl_context_del_shader (GST_GL_BASE_FILTER (trans)->context, cube_filter->shader); cube_filter->shader = NULL; + + return GST_BASE_TRANSFORM_CLASS (parent_class)->stop (trans); } static gboolean diff --git a/ext/gl/gstglfilterglass.c b/ext/gl/gstglfilterglass.c index 0fe109aa5f..4470d28d5f 100644 --- a/ext/gl/gstglfilterglass.c +++ b/ext/gl/gstglfilterglass.c @@ -53,7 +53,7 @@ enum #define DEBUG_INIT \ GST_DEBUG_CATEGORY_INIT (gst_gl_filter_glass_debug, "glfilterglass", 0, "glfilterglass element"); - +#define gst_gl_filter_glass_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLFilterGlass, gst_gl_filter_glass, GST_TYPE_GL_FILTER, DEBUG_INIT); @@ -62,7 +62,8 @@ static void gst_gl_filter_glass_set_property (GObject * object, guint prop_id, static void gst_gl_filter_glass_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_gl_filter_glass_reset (GstGLFilter * filter); +static gboolean gst_gl_filter_glass_reset (GstBaseTransform * trans); + static gboolean gst_gl_filter_glass_init_shader (GstGLFilter * filter); static gboolean gst_gl_filter_glass_filter_texture (GstGLFilter * filter, guint in_tex, guint out_tex); @@ -161,7 +162,7 @@ gst_gl_filter_glass_class_init (GstGLFilterGlassClass * klass) GST_GL_FILTER_CLASS (klass)->filter_texture = gst_gl_filter_glass_filter_texture; GST_GL_FILTER_CLASS (klass)->onInitFBO = gst_gl_filter_glass_init_shader; - GST_GL_FILTER_CLASS (klass)->onReset = gst_gl_filter_glass_reset; + GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_filter_glass_reset; GST_GL_BASE_FILTER_CLASS (klass)->supported_gl_api = GST_GL_API_OPENGL; } @@ -173,20 +174,22 @@ gst_gl_filter_glass_init (GstGLFilterGlass * filter) filter->timestamp = 0; } -static void -gst_gl_filter_glass_reset (GstGLFilter * filter) +static gboolean +gst_gl_filter_glass_reset (GstBaseTransform * trans) { - GstGLFilterGlass *glass_filter = GST_GL_FILTER_GLASS (filter); + GstGLFilterGlass *glass_filter = GST_GL_FILTER_GLASS (trans); //blocking call, wait the opengl thread has destroyed the shader if (glass_filter->shader) - gst_gl_context_del_shader (GST_GL_BASE_FILTER (filter)->context, + gst_gl_context_del_shader (GST_GL_BASE_FILTER (trans)->context, glass_filter->shader); glass_filter->shader = NULL; if (glass_filter->passthrough_shader) - gst_gl_context_del_shader (GST_GL_BASE_FILTER (filter)->context, + gst_gl_context_del_shader (GST_GL_BASE_FILTER (trans)->context, glass_filter->passthrough_shader); glass_filter->passthrough_shader = NULL; + + return GST_BASE_TRANSFORM_CLASS (parent_class)->stop (trans); } static void diff --git a/ext/gl/gstglfiltershader.c b/ext/gl/gstglfiltershader.c index 91c4cfb74b..037e7fab25 100644 --- a/ext/gl/gstglfiltershader.c +++ b/ext/gl/gstglfiltershader.c @@ -67,7 +67,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); #define DEBUG_INIT \ GST_DEBUG_CATEGORY_INIT (gst_gl_filtershader_debug, "glshader", 0, "glshader element"); - +#define gst_gl_filtershader_parent_class parent_class G_DEFINE_TYPE_WITH_CODE (GstGLFilterShader, gst_gl_filtershader, GST_TYPE_GL_FILTER, DEBUG_INIT); @@ -75,7 +75,7 @@ static void gst_gl_filtershader_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_gl_filtershader_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_gl_filter_filtershader_reset (GstGLFilter * filter); +static gboolean gst_gl_filter_filtershader_reset (GstBaseTransform * trans); static gboolean gst_gl_filtershader_load_shader (GstGLFilterShader * filter_shader, char *filename, char **storage); @@ -140,6 +140,8 @@ gst_gl_filtershader_class_init (GstGLFilterShaderClass * klass) "OpenGL fragment shader filter", "Filter/Effect", "Load GLSL fragment shader from file", ""); + GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_filter_filtershader_reset; + GST_GL_FILTER_CLASS (klass)->filter = gst_gl_filtershader_filter; GST_GL_FILTER_CLASS (klass)->filter_texture = gst_gl_filtershader_filter_texture; @@ -148,7 +150,6 @@ gst_gl_filtershader_class_init (GstGLFilterShaderClass * klass) GST_GL_FILTER_CLASS (klass)->display_reset_cb = gst_gl_filtershader_reset_resources; GST_GL_FILTER_CLASS (klass)->onInitFBO = gst_gl_filtershader_init_shader; - GST_GL_FILTER_CLASS (klass)->onReset = gst_gl_filter_filtershader_reset; GST_GL_BASE_FILTER_CLASS (klass)->supported_gl_api = GST_GL_API_OPENGL | GST_GL_API_GLES2 | GST_GL_API_OPENGL3; @@ -160,16 +161,18 @@ gst_gl_filtershader_init (GstGLFilterShader * filtershader) filtershader->shader0 = NULL; } -static void -gst_gl_filter_filtershader_reset (GstGLFilter * filter) +static gboolean +gst_gl_filter_filtershader_reset (GstBaseTransform * trans) { - GstGLFilterShader *filtershader = GST_GL_FILTERSHADER (filter); + GstGLFilterShader *filtershader = GST_GL_FILTERSHADER (trans); //blocking call, wait the opengl thread has destroyed the shader if (filtershader->shader0) - gst_gl_context_del_shader (GST_GL_BASE_FILTER (filter)->context, + gst_gl_context_del_shader (GST_GL_BASE_FILTER (trans)->context, filtershader->shader0); filtershader->shader0 = NULL; + + return GST_BASE_TRANSFORM_CLASS (parent_class)->stop (trans); } static void @@ -186,8 +189,9 @@ gst_gl_filtershader_set_property (GObject * object, guint prop_id, g_free (filtershader->filename); } if (filtershader->compiled) { - //gst_gl_context_del_shader (filtershader->filter.context, filtershader->shader0); - gst_gl_filter_filtershader_reset (&filtershader->filter); + if (filtershader->shader0) + gst_gl_context_del_shader (GST_GL_BASE_FILTER (filtershader)->context, + filtershader->shader0); filtershader->shader0 = 0; } filtershader->filename = g_strdup (g_value_get_string (value)); diff --git a/ext/gl/gstgloverlay.c b/ext/gl/gstgloverlay.c index 2dd53269f3..e119bd304d 100644 --- a/ext/gl/gstgloverlay.c +++ b/ext/gl/gstgloverlay.c @@ -68,8 +68,6 @@ static void gst_gl_overlay_set_property (GObject * object, guint prop_id, static void gst_gl_overlay_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); -static void gst_gl_overlay_reset_resources (GstGLFilter * filter); - static void gst_gl_overlay_before_transform (GstBaseTransform * trans, GstBuffer * outbuf); static gboolean gst_gl_overlay_filter_texture (GstGLFilter * filter, @@ -187,7 +185,6 @@ gst_gl_overlay_class_init (GstGLOverlayClass * klass) GST_GL_FILTER_CLASS (klass)->filter_texture = gst_gl_overlay_filter_texture; GST_GL_FILTER_CLASS (klass)->display_reset_cb = gst_gl_overlay_reset_gl_resources; - GST_GL_FILTER_CLASS (klass)->onStop = gst_gl_overlay_reset_resources; GST_GL_FILTER_CLASS (klass)->onInitFBO = gst_gl_overlay_init_gl_resources; GST_BASE_TRANSFORM_CLASS (klass)->before_transform = @@ -266,11 +263,6 @@ gst_gl_overlay_init (GstGLOverlay * overlay) overlay->alpha = 1.0; } -static void -gst_gl_overlay_reset_resources (GstGLFilter * filter) -{ -} - static void gst_gl_overlay_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index cf95d1cbb7..b7791e907b 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -75,7 +75,6 @@ static GstCaps *gst_gl_filter_transform_caps (GstBaseTransform * bt, static GstCaps *gst_gl_filter_fixate_caps (GstBaseTransform * bt, GstPadDirection direction, GstCaps * caps, GstCaps * othercaps); static void gst_gl_filter_reset (GstGLFilter * filter); -static gboolean gst_gl_filter_start (GstBaseTransform * bt); static gboolean gst_gl_filter_stop (GstBaseTransform * bt); static gboolean gst_gl_filter_get_unit_size (GstBaseTransform * trans, GstCaps * caps, gsize * size); @@ -106,7 +105,6 @@ gst_gl_filter_class_init (GstGLFilterClass * klass) gst_gl_filter_transform_caps; GST_BASE_TRANSFORM_CLASS (klass)->fixate_caps = gst_gl_filter_fixate_caps; GST_BASE_TRANSFORM_CLASS (klass)->transform = gst_gl_filter_transform; - GST_BASE_TRANSFORM_CLASS (klass)->start = gst_gl_filter_start; GST_BASE_TRANSFORM_CLASS (klass)->stop = gst_gl_filter_stop; GST_BASE_TRANSFORM_CLASS (klass)->set_caps = gst_gl_filter_set_caps; GST_BASE_TRANSFORM_CLASS (klass)->propose_allocation = @@ -164,26 +162,10 @@ gst_gl_filter_reset (GstGLFilter * filter) } } -static gboolean -gst_gl_filter_start (GstBaseTransform * bt) -{ - GstGLFilter *filter = GST_GL_FILTER (bt); - GstGLFilterClass *filter_class = GST_GL_FILTER_GET_CLASS (filter); - - if (filter_class->onStart) - filter_class->onStart (filter); - - return GST_BASE_TRANSFORM_CLASS (parent_class)->start (bt); -} - static gboolean gst_gl_filter_stop (GstBaseTransform * bt) { GstGLFilter *filter = GST_GL_FILTER (bt); - GstGLFilterClass *filter_class = GST_GL_FILTER_GET_CLASS (filter); - - if (filter_class->onStop) - filter_class->onStop (filter); gst_gl_filter_reset (filter); diff --git a/gst-libs/gst/gl/gstglfilter.h b/gst-libs/gst/gl/gstglfilter.h index fcca30852e..55a522da51 100644 --- a/gst-libs/gst/gl/gstglfilter.h +++ b/gst-libs/gst/gl/gstglfilter.h @@ -91,8 +91,6 @@ struct _GstGLFilter * @filter_texture: given @in_tex, transform it into @out_tex. Not used * if @filter exists * @onInitFBO: perform initialization when the Framebuffer object is created - * @onStart: called when element activates see also #GstBaseTransform - * @onStop: called when the element deactivates e also #GstBaseTransform * @onReset: called on inizialation and after @onStop * @display_init_cb: execute arbitrary gl code on start * @display_reset_cb: execute arbitrary gl code at stop @@ -106,10 +104,6 @@ struct _GstGLFilterClass gboolean (*filter_texture) (GstGLFilter *filter, guint in_tex, guint out_tex); gboolean (*onInitFBO) (GstGLFilter *filter); - void (*onStart) (GstGLFilter *filter); - void (*onStop) (GstGLFilter *filter); - void (*onReset) (GstGLFilter *filter); - /* useful to init and cleanup custom gl resources */ void (*display_init_cb) (GstGLFilter *filter); void (*display_reset_cb) (GstGLFilter *filter);