summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2014-06-13 16:37:38 +0200
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2014-06-17 13:51:30 +0200
commite5334a1f8b2dd8e5b6a0b0db450292b700d70ede (patch)
treef13dd863ce2dd37b65f62a5a34430074bfc282ac /ext
parent04b0e548383dd7a4ebbe3aad2b5f9ca21241877a (diff)
downloadgstreamer-plugins-bad-e5334a1f8b2dd8e5b6a0b0db450292b700d70ede.tar.gz
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.
Diffstat (limited to 'ext')
-rw-r--r--ext/wayland/wlwindow.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c
index 432613970..f58df0965 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);
}