mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 01:45:33 +00:00
tests: use playbin, not playbin2
This commit is contained in:
parent
e391118125
commit
8478ef2e20
4 changed files with 7 additions and 17 deletions
|
@ -139,7 +139,7 @@ main (gint argc, gchar * argv[])
|
||||||
exit (-1);
|
exit (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
player = gst_element_factory_make ("playbin2", "player");
|
player = gst_element_factory_make ("playbin", "player");
|
||||||
g_assert (player);
|
g_assert (player);
|
||||||
|
|
||||||
bus = gst_pipeline_get_bus (GST_PIPELINE (player));
|
bus = gst_pipeline_get_bus (GST_PIPELINE (player));
|
||||||
|
|
|
@ -134,7 +134,7 @@ main (int argc, char *argv[])
|
||||||
/* create a mainloop to get messages */
|
/* create a mainloop to get messages */
|
||||||
app->loop = g_main_loop_new (NULL, TRUE);
|
app->loop = g_main_loop_new (NULL, TRUE);
|
||||||
|
|
||||||
app->playbin = gst_element_factory_make ("playbin2", NULL);
|
app->playbin = gst_element_factory_make ("playbin", NULL);
|
||||||
g_assert (app->playbin);
|
g_assert (app->playbin);
|
||||||
|
|
||||||
/* set appsink to get the subtitles */
|
/* set appsink to get the subtitles */
|
||||||
|
|
|
@ -115,9 +115,9 @@ main (gint argc, gchar ** argv)
|
||||||
uri = argv[1];
|
uri = argv[1];
|
||||||
|
|
||||||
/* build pipeline */
|
/* build pipeline */
|
||||||
bin = gst_element_factory_make ("playbin2", NULL);
|
bin = gst_element_factory_make ("playbin", NULL);
|
||||||
if (!bin) {
|
if (!bin) {
|
||||||
GST_WARNING ("need playbin2 from gst-plugins-base");
|
GST_WARNING ("need playbin from gst-plugins-base");
|
||||||
goto Error;
|
goto Error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,14 +5,14 @@
|
||||||
#define TEST_RUNTIME 120.0 /* how long to run the test, in seconds */
|
#define TEST_RUNTIME 120.0 /* how long to run the test, in seconds */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
play_file (const gchar * bin, const gint delay, const gchar * uri)
|
play_file (const gint delay, const gchar * uri)
|
||||||
{
|
{
|
||||||
GstStateChangeReturn sret;
|
GstStateChangeReturn sret;
|
||||||
GstMessage *msg;
|
GstMessage *msg;
|
||||||
GstElement *play;
|
GstElement *play;
|
||||||
guint wait_nanosecs;
|
guint wait_nanosecs;
|
||||||
|
|
||||||
play = gst_element_factory_make (bin, "playbin");
|
play = gst_element_factory_make ("playbin", "playbin");
|
||||||
|
|
||||||
g_object_set (play, "uri", uri, NULL);
|
g_object_set (play, "uri", uri, NULL);
|
||||||
g_printerr ("Playing %s\n", uri);
|
g_printerr ("Playing %s\n", uri);
|
||||||
|
@ -88,11 +88,9 @@ main (int argc, char **argv)
|
||||||
gchar **args = NULL;
|
gchar **args = NULL;
|
||||||
guint num, i;
|
guint num, i;
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
gchar *bin = NULL;
|
|
||||||
gint run = 100;
|
gint run = 100;
|
||||||
GOptionContext *ctx;
|
GOptionContext *ctx;
|
||||||
GOptionEntry options[] = {
|
GOptionEntry options[] = {
|
||||||
{"bin", '\000', 0, G_OPTION_ARG_STRING, &bin, "playbin factory name", NULL},
|
|
||||||
{"runtime", '\000', 0, G_OPTION_ARG_INT, &run, "maximum play time (ms)",
|
{"runtime", '\000', 0, G_OPTION_ARG_INT, &run, "maximum play time (ms)",
|
||||||
NULL},
|
NULL},
|
||||||
{G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &args, NULL},
|
{G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &args, NULL},
|
||||||
|
@ -109,13 +107,6 @@ main (int argc, char **argv)
|
||||||
}
|
}
|
||||||
g_option_context_free (ctx);
|
g_option_context_free (ctx);
|
||||||
|
|
||||||
if (!bin)
|
|
||||||
bin = g_strdup ("playbin");
|
|
||||||
|
|
||||||
if (strcmp (bin, "playbin") && strcmp (bin, "playbin2")) {
|
|
||||||
g_print ("Please provide a valid playbin argument; playbin | playbin2");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
if (args == NULL || *args == NULL) {
|
if (args == NULL || *args == NULL) {
|
||||||
g_print ("Please provide one or more directories with audio files\n\n");
|
g_print ("Please provide one or more directories with audio files\n\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -143,11 +134,10 @@ main (int argc, char **argv)
|
||||||
gint32 idx;
|
gint32 idx;
|
||||||
|
|
||||||
idx = g_random_int_range (0, files->len);
|
idx = g_random_int_range (0, files->len);
|
||||||
play_file (bin, run, (const gchar *) g_ptr_array_index (files, idx));
|
play_file (run, (const gchar *) g_ptr_array_index (files, idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
g_strfreev (args);
|
g_strfreev (args);
|
||||||
g_free (bin);
|
|
||||||
g_timer_destroy (timer);
|
g_timer_destroy (timer);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue