demos: Add a video benchmark to widgetbowl demo

This commit is contained in:
Benjamin Otte 2018-02-24 23:57:52 +01:00
parent 5bd85058d9
commit b410b48eed

View File

@ -81,6 +81,18 @@ create_label (void)
return w; return w;
} }
static GtkWidget *
create_video (void)
{
GtkMediaStream *stream = gtk_media_file_new_for_resource ("/images/gtk-logo.webm");
GtkWidget *w = gtk_image_new_from_paintable (GDK_PAINTABLE (stream));
gtk_media_stream_set_loop (stream, TRUE);
gtk_media_stream_play (stream);
g_object_unref (stream);
return w;
}
static GtkWidget * static GtkWidget *
create_gears (void) create_gears (void)
{ {
@ -102,6 +114,7 @@ static const struct {
{ "Label" , create_label }, { "Label" , create_label },
{ "Spinner" , create_spinner }, { "Spinner" , create_spinner },
{ "Spinbutton", create_spinbutton }, { "Spinbutton", create_spinbutton },
{ "Video", create_video },
{ "Gears", create_gears }, { "Gears", create_gears },
}; };