glbasemixer: use gst_display_ensure_context

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3843>
This commit is contained in:
Anders Hellerup Madsen 2023-02-06 16:15:06 +01:00
parent 7bee4619dd
commit ecd9a4e37c

View file

@ -186,26 +186,10 @@ _get_gl_context_unlocked (GstGLBaseMixer * mix)
_find_local_gl_context_unlocked (mix);
GST_OBJECT_LOCK (mix->display);
if (!mix->context) {
do {
if (mix->context) {
gst_object_unref (mix->context);
mix->context = NULL;
}
/* just get a GL context. we don't care */
mix->context =
gst_gl_display_get_gl_context_for_thread (mix->display, NULL);
if (!mix->context) {
if (!gst_gl_display_create_context (mix->display,
mix->priv->other_context, &mix->context, &error)) {
GST_OBJECT_UNLOCK (mix->display);
goto context_error;
}
}
} while (!gst_gl_display_add_context (mix->display, mix->context));
if (!gst_gl_display_ensure_context (mix->display, mix->priv->other_context,
&mix->context, &error)) {
goto context_error;
}
GST_OBJECT_UNLOCK (mix->display);
if (new_context || !mix->priv->gl_started) {
if (mix->priv->gl_started)