static void
gst_wayland_sink_init (GstWaylandSink * sink)
{
+ g_mutex_init (&sink->render_lock);
g_cond_init (&sink->render_cond);
}
if (sink->display_name)
g_free (sink->display_name);
+ g_mutex_clear (&sink->render_lock);
g_cond_clear (&sink->render_cond);
G_OBJECT_CLASS (parent_class)->finalize (object);
frame_redraw_callback
};
-/* must be called with the object lock */
+/* must be called with the render lock */
static void
render_last_buffer (GstWaylandSink * sink)
{
if (!sink->window)
gst_video_overlay_prepare_window_handle (GST_VIDEO_OVERLAY (sink));
- GST_OBJECT_LOCK (sink);
+ g_mutex_lock (&sink->render_lock);
GST_LOG_OBJECT (sink, "render buffer %p", buffer);
}
done:
{
- GST_OBJECT_UNLOCK (sink);
+ g_mutex_unlock (&sink->render_lock);
return ret;
}
}
g_return_if_fail (sink != NULL);
- GST_OBJECT_LOCK (sink);
+ g_mutex_lock (&sink->render_lock);
GST_DEBUG_OBJECT (sink, "Setting window handle %" GST_PTR_FORMAT,
(void *) handle);
}
}
- GST_OBJECT_UNLOCK (sink);
+ g_mutex_unlock (&sink->render_lock);
}
static void
g_return_if_fail (sink != NULL);
- GST_OBJECT_LOCK (sink);
+ g_mutex_lock (&sink->render_lock);
if (!sink->window) {
- GST_OBJECT_UNLOCK (sink);
+ g_mutex_unlock (&sink->render_lock);
GST_WARNING_OBJECT (sink,
"set_render_rectangle called without window, ignoring");
return;
x, y, w, h);
gst_wl_window_set_render_rectangle (sink->window, x, y, w, h);
- GST_OBJECT_UNLOCK (sink);
+ g_mutex_unlock (&sink->render_lock);
}
static void
GST_DEBUG_OBJECT (sink, "expose");
- GST_OBJECT_LOCK (sink);
+ g_mutex_lock (&sink->render_lock);
if (sink->last_buffer && g_atomic_int_get (&sink->redraw_pending) == FALSE) {
GST_DEBUG_OBJECT (sink, "redrawing last buffer");
render_last_buffer (sink);
}
- GST_OBJECT_UNLOCK (sink);
+ g_mutex_unlock (&sink->render_lock);
}
static void
GstWaylandSink *sink = GST_WAYLAND_SINK (video);
g_return_if_fail (sink != NULL);
- GST_OBJECT_LOCK (sink);
+ g_mutex_lock (&sink->render_lock);
sink->drawing_frozen = TRUE;
- GST_OBJECT_UNLOCK (sink);
+ g_mutex_unlock (&sink->render_lock);
}
static void
GST_DEBUG_OBJECT (sink, "resuming rendering");
- GST_OBJECT_LOCK (sink);
+ g_mutex_lock (&sink->render_lock);
sink->drawing_frozen = FALSE;
if (GST_STATE (sink) == GST_STATE_PLAYING) {
sink->rendered = FALSE;
while (sink->rendered == FALSE)
- g_cond_wait (&sink->render_cond, GST_OBJECT_GET_LOCK (sink));
+ g_cond_wait (&sink->render_cond, &sink->render_lock);
GST_DEBUG_OBJECT (sink, "synchronized with render()");
} else if (sink->window && sink->last_buffer &&
g_atomic_int_get (&sink->redraw_pending) == FALSE) {
GST_DEBUG_OBJECT (sink, "last buffer redrawn");
}
- GST_OBJECT_UNLOCK (sink);
+ g_mutex_unlock (&sink->render_lock);
}
static gboolean