mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 04:22:27 +00:00
Added a simple thread state change app.
Original commit message from CVS: Added a simple thread state change app.
This commit is contained in:
parent
34fd63e2bf
commit
517f0b5cc9
3 changed files with 49 additions and 3 deletions
|
@ -2,7 +2,7 @@ SUBDIRS = sched eos nego muxing
|
|||
|
||||
noinst_PROGRAMS = init loadall simplefake states caps queue registry \
|
||||
paranoia rip mp3encode autoplug props case4 markup load tee autoplug2 autoplug3 \
|
||||
capsconnect padfactory autoplug4 incsched reaping threadlock mp1vid reconnect
|
||||
capsconnect padfactory autoplug4 incsched reaping threadlock mp1vid reconnect faketest
|
||||
|
||||
# we have nothing but apps here, we can do this safely
|
||||
LIBS += $(GST_LIBS)
|
||||
|
|
44
tests/faketest.c
Normal file
44
tests/faketest.c
Normal file
|
@ -0,0 +1,44 @@
|
|||
#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;
|
||||
}
|
|
@ -32,12 +32,14 @@ main(int argc,char *argv[])
|
|||
g_return_val_if_fail (src != NULL, 2);
|
||||
tee = gst_elementfactory_make ("tee", "tee");
|
||||
g_return_val_if_fail (tee != NULL, 3);
|
||||
identity1 = gst_elementfactory_make ("identity", "identity1");
|
||||
identity1 = gst_elementfactory_make ("identity", "identity0");
|
||||
g_return_val_if_fail (identity1 != NULL, 3);
|
||||
identity2 = gst_elementfactory_make ("identity", "identity2");
|
||||
identity2 = gst_elementfactory_make ("identity", "identity1");
|
||||
g_object_set (G_OBJECT (identity2), "duplicate", 2, NULL);
|
||||
g_object_set (G_OBJECT (identity2), "loop_based", TRUE, NULL);
|
||||
g_return_val_if_fail (identity2 != NULL, 3);
|
||||
aggregator = gst_elementfactory_make ("aggregator", "aggregator");
|
||||
g_object_set (G_OBJECT (aggregator), "sched", 3, NULL);
|
||||
g_return_val_if_fail (aggregator != NULL, 3);
|
||||
sink = gst_elementfactory_make ("fakesink", "sink");
|
||||
g_return_val_if_fail (sink != NULL, 4);
|
||||
|
|
Loading…
Reference in a new issue