Commit bbe084de authored by Jan Schmidt's avatar Jan Schmidt Committed by Tim-Philipp Müller

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
parent 4e2ede5e
......@@ -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);
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);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment