mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 23:28:16 +00:00
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>
This commit is contained in:
parent
9eb25ab849
commit
672b2dd991
1 changed files with 28 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue