From: George Kiagiadakis Date: Fri, 13 Jun 2014 14:37:38 +0000 (+0200) Subject: waylandsink/wlwindow: do not commit a resize when it happens due to a video info... X-Git-Tag: 1.3.3~52 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5334a1f8b2dd8e5b6a0b0db450292b700d70ede;p=platform%2Fupstream%2Fgst-plugins-bad.git waylandsink/wlwindow: do not commit a resize when it happens due to a video info change 1) We know that gst_wayland_sink_render() will commit the surface in the same thread a little later, as gst_wl_window_set_video_info() is always called from there, so we can save the compositor from some extra calculations. 2) We should not commit a resize with the new video info while we are still showing the buffer of the previous video, with the old caps, as that would probably be a visible resize glitch. --- diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c index 4326139..f58df09 100644 --- a/ext/wayland/wlwindow.c +++ b/ext/wayland/wlwindow.c @@ -185,7 +185,7 @@ gst_wl_window_is_toplevel (GstWlWindow * window) } static void -gst_wl_window_resize_internal (GstWlWindow * window) +gst_wl_window_resize_internal (GstWlWindow * window, gboolean commit) { GstVideoRectangle src, res; @@ -198,8 +198,10 @@ gst_wl_window_resize_internal (GstWlWindow * window) window->render_rectangle.x + res.x, window->render_rectangle.y + res.y); wl_viewport_set_destination (window->viewport, res.w, res.h); - wl_surface_damage (window->surface, 0, 0, res.w, res.h); - wl_surface_commit (window->surface); + if (commit) { + wl_surface_damage (window->surface, 0, 0, res.w, res.h); + wl_surface_commit (window->surface); + } /* this is saved for use in wl_surface_damage */ window->surface_width = res.w; @@ -216,7 +218,7 @@ gst_wl_window_set_video_info (GstWlWindow * window, GstVideoInfo * info) window->video_height = info->height; if (window->render_rectangle.w != 0) - gst_wl_window_resize_internal (window); + gst_wl_window_resize_internal (window, FALSE); } void @@ -231,5 +233,5 @@ gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y, window->render_rectangle.h = h; if (window->video_width != 0) - gst_wl_window_resize_internal (window); + gst_wl_window_resize_internal (window, TRUE); }