mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
glbasefilter: track gl_start/stop correctly
Don't start multiple times without calling gl_stop.
This commit is contained in:
parent
0e2fe3c2e9
commit
5a275c77eb
1 changed files with 13 additions and 2 deletions
|
@ -37,6 +37,7 @@ struct _GstGLBaseFilterPrivate
|
|||
GstGLContext *other_context;
|
||||
|
||||
gboolean gl_result;
|
||||
gboolean gl_started;
|
||||
};
|
||||
|
||||
/* Properties */
|
||||
|
@ -302,6 +303,8 @@ gst_gl_base_filter_gl_start (GstGLContext * context, gpointer data)
|
|||
} else {
|
||||
filter->priv->gl_result = TRUE;
|
||||
}
|
||||
|
||||
filter->priv->gl_started |= filter->priv->gl_result;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -310,8 +313,12 @@ gst_gl_base_filter_gl_stop (GstGLContext * context, gpointer data)
|
|||
GstGLBaseFilter *filter = GST_GL_BASE_FILTER (data);
|
||||
GstGLBaseFilterClass *filter_class = GST_GL_BASE_FILTER_GET_CLASS (filter);
|
||||
|
||||
if (filter_class->gl_stop)
|
||||
filter_class->gl_stop (filter);
|
||||
if (filter->priv->gl_started) {
|
||||
if (filter_class->gl_stop)
|
||||
filter_class->gl_stop (filter);
|
||||
}
|
||||
|
||||
filter->priv->gl_started = FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -348,6 +355,10 @@ gst_gl_base_filter_decide_allocation (GstBaseTransform * trans,
|
|||
GST_OBJECT_UNLOCK (filter->display);
|
||||
}
|
||||
|
||||
if (filter->priv->gl_started)
|
||||
gst_gl_context_thread_add (filter->context, gst_gl_base_filter_gl_stop,
|
||||
filter);
|
||||
|
||||
gst_gl_context_thread_add (filter->context, gst_gl_base_filter_gl_start,
|
||||
filter);
|
||||
if (!filter->priv->gl_result)
|
||||
|
|
Loading…
Reference in a new issue