tests: use playbin, not playbin2

This commit is contained in:
Jonathan Matthew 2012-01-26 10:35:51 +01:00 committed by Sebastian Dröge
parent e391118125
commit 8478ef2e20
4 changed files with 7 additions and 17 deletions

View file

@ -139,7 +139,7 @@ main (gint argc, gchar * argv[])
exit (-1);
}
player = gst_element_factory_make ("playbin2", "player");
player = gst_element_factory_make ("playbin", "player");
g_assert (player);
bus = gst_pipeline_get_bus (GST_PIPELINE (player));

View file

@ -134,7 +134,7 @@ main (int argc, char *argv[])
/* create a mainloop to get messages */
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);
/* set appsink to get the subtitles */

View file

@ -115,9 +115,9 @@ main (gint argc, gchar ** argv)
uri = argv[1];
/* build pipeline */
bin = gst_element_factory_make ("playbin2", NULL);
bin = gst_element_factory_make ("playbin", NULL);
if (!bin) {
GST_WARNING ("need playbin2 from gst-plugins-base");
GST_WARNING ("need playbin from gst-plugins-base");
goto Error;
}

View file

@ -5,14 +5,14 @@
#define TEST_RUNTIME 120.0 /* how long to run the test, in seconds */
static void
play_file (const gchar * bin, const gint delay, const gchar * uri)
play_file (const gint delay, const gchar * uri)
{
GstStateChangeReturn sret;
GstMessage *msg;
GstElement *play;
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_printerr ("Playing %s\n", uri);
@ -88,11 +88,9 @@ main (int argc, char **argv)
gchar **args = NULL;
guint num, i;
GError *err = NULL;
gchar *bin = NULL;
gint run = 100;
GOptionContext *ctx;
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)",
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);
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) {
g_print ("Please provide one or more directories with audio files\n\n");
return 1;
@ -143,11 +134,10 @@ main (int argc, char **argv)
gint32 idx;
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_free (bin);
g_timer_destroy (timer);
return 0;