variety is spicy

Original commit message from CVS:
variety is spicy
This commit is contained in:
Thomas Vander Stichele 2002-12-07 14:16:52 +00:00
parent 58d2d2798c
commit 8b9fcbd5df
4 changed files with 26 additions and 22 deletions

View file

@ -10,7 +10,8 @@ gboolean can_quit = FALSE;
static void static void
construct_pipeline (GstElement *pipeline, gint identities) construct_pipeline (GstElement *pipeline, gint identities)
{ {
GstElement *src, *sink, *identity; GstElement *src, *sink;
GstElement *identity = NULL;
GstElement *from; GstElement *from;
int i; int i;
@ -32,20 +33,20 @@ construct_pipeline (GstElement *pipeline, gint identities)
} }
gst_element_connect (identity, sink); gst_element_connect (identity, sink);
g_object_set (G_OBJECT (src), "num_buffers", 2, "sizetype", 3, NULL); g_object_set (G_OBJECT (src), "num_buffers", 1, "sizetype", 3, NULL);
} }
void void
state_changed (GstElement *el, gint arg1, gint arg2, gpointer user_data) state_changed (GstElement *el, gint arg1, gint arg2, gpointer user_data)
{ {
GstElementState state = gst_element_get_state (el); GstElementState state = gst_element_get_state (el);
g_print ("element %s has changed state to %s\n", g_print ("element %s has changed state to %s\n",
GST_ELEMENT_NAME (el), GST_ELEMENT_NAME (el),
gst_element_state_get_name (state)); gst_element_state_get_name (state));
if (state == GST_STATE_PLAYING) running = TRUE; if (state == GST_STATE_PLAYING) running = TRUE;
/* if we move from PLAYING to PAUSED, we're done */ /* if we move from PLAYING to PAUSED, we're done */
if (state == GST_STATE_PAUSED && running) if (state == GST_STATE_PAUSED && running)
{ {
while (!can_quit) ; while (!can_quit) ;
can_quit = FALSE; can_quit = FALSE;
@ -61,10 +62,10 @@ main (gint argc, gchar *argv[])
int i; int i;
gulong id; gulong id;
GstElement *thread; GstElement *thread;
gst_init (&argc, &argv); gst_init (&argc, &argv);
for (i = 0; i < runs; ++i) for (i = 90; i < runs; ++i)
{ {
thread = gst_thread_new ("main_thread"); thread = gst_thread_new ("main_thread");
g_assert (thread); g_assert (thread);
@ -81,7 +82,7 @@ main (gint argc, gchar *argv[])
else { else {
g_print ("Going into the main GStreamer loop\n"); g_print ("Going into the main GStreamer loop\n");
can_quit = TRUE; /* we don't want gst_main_quit called before gst_main */ can_quit = TRUE; /* we don't want gst_main_quit called before gst_main */
gst_main (); gst_main ();
} }
running = FALSE; running = FALSE;
g_print ("Coming out of the main GStreamer loop\n"); g_print ("Coming out of the main GStreamer loop\n");

View file

@ -16,7 +16,8 @@ gboolean done = FALSE;
static void static void
construct_pipeline (GstElement *pipeline, gint identities) construct_pipeline (GstElement *pipeline, gint identities)
{ {
GstElement *src, *sink, *identity; GstElement *src, *sink;
GstElement *identity = NULL;
GstElement *from; GstElement *from;
int i; int i;
@ -49,7 +50,7 @@ thread (void)
int i; int i;
GstElement *pipeline; GstElement *pipeline;
for (i = 50; i < runs; ++i) for (i = 30; i < runs; ++i)
{ {
pipeline = gst_pipeline_new ("main_pipeline"); pipeline = gst_pipeline_new ("main_pipeline");
g_assert (pipeline); g_assert (pipeline);

View file

@ -10,7 +10,8 @@ gboolean can_quit = FALSE;
static void static void
construct_pipeline (GstElement *pipeline, gint identities) construct_pipeline (GstElement *pipeline, gint identities)
{ {
GstElement *src, *sink, *identity; GstElement *src, *sink;
GstElement *identity = NULL;
GstElement *from; GstElement *from;
int i; int i;
@ -32,20 +33,20 @@ construct_pipeline (GstElement *pipeline, gint identities)
} }
gst_element_connect (identity, sink); gst_element_connect (identity, sink);
g_object_set (G_OBJECT (src), "num_buffers", 2, "sizetype", 3, NULL); g_object_set (G_OBJECT (src), "num_buffers", 1, "sizetype", 3, NULL);
} }
void void
state_changed (GstElement *el, gint arg1, gint arg2, gpointer user_data) state_changed (GstElement *el, gint arg1, gint arg2, gpointer user_data)
{ {
GstElementState state = gst_element_get_state (el); GstElementState state = gst_element_get_state (el);
g_print ("element %s has changed state to %s\n", g_print ("element %s has changed state to %s\n",
GST_ELEMENT_NAME (el), GST_ELEMENT_NAME (el),
gst_element_state_get_name (state)); gst_element_state_get_name (state));
if (state == GST_STATE_PLAYING) running = TRUE; if (state == GST_STATE_PLAYING) running = TRUE;
/* if we move from PLAYING to PAUSED, we're done */ /* if we move from PLAYING to PAUSED, we're done */
if (state == GST_STATE_PAUSED && running) if (state == GST_STATE_PAUSED && running)
{ {
while (!can_quit) ; while (!can_quit) ;
can_quit = FALSE; can_quit = FALSE;
@ -61,10 +62,10 @@ main (gint argc, gchar *argv[])
int i; int i;
gulong id; gulong id;
GstElement *thread; GstElement *thread;
gst_init (&argc, &argv); gst_init (&argc, &argv);
for (i = 0; i < runs; ++i) for (i = 90; i < runs; ++i)
{ {
thread = gst_thread_new ("main_thread"); thread = gst_thread_new ("main_thread");
g_assert (thread); g_assert (thread);
@ -81,7 +82,7 @@ main (gint argc, gchar *argv[])
else { else {
g_print ("Going into the main GStreamer loop\n"); g_print ("Going into the main GStreamer loop\n");
can_quit = TRUE; /* we don't want gst_main_quit called before gst_main */ can_quit = TRUE; /* we don't want gst_main_quit called before gst_main */
gst_main (); gst_main ();
} }
running = FALSE; running = FALSE;
g_print ("Coming out of the main GStreamer loop\n"); g_print ("Coming out of the main GStreamer loop\n");

View file

@ -16,7 +16,8 @@ gboolean done = FALSE;
static void static void
construct_pipeline (GstElement *pipeline, gint identities) construct_pipeline (GstElement *pipeline, gint identities)
{ {
GstElement *src, *sink, *identity; GstElement *src, *sink;
GstElement *identity = NULL;
GstElement *from; GstElement *from;
int i; int i;
@ -49,7 +50,7 @@ thread (void)
int i; int i;
GstElement *pipeline; GstElement *pipeline;
for (i = 50; i < runs; ++i) for (i = 30; i < runs; ++i)
{ {
pipeline = gst_pipeline_new ("main_pipeline"); pipeline = gst_pipeline_new ("main_pipeline");
g_assert (pipeline); g_assert (pipeline);