[Bug 747482] waylandsink: need exception code in gst_wayland_sink_set_window_handle() and gst_wayland_sink_set_context()

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Apr 8 21:26:58 PDT 2015


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

Hyunil Park <hyunil46.park at samsung.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hyunil46.park at samsung.com

--- Comment #3 from Hyunil Park <hyunil46.park at samsung.com> ---
Created attachment 301176
  --> https://bugzilla.gnome.org/attachment.cgi?id=301176&action=edit
[PATCH] waylandsink : Add exception code for setting wl_display and wl_surface

Waylandsink need exception code in gst_wayland_sink_set_window_handle().
After making sink->window, User can call gst_wayland_sink_set_window_handle().
It is user's fault. but Waylandsink need to exception.
If Waylandsink does not exception then sink->window is changed and rendering is
failed.

Waylandsink need exception code in gst_wayland_sink_set_context()
After calling gst_wayland_sink_set_context(), below code is set.
GST_ELEMENT_CLASS (parent_class)->set_context (element, context);
but, If user can call onemore. It is user's fault. but waylandsink need to
exception.

--- a/ext/wayland/gstwaylandsink.c
+++ b/ext/wayland/gstwaylandsink.c
@@ -370,10 +370,13 @@ gst_wayland_sink_set_context (GstElement * element,
GstContext * context)
   if (gst_context_has_context_type (context,
           GST_WAYLAND_DISPLAY_HANDLE_CONTEXT_TYPE)) {
     g_mutex_lock (&sink->display_lock);
-    if (G_LIKELY (!sink->display))
+    if (G_LIKELY (!sink->display)) {
       gst_wayland_sink_set_display_from_context (sink, context);
-    else
+    } else {
       GST_WARNING_OBJECT (element, "changing display handle is not
supported");
+      g_mutex_unlock (&sink->display_lock);
+      return;
+    }
     g_mutex_unlock (&sink->display_lock);
   }

@@ -730,6 +733,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,

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list