tests/mass_elements.c: allow specifying src and sink element explicitly, so I can test videotestsrc instead of fakesrc

Original commit message from CVS:
* tests/mass_elements.c: (main):
allow specifying src and sink element explicitly, so I can test
videotestsrc instead of fakesrc
This commit is contained in:
Benjamin Otte 2004-08-04 12:54:22 +00:00
parent ce7ad83f64
commit 0148ca0f38
3 changed files with 48 additions and 12 deletions

View file

@ -1,3 +1,9 @@
2004-08-04 Benjamin Otte <otte@gnome.org>
* tests/mass_elements.c: (main):
allow specifying src and sink element explicitly, so I can test
videotestsrc instead of fakesrc
2004-08-04 Benjamin Otte <otte@gnome.org>
* gst/gststructure.c: (gst_structure_id_empty_new_with_size),

View file

@ -20,6 +20,8 @@
#define IDENTITY_COUNT (1000)
#define BUFFER_COUNT (1000)
#define SRC_ELEMENT "fakesrc"
#define SINK_ELEMENT "fakesink"
static GstClockTime
@ -37,6 +39,7 @@ main (gint argc, gchar * argv[])
GstElement *pipeline, *src, *sink, *current, *last;
guint i, buffers = BUFFER_COUNT, identities = IDENTITY_COUNT;
GstClockTime start, end;
gchar *src_name = SRC_ELEMENT, *sink_name = SINK_ELEMENT;
gst_init (&argc, &argv);
@ -44,23 +47,35 @@ main (gint argc, gchar * argv[])
identities = atoi (argv[1]);
if (argc > 2)
buffers = atoi (argv[2]);
if (argc > 3)
src_name = argv[3];
if (argc > 4)
sink_name = argv[4];
g_print
("*** benchmarking this pipeline: fakesrc num-buffers=%u ! %u * identity ! fakesink\n",
buffers, identities);
("*** benchmarking this pipeline: %s num-buffers=%u ! %u * identity ! %s\n",
src_name, buffers, identities, sink_name);
start = gst_get_current_time ();
pipeline = gst_element_factory_make ("pipeline", NULL);
g_assert (pipeline);
src = gst_element_factory_make ("fakesrc", NULL);
g_assert (src);
src = gst_element_factory_make (src_name, NULL);
if (!src) {
g_print ("no element named \"%s\" found, aborting...\n", src_name);
return 1;
}
g_object_set (src, "num-buffers", buffers, NULL);
sink = gst_element_factory_make ("fakesink", NULL);
g_assert (sink);
sink = gst_element_factory_make (sink_name, NULL);
if (!sink) {
g_print ("no element named \"%s\" found, aborting...\n", sink_name);
return 1;
}
last = src;
gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
for (i = 0; i < identities; i++) {
current = gst_element_factory_make ("identity", NULL);
g_assert (current);
/* shut this element up (no g_strdup_printf please) */
g_object_set (current, "silent", TRUE, NULL);
gst_bin_add (GST_BIN (pipeline), current);
if (!gst_element_link (last, current))
g_assert_not_reached ();

View file

@ -20,6 +20,8 @@
#define IDENTITY_COUNT (1000)
#define BUFFER_COUNT (1000)
#define SRC_ELEMENT "fakesrc"
#define SINK_ELEMENT "fakesink"
static GstClockTime
@ -37,6 +39,7 @@ main (gint argc, gchar * argv[])
GstElement *pipeline, *src, *sink, *current, *last;
guint i, buffers = BUFFER_COUNT, identities = IDENTITY_COUNT;
GstClockTime start, end;
gchar *src_name = SRC_ELEMENT, *sink_name = SINK_ELEMENT;
gst_init (&argc, &argv);
@ -44,23 +47,35 @@ main (gint argc, gchar * argv[])
identities = atoi (argv[1]);
if (argc > 2)
buffers = atoi (argv[2]);
if (argc > 3)
src_name = argv[3];
if (argc > 4)
sink_name = argv[4];
g_print
("*** benchmarking this pipeline: fakesrc num-buffers=%u ! %u * identity ! fakesink\n",
buffers, identities);
("*** benchmarking this pipeline: %s num-buffers=%u ! %u * identity ! %s\n",
src_name, buffers, identities, sink_name);
start = gst_get_current_time ();
pipeline = gst_element_factory_make ("pipeline", NULL);
g_assert (pipeline);
src = gst_element_factory_make ("fakesrc", NULL);
g_assert (src);
src = gst_element_factory_make (src_name, NULL);
if (!src) {
g_print ("no element named \"%s\" found, aborting...\n", src_name);
return 1;
}
g_object_set (src, "num-buffers", buffers, NULL);
sink = gst_element_factory_make ("fakesink", NULL);
g_assert (sink);
sink = gst_element_factory_make (sink_name, NULL);
if (!sink) {
g_print ("no element named \"%s\" found, aborting...\n", sink_name);
return 1;
}
last = src;
gst_bin_add_many (GST_BIN (pipeline), src, sink, NULL);
for (i = 0; i < identities; i++) {
current = gst_element_factory_make ("identity", NULL);
g_assert (current);
/* shut this element up (no g_strdup_printf please) */
g_object_set (current, "silent", TRUE, NULL);
gst_bin_add (GST_BIN (pipeline), current);
if (!gst_element_link (last, current))
g_assert_not_reached ();