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

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Tue Apr 7 19:29:37 PDT 2015


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

            Bug ID: 747482
           Summary: waylandsink: need exception code in
                    gst_wayland_sink_set_window_handle() and
                    gst_wayland_sink_set_context()
    Classification: Platform
           Product: GStreamer
           Version: 1.4.1
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gst-plugins-bad
          Assignee: gstreamer-bugs at lists.freedesktop.org
          Reporter: hyunil46.park at samsung.com
        QA Contact: gstreamer-bugs at lists.freedesktop.org
     GNOME version: ---

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.
So Could you add some code as below.

static void
gst_wayland_sink_set_window_handle (GstVideoOverlay * overlay, guintptr handle)
{
  GstWaylandSink *sink = GST_WAYLAND_SINK (overlay);
  struct wl_surface *surface = (struct wl_surface *) handle;

  g_return_if_fail (sink != NULL);

+  if (sink->window != NULL){
+      return;
+  }

  g_mutex_lock (&sink->render_lock);

  GST_DEBUG_OBJECT (sink, "Setting window handle %" GST_PTR_FORMAT,

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.
So Could you add some code as below.
static void
gst_wayland_sink_set_context (GstElement * element, GstContext * context)
{
  GstWaylandSink *sink = GST_WAYLAND_SINK (element);
  GST_INFO(" ");
  if (gst_context_has_context_type (context,
          GST_WAYLAND_DISPLAY_HANDLE_CONTEXT_TYPE)) {
    g_mutex_lock (&sink->display_lock);
    if (G_LIKELY (!sink->display)) {
      gst_wayland_sink_set_display_from_context (sink, context);
    } else {
      GST_WARNING_OBJECT (element, "changing display handle is not supported");
+      g_mutex_unlock (&sink->display_lock);
+      return ;
      }
    g_mutex_unlock (&sink->display_lock);
  }
  GST_ERROR("element %p context %p", element, context);
  if (GST_ELEMENT_CLASS (parent_class)->set_context)
    GST_ELEMENT_CLASS (parent_class)->set_context (element, context);
}


Thank you

-- 
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