From 672b2dd991ddc2f7487fdc500ef194524f4c716b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 29 Nov 2017 11:11:39 +0100 Subject: [PATCH] test: vaapicontext: add PLAY and NULL buttons They only appear when only one sink is instanciated and their purpose is to test the NULL-PLAY use case in context sharing. Part-of: --- tests/examples/test-vaapicontext.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/examples/test-vaapicontext.c b/tests/examples/test-vaapicontext.c index 0085ca968b..355d2ceebe 100644 --- a/tests/examples/test-vaapicontext.c +++ b/tests/examples/test-vaapicontext.c @@ -205,6 +205,24 @@ bus_sync_handler (GstBus * bus, GstMessage * msg, gpointer data) return GST_BUS_PASS; } +static void +play_cb (GtkButton * button, gpointer data) +{ + AppData *app = data; + + gst_element_set_state (app->pipeline, GST_STATE_PLAYING); +} + +static void +null_cb (GtkButton * button, gpointer data) +{ + AppData *app = data; + + gst_element_set_state (app->pipeline, GST_STATE_NULL); + app->va_display = NULL; +} + + static void realize_cb (GtkWidget * widget, gpointer data) { @@ -283,6 +301,16 @@ build_ui (AppData * app) gtk_box_pack_start (GTK_BOX (bbox), create_rotate_button (app, "sink2"), TRUE, TRUE, 0); + } else { + GtkWidget *button; + + button = gtk_button_new_with_label ("PLAYING"); + gtk_box_pack_start (GTK_BOX (bbox), button, TRUE, TRUE, 0); + g_signal_connect (button, "clicked", G_CALLBACK (play_cb), app); + + button = gtk_button_new_with_label ("NULL"); + gtk_box_pack_start (GTK_BOX (bbox), button, TRUE, TRUE, 0); + g_signal_connect (button, "clicked", G_CALLBACK (null_cb), app); } gtk_widget_show_all (mainwin);