diff options
author | Víctor Manuel Jáquez Leal <vjaquez@igalia.com> | 2017-11-29 11:11:39 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-07-31 14:02:33 +0200 |
commit | 672b2dd991ddc2f7487fdc500ef194524f4c716b (patch) | |
tree | 356fec012fa493af8f2dff78b1af7a6b7c44c2bf /tests/examples | |
parent | 9eb25ab849a83ba248915e901e398c03b585d726 (diff) |
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/342>
Diffstat (limited to 'tests/examples')
-rw-r--r-- | tests/examples/test-vaapicontext.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/examples/test-vaapicontext.c b/tests/examples/test-vaapicontext.c index 0085ca96..355d2cee 100644 --- a/tests/examples/test-vaapicontext.c +++ b/tests/examples/test-vaapicontext.c @@ -206,6 +206,24 @@ bus_sync_handler (GstBus * bus, GstMessage * msg, gpointer data) } 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) { AppData *app = 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); |