waylandsink : fix buffer ref count with SHM mode 92/79492/2 accepted/tizen/common/20160712.150548 accepted/tizen/ivi/20160712.000343 accepted/tizen/mobile/20160712.000259 accepted/tizen/tv/20160712.000346 accepted/tizen/wearable/20160712.000335 submit/tizen/20160711.133745
authorHyunil <hyunil46.park@samsung.com>
Mon, 11 Jul 2016 12:46:20 +0000 (21:46 +0900)
committerHyunil <hyunil46.park@samsung.com>
Mon, 11 Jul 2016 12:50:54 +0000 (21:50 +0900)
Change-Id: I806b441b65ced4a05359418ffa8cadfd7cfe14e9
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
ext/wayland/gstwaylandsink.c

index 757d4fc..cee6ecc 100755 (executable)
@@ -394,6 +394,7 @@ gst_wayland_sink_update_last_buffer_geometry (GstWaylandSink * sink)
   FUNCTION;
   g_return_if_fail (sink != NULL);
   g_return_if_fail (sink->last_buffer != NULL);
+  g_return_if_fail (sink->display != NULL);
   wlbuffer = gst_buffer_get_wl_buffer (sink->last_buffer);
   g_return_if_fail (wlbuffer != NULL);
   wlbuffer->used_by_compositor = FALSE;
@@ -401,6 +402,15 @@ gst_wayland_sink_update_last_buffer_geometry (GstWaylandSink * sink)
   GST_LOG ("gstbuffer(%p) ref count(%d)", sink->last_buffer,
       GST_OBJECT_REFCOUNT_VALUE (sink->last_buffer));
 
+  if (!sink->display->is_native_format) {
+    /* use SHM , use TBM with normal video format*/
+    render_last_buffer (sink);
+    if (!sink->visible)
+      gst_buffer_unref (wlbuffer->gstbuffer);
+    GST_LOG ("gstbuffer(%p) ref count(%d)", sink->last_buffer,
+        GST_OBJECT_REFCOUNT_VALUE (sink->last_buffer));
+    return;
+  }
   if (sink->visible) {
     /*need to render last buffer, reuse current GstWlBuffer */
     render_last_buffer (sink);