waylandsink: Add exception code for setting wl_surface
authorHyunil Park <hyunil46.park@samsung.com>
Tue, 3 Nov 2015 10:42:40 +0000 (10:42 +0000)
committerLuis de Bethencourt <luisbg@osg.samsung.com>
Tue, 3 Nov 2015 10:45:05 +0000 (10:45 +0000)
Waylandsink needs exception code in gst_wayland_sink_set_window_handle().
After making sink->window, User can call
gst_wayland_sink_set_window_handle(). It is the user's fault, but
Waylandsink needs to handle the exception, if not then sink->window is
changed and rendering fails.

https://bugzilla.gnome.org/show_bug.cgi?id=747482

ext/wayland/gstwaylandsink.c

index a385932..10d477e 100644 (file)
@@ -727,6 +727,11 @@ gst_wayland_sink_set_window_handle (GstVideoOverlay * overlay, guintptr handle)
 
   g_return_if_fail (sink != NULL);
 
+  if (sink->window != NULL) {
+    GST_WARNING_OBJECT (sink, "changing window handle is not supported");
+    return;
+  }
+
   g_mutex_lock (&sink->render_lock);
 
   GST_DEBUG_OBJECT (sink, "Setting window handle %" GST_PTR_FORMAT,