waylandsink : 1. exception handling for NULL buffer on GST_PAUSED 91/67691/1
authorHyunil <hyunil46.park@samsung.com>
Thu, 28 Apr 2016 04:54:47 +0000 (13:54 +0900)
committerHyunil <hyunil46.park@samsung.com>
Thu, 28 Apr 2016 04:54:47 +0000 (13:54 +0900)
              2. fix bug about geometry coordination.

Change-Id: I1921b74dd7399391c73e04941fda63b20f12b446
Signed-off-by: Hyunil <hyunil46.park@samsung.com>
ext/wayland/gstwaylandsink.c
ext/wayland/wlshmallocator.c
ext/wayland/wlwindow.c

index 51bd008c7688f6164a48d78aaa888aca2d9c54c1..9f9415ce8af5c0833e77c485259a21ec5f08b672 100755 (executable)
@@ -343,6 +343,8 @@ gst_wayland_sink_update_last_buffer_geometry (GstWaylandSink * sink)
   GstWlBuffer *wlbuffer;
   FUNCTION;
   g_return_if_fail (sink != NULL);
+  g_return_if_fail (sink->last_buffer != NULL);
+
   GST_DEBUG ("gstbuffer ref count is %d",
       GST_OBJECT_REFCOUNT_VALUE (sink->last_buffer));
   wlbuffer = gst_buffer_get_wl_buffer (sink->last_buffer);
index ec88b77d5ea154e1a80c6d7115e98ba831d7d80e..68be1294cf04294290496ba32d9826f2be4f2a71 100644 (file)
@@ -102,6 +102,7 @@ gst_wl_shm_allocator_alloc (GstAllocator * allocator, gsize size,
     /* allocate shm pool */
     snprintf (filename, 1024, "%s/%s-%d-%s", g_get_user_runtime_dir (),
         "wayland-shm", init++, "XXXXXX");
+       GST_INFO ("opening temp file %s",filename);
 
     fd = g_mkstemp (filename);
     if (fd < 0) {
index a3222fff79c2e44f53adebfc78250c222b562196..de678b7b48c2e3e100a1911e0959876422f85430 100644 (file)
@@ -449,6 +449,9 @@ gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit)
   /*default res.w and res.h */
   dst.w = window->render_rectangle.w;
   dst.h = window->render_rectangle.h;
+  dst.x = window->render_rectangle.x;
+  dst.y = window->render_rectangle.y;
+
   GST_INFO ("dst(%d,%d,%d x %d)", dst.x, dst.y, dst.w, dst.h);
   GST_INFO ("window->render_rectangle(%d,%d,%d x %d)",
       window->render_rectangle.x, window->render_rectangle.y,
@@ -457,8 +460,6 @@ gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit)
     case DISP_GEO_METHOD_LETTER_BOX:
       GST_INFO ("DISP_GEO_METHOD_LETTER_BOX");
       gst_video_sink_center_rect (src, dst, &res, TRUE);
-      res.x += window->render_rectangle.x;
-      res.y += window->render_rectangle.y;
       break;
     case DISP_GEO_METHOD_ORIGIN_SIZE_OR_LETTER_BOX:
       if (src.w > dst.w || src.h > dst.h) {
@@ -466,8 +467,6 @@ gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit)
         GST_INFO
             ("DISP_GEO_METHOD_ORIGIN_SIZE_OR_LETTER_BOX -> set LETTER BOX");
         gst_video_sink_center_rect (src, dst, &res, TRUE);
-        res.x += window->render_rectangle.x;
-        res.y += window->render_rectangle.y;
       } else {
         /*ORIGIN SIZE */
         GST_INFO ("DISP_GEO_METHOD_ORIGIN_SIZE");
@@ -522,10 +521,8 @@ gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit)
 
   if (window->video_subsurface) {
     GST_INFO ("have window->subsurface");
-    wl_subsurface_set_position (window->video_subsurface,
-        window->render_rectangle.x + res.x, window->render_rectangle.y + res.y);
-    GST_INFO ("wl_subsurface_set_position(%d,%d)",
-        window->render_rectangle.x + res.x, window->render_rectangle.y + res.y);
+    wl_subsurface_set_position (window->video_subsurface, res.x, res.y);
+    GST_INFO ("wl_subsurface_set_position(%d,%d)", res.x, res.y);
   }
   wl_viewport_set_destination (window->video_viewport, res.w, res.h);
   GST_INFO ("wl_viewport_set_destination(%d,%d)", res.w, res.h);