tizenwlsink: change input param data type for setting wl_surface_id 22/210622/1 accepted/tizen/unified/20190725.220533 submit/tizen/20190724.035455
authorHyunil <hyunil46.park@samsung.com>
Tue, 23 Jul 2019 04:44:09 +0000 (13:44 +0900)
committerHyunil <hyunil46.park@samsung.com>
Tue, 23 Jul 2019 04:44:09 +0000 (13:44 +0900)
Change-Id: I92bb5fc11306fc8ab9e79ffbd8070e0ee344507c
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
tizenwlsink/src/gsttizenwlsink.c
tizenwlsink/src/wldisplay.h

index a975584..ffb2be3 100644 (file)
@@ -217,7 +217,7 @@ static void gst_tizen_wl_sink_set_window_handle (GstVideoOverlay * overlay,
     guintptr handle);
 static void
 gst_tizen_wl_sink_set_wl_window_wl_surface_id (GstVideoOverlay * overlay,
-    guintptr wl_surface_id);
+    gint wl_surface_id);
 static void gst_tizen_wl_sink_set_roi_area (GstVideoOverlay * overlay,
     gint x, gint y, gint w, gint h);
 static void gst_tizen_wl_sink_set_video_source_roi_area (GstVideoOverlay *
@@ -2176,35 +2176,37 @@ gst_tizen_wl_sink_videooverlay_init (GstVideoOverlayInterface * iface)
 /* use  unique_id */
 static void
 gst_tizen_wl_sink_set_wl_window_wl_surface_id (GstVideoOverlay * overlay,
-    guintptr wl_surface_id)
+    gint wl_surface_id)
 {
   GstTizenWlSink *sink = GST_TIZEN_WL_SINK (overlay);
   FUNCTION;
   g_return_if_fail (sink != NULL);
 
+  if (wl_surface_id <= 0) {
+    GST_ERROR_OBJECT (sink, "wl surface id (%d) is wrong <= 0", wl_surface_id);
+    return;
+  }
+  GST_WARNING ("wl_surface_id %d", wl_surface_id);
+
   if (sink->window != NULL) {
     GST_WARNING_OBJECT (sink, "changing window handle is not supported");
     return;
   }
+
   g_mutex_lock (&sink->render_lock);
   g_clear_object (&sink->window);
 
-  GST_WARNING ("wl_surface_id %d 0x%x", (int) wl_surface_id,
-      (guintptr) wl_surface_id);
-
-  if (wl_surface_id) {
-    if (G_LIKELY (gst_tizen_wl_sink_find_display (sink))) {
-      /* we can use our own display with an external window handle */
-      if (G_LIKELY (sink->display->own_display)) {
-        sink->display->wl_surface_id = (int) wl_surface_id;
-        sink->window =
-            gst_wl_window_new_in_surface (sink->display, NULL,
-            &sink->render_lock);
-      }
-    } else {
-      GST_ERROR_OBJECT (sink, "Failed to find display handle, "
-          "ignoring window handle");
+  if (G_LIKELY (gst_tizen_wl_sink_find_display (sink))) {
+    /* we can use our own display with an external window handle */
+    if (G_LIKELY (sink->display->own_display)) {
+      sink->display->wl_surface_id = wl_surface_id;
+      sink->window =
+          gst_wl_window_new_in_surface (sink->display, NULL,
+          &sink->render_lock);
     }
+  } else {
+    GST_ERROR_OBJECT (sink, "Failed to find display handle, "
+        "ignoring window handle");
   }
   g_mutex_unlock (&sink->render_lock);
 
index e6ea1e3..e2cb8c3 100644 (file)
@@ -90,7 +90,7 @@ struct _GstWlDisplay
   guint total_dump;
   guint dump_count;
   gboolean is_native_format;    /*SN12, ST12, SR32, S420 */
-  guint wl_surface_id;
+  gint wl_surface_id;
   gint buffer_width, buffer_height;
 #endif