diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c index 4451eb42b9..d5b57192ef 100644 --- a/gst-libs/gst/gl/gstglfilter.c +++ b/gst-libs/gst/gl/gstglfilter.c @@ -109,6 +109,8 @@ gst_gl_filter_class_init (GstGLFilterClass * klass) klass->display_init_cb = NULL; klass->display_reset_cb = NULL; klass->onInitFBO = NULL; + klass->onStart = NULL; + klass->onStop = NULL; klass->onReset = NULL; } @@ -179,6 +181,12 @@ 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 TRUE; } @@ -186,6 +194,10 @@ 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 f4b85b0bbe..d9d23f0599 100644 --- a/gst-libs/gst/gl/gstglfilter.h +++ b/gst-libs/gst/gl/gstglfilter.h @@ -46,6 +46,8 @@ typedef gboolean (*GstGLFilterProcessFunc) (GstGLFilter *filter, GstGLBuffer *inbuf, GstGLBuffer *outbuf); typedef void (*GstGLFilterOnInitFBO) (GstGLFilter *filter); typedef void (*GstGLFilterOnReset) (GstGLFilter *filter); +typedef void (*GstGLFilterOnStart) (GstGLFilter *filter); +typedef void (*GstGLFilterOnStop) (GstGLFilter *filter); typedef void (*GstGLFilterGLStartFunc) (GstGLFilter *filter); typedef void (*GstGLFilterGLStopFunc) (GstGLFilter *filter); @@ -72,6 +74,8 @@ struct _GstGLFilterClass GstGLFilterProcessFunc filter; GstGLFilterOnInitFBO onInitFBO; + GstGLFilterOnStart onStart; + GstGLFilterOnStop onStop; GstGLFilterOnReset onReset; /* useful to init and cleanup custom gl resources */