From: George Kiagiadakis Date: Wed, 18 Nov 2015 11:56:06 +0000 (+0100) Subject: waylandsink: call gst_video_sink_center_rect with a destination rectangle that starts... X-Git-Tag: 1.19.3~507^2~7558 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c51fe83d4228262f297382f49676c76cd2f8147e;p=platform%2Fupstream%2Fgstreamer.git waylandsink: call gst_video_sink_center_rect with a destination rectangle that starts from (0,0) The intention of this code is to find the center rectangle relative to (0,0), since subsurface coordinates are relative to the parent surface. The old code used to work but was wrong and broken by http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/gst-libs/gst/video/gstvideosink.c?id=ff57f6913456ec1991e55517cf1f239e80eeddef --- diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c index a964335..79000ae 100644 --- a/ext/wayland/wlwindow.c +++ b/ext/wayland/wlwindow.c @@ -238,12 +238,15 @@ static void gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit) { GstVideoRectangle src = { 0, }; + GstVideoRectangle dst = { 0, }; GstVideoRectangle res; /* center the video_subsurface inside area_subsurface */ src.w = window->video_width; src.h = window->video_height; - gst_video_sink_center_rect (src, window->render_rectangle, &res, TRUE); + dst.w = window->render_rectangle.w; + dst.h = window->render_rectangle.h; + gst_video_sink_center_rect (src, dst, &res, TRUE); wl_subsurface_set_position (window->video_subsurface, res.x, res.y); wl_viewport_set_destination (window->video_viewport, res.w, res.h);