From: Jan Schmidt Date: Thu, 23 Nov 2017 14:37:48 +0000 (+1100) Subject: 3dvideo example: Correct video overlay for HiDPI X-Git-Tag: 1.16.2~955^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbe084de9de605dd8c425633d0965837f7722c81;p=platform%2Fupstream%2Fgst-plugins-base.git 3dvideo example: Correct video overlay for HiDPI Use the GTK scaling factor to scale the video allocation so video displays correctly on hi-dpi screens --- diff --git a/tests/examples/gl/gtk/3dvideo/main.cpp b/tests/examples/gl/gtk/3dvideo/main.cpp index ec5951b1c..4f12b11cc 100644 --- a/tests/examples/gl/gtk/3dvideo/main.cpp +++ b/tests/examples/gl/gtk/3dvideo/main.cpp @@ -117,9 +117,16 @@ static gboolean resize_cb (GtkWidget * widget, GdkEvent * event, gpointer sink) { GtkAllocation allocation; + gint scale = 1; + +#if GTK_CHECK_VERSION(3, 10, 0) + scale = gtk_widget_get_scale_factor (widget); +#endif gtk_widget_get_allocation (widget, &allocation); - gst_video_overlay_set_render_rectangle (GST_VIDEO_OVERLAY (sink), allocation.x, allocation.y, allocation.width, allocation.height); + gst_video_overlay_set_render_rectangle (GST_VIDEO_OVERLAY (sink), + allocation.x * scale, allocation.y * scale, allocation.width * scale, + allocation.height * scale); return G_SOURCE_CONTINUE; }