eglglessink: WIP: Reorder locking

This commit is contained in:
Reynaldo H. Verdejo Pinochet 2012-09-14 15:59:05 -03:00 committed by Sebastian Dröge
parent 289f388085
commit 40d6cc2099

View file

@ -778,6 +778,8 @@ gst_eglglessink_fill_supported_fbuffer_configs (GstEglGlesSink * eglglessink)
GstEglGlesImageFmt *format; GstEglGlesImageFmt *format;
/* Init supported format/caps list */ /* Init supported format/caps list */
g_mutex_lock (eglglessink->flow_lock);
if (eglChooseConfig (eglglessink->display, eglglessink_RGB888_config, if (eglChooseConfig (eglglessink->display, eglglessink_RGB888_config,
NULL, 1, &cfg_number) != EGL_FALSE) { NULL, 1, &cfg_number) != EGL_FALSE) {
format = g_new0 (GstEglGlesImageFmt, 1); format = g_new0 (GstEglGlesImageFmt, 1);
@ -817,6 +819,8 @@ gst_eglglessink_fill_supported_fbuffer_configs (GstEglGlesSink * eglglessink)
GST_INFO_OBJECT (eglglessink, GST_INFO_OBJECT (eglglessink,
"EGL display doesn't support RGBA8888 config"); "EGL display doesn't support RGBA8888 config");
g_mutex_unlock (eglglessink->flow_lock);
return ret; return ret;
} }
@ -826,9 +830,6 @@ gst_eglglessink_start (GstBaseSink * sink)
gboolean ret; gboolean ret;
GstEglGlesSink *eglglessink = GST_EGLGLESSINK (sink); GstEglGlesSink *eglglessink = GST_EGLGLESSINK (sink);
eglglessink->flow_lock = g_mutex_new ();
g_mutex_lock (eglglessink->flow_lock);
ret = platform_wrapper_init (); ret = platform_wrapper_init ();
if (!ret) { if (!ret) {
@ -849,12 +850,10 @@ gst_eglglessink_start (GstBaseSink * sink)
/* Ask for a window to render to */ /* Ask for a window to render to */
gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (eglglessink)); gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (eglglessink));
g_mutex_unlock (eglglessink->flow_lock);
return TRUE; return TRUE;
HANDLE_ERROR: HANDLE_ERROR:
g_mutex_unlock (eglglessink->flow_lock); GST_ERROR_OBJECT (eglglessink, "Couldn't start");
return FALSE; return FALSE;
} }
@ -1723,6 +1722,7 @@ gst_eglglessink_init (GstEglGlesSink * eglglessink,
eglglessink->running = FALSE; /* XXX: unused */ eglglessink->running = FALSE; /* XXX: unused */
eglglessink->can_create_window = TRUE; eglglessink->can_create_window = TRUE;
eglglessink->force_rendering_slow = FALSE; eglglessink->force_rendering_slow = FALSE;
eglglessink->flow_lock = g_mutex_new ();
} }
/* Interface initializations. Used here for initializing the XOverlay /* Interface initializations. Used here for initializing the XOverlay