mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
glbasefilter: only call gl_{stop,start} if the context changed
Removes the redundant GL object creation/deletion on every decide_allocation call which is being called for every caps change. Thus reduces the required GL state changes on reconfigure events which are being sent by glimagesink/xvimagesink
This commit is contained in:
parent
0cc2156572
commit
40d2693d07
1 changed files with 13 additions and 6 deletions
|
@ -327,6 +327,10 @@ gst_gl_base_filter_decide_allocation (GstBaseTransform * trans,
|
||||||
{
|
{
|
||||||
GstGLBaseFilter *filter = GST_GL_BASE_FILTER (trans);
|
GstGLBaseFilter *filter = GST_GL_BASE_FILTER (trans);
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
gboolean new_context = FALSE;
|
||||||
|
|
||||||
|
if (!filter->context)
|
||||||
|
new_context = TRUE;
|
||||||
|
|
||||||
_find_local_gl_context (filter);
|
_find_local_gl_context (filter);
|
||||||
|
|
||||||
|
@ -349,14 +353,17 @@ gst_gl_base_filter_decide_allocation (GstBaseTransform * trans,
|
||||||
GST_OBJECT_UNLOCK (filter->display);
|
GST_OBJECT_UNLOCK (filter->display);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (new_context) {
|
||||||
if (filter->priv->gl_started)
|
if (filter->priv->gl_started)
|
||||||
gst_gl_context_thread_add (filter->context, gst_gl_base_filter_gl_stop,
|
gst_gl_context_thread_add (filter->context, gst_gl_base_filter_gl_stop,
|
||||||
filter);
|
filter);
|
||||||
|
|
||||||
gst_gl_context_thread_add (filter->context, gst_gl_base_filter_gl_start,
|
gst_gl_context_thread_add (filter->context, gst_gl_base_filter_gl_start,
|
||||||
filter);
|
filter);
|
||||||
|
|
||||||
if (!filter->priv->gl_result)
|
if (!filter->priv->gl_result)
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue