mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
517f0b5cc9
Original commit message from CVS: Added a simple thread state change app.
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
#include <gst/gst.h>
|
|
|
|
int
|
|
main (int argc, gchar *argv[])
|
|
{
|
|
GstElement *pipeline;
|
|
GstElement *fakesrc, *fakesink, *identity;
|
|
GstElement *queue, *thread;
|
|
|
|
gst_init (&argc, &argv);
|
|
|
|
pipeline = gst_pipeline_new ("main");
|
|
g_assert (pipeline != NULL);
|
|
|
|
queue = gst_elementfactory_make ("queue", "queue");
|
|
g_assert (queue);
|
|
thread = gst_elementfactory_make ("thread", "thread");
|
|
g_assert (thread);
|
|
fakesrc = gst_elementfactory_make ("fakesrc", "fakesrc");
|
|
g_assert (fakesrc);
|
|
fakesink = gst_elementfactory_make ("fakesink", "fakesink");
|
|
g_assert (fakesink);
|
|
identity = gst_elementfactory_make ("identity", "identity");
|
|
g_assert (identity);
|
|
|
|
gst_bin_add (GST_BIN (pipeline), fakesrc);
|
|
gst_bin_add (GST_BIN (pipeline), identity);
|
|
gst_bin_add (GST_BIN (pipeline), queue);
|
|
|
|
gst_bin_add (GST_BIN (thread), fakesink);
|
|
gst_bin_add (GST_BIN (pipeline), thread);
|
|
|
|
gst_element_connect (fakesrc, "src", identity, "sink");
|
|
gst_element_connect (identity, "src", queue, "sink");
|
|
gst_element_connect (queue, "src", fakesink, "sink");
|
|
|
|
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
|
|
|
gst_bin_iterate (GST_BIN (pipeline));
|
|
|
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
|
|
|
return 0;
|
|
}
|