MediaCodec: make use of GtkGraphicsOffload when gtk >= 4.14

This replaces our custom subsurface implementation and has the
advantages, that the subsurface gets repositioned automatically and it
also supports underlay surfaces, so that the application can put control
widgets on top of the SurfaceView.

Our custom subsurface implementation will still be used for GL rendering
This commit is contained in:
Julian Winkler
2024-04-13 13:57:09 +02:00
committed by Mis012
parent 2802aaa28d
commit d5c2c122fc
2 changed files with 86 additions and 3 deletions

View File

@@ -40,6 +40,9 @@ static guint signals[LAST_SIGNAL] = { 0, };
static void surface_view_widget_size_allocate(GtkWidget *widget, int width, int height, int baseline)
{
g_signal_emit(widget, signals[RESIZE], 0, width, height);
for (GtkWidget *child = gtk_widget_get_first_child(widget); child; child = gtk_widget_get_next_sibling(child)) {
gtk_widget_size_allocate(child, &(GtkAllocation){.x=0, .y=0, .width=width, .height=height}, baseline);
}
}
static void surface_view_widget_class_init(SurfaceViewWidgetClass *class)