sys/: I prefer locking the mutex in the function directly. We might want to call it from somewhere else one day.

Original commit message from CVS:
2004-06-27  Julien Moutte  <julien@moutte.net>

* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_decorate),
(gst_ximagesink_xwindow_new):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_decorate),
(gst_xvimagesink_xwindow_new): I prefer locking the mutex in the
function directly. We might want to call it from somewhere else one day.
This commit is contained in:
Julien Moutte 2004-06-27 19:02:29 +00:00
parent fa3c245918
commit 2624d3ea37
3 changed files with 20 additions and 4 deletions

View file

@ -1,3 +1,11 @@
2004-06-27 Julien Moutte <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_decorate),
(gst_ximagesink_xwindow_new):
* sys/xvimage/xvimagesink.c: (gst_xvimagesink_xwindow_decorate),
(gst_xvimagesink_xwindow_new): I prefer locking the mutex in the
function directly. We might want to call it from somewhere else one day.
2004-06-27 Julien Moutte <julien@moutte.net>
* sys/ximage/ximagesink.c: (gst_ximagesink_xwindow_decorate),

View file

@ -309,6 +309,8 @@ gst_ximagesink_xwindow_decorate (GstXImageSink * ximagesink,
g_return_val_if_fail (GST_IS_XIMAGESINK (ximagesink), FALSE);
g_return_val_if_fail (window != NULL, FALSE);
g_mutex_lock (ximagesink->x_lock);
hints_atom = XInternAtom (ximagesink->xcontext->disp, "_MOTIF_WM_HINTS", 1);
hints = g_malloc0 (sizeof (MotifWmHints));
@ -326,6 +328,8 @@ gst_ximagesink_xwindow_decorate (GstXImageSink * ximagesink,
XSync (ximagesink->xcontext->disp, FALSE);
g_mutex_unlock (ximagesink->x_lock);
g_free (hints);
return TRUE;
@ -359,12 +363,12 @@ gst_ximagesink_xwindow_new (GstXImageSink * ximagesink, gint width, gint height)
XMapRaised (ximagesink->xcontext->disp, xwindow->win);
gst_ximagesink_xwindow_decorate (ximagesink, xwindow);
XSync (ximagesink->xcontext->disp, FALSE);
g_mutex_unlock (ximagesink->x_lock);
gst_ximagesink_xwindow_decorate (ximagesink, xwindow);
gst_x_overlay_got_xwindow_id (GST_X_OVERLAY (ximagesink), xwindow->win);
return xwindow;

View file

@ -320,6 +320,8 @@ gst_xvimagesink_xwindow_decorate (GstXvImageSink * xvimagesink,
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), FALSE);
g_return_val_if_fail (window != NULL, FALSE);
g_mutex_lock (xvimagesink->x_lock);
hints_atom = XInternAtom (xvimagesink->xcontext->disp, "_MOTIF_WM_HINTS", 1);
hints = g_malloc0 (sizeof (MotifWmHints));
@ -337,6 +339,8 @@ gst_xvimagesink_xwindow_decorate (GstXvImageSink * xvimagesink,
XSync (xvimagesink->xcontext->disp, FALSE);
g_mutex_unlock (xvimagesink->x_lock);
g_free (hints);
return TRUE;
@ -374,12 +378,12 @@ gst_xvimagesink_xwindow_new (GstXvImageSink * xvimagesink,
XMapRaised (xvimagesink->xcontext->disp, xwindow->win);
gst_xvimagesink_xwindow_decorate (xvimagesink, xwindow);
XSync (xvimagesink->xcontext->disp, FALSE);
g_mutex_unlock (xvimagesink->x_lock);
gst_xvimagesink_xwindow_decorate (xvimagesink, xwindow);
gst_x_overlay_got_xwindow_id (GST_X_OVERLAY (xvimagesink), xwindow->win);
return xwindow;