mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-26 18:20:44 +00:00
9f06376bab
Original commit message from CVS: * docs/design/part-events.txt: Small update. * gst/base/gstbasesink.c: (gst_base_sink_handle_object), (gst_base_sink_do_sync), (gst_base_sink_activate_push), (gst_base_sink_activate_pull): Some more comments. * gst/elements/gstfakesrc.c: (gst_fake_src_class_init), (gst_fake_src_create): Fix handoff marshall. * gst/elements/gstidentity.c: (gst_identity_class_init), (gst_identity_transform_ip): We're a real inplace element. * gst/gstbus.c: (gst_bus_post): Added some comments. * tests/lat.c: (fakesrc), (fakesink), (simple), (queue), (main): * tests/muxing/case1.c: (main): * tests/sched/dynamic-pipeline.c: (main): * tests/sched/interrupt1.c: (main): * tests/sched/interrupt2.c: (main): * tests/sched/interrupt3.c: (main): * tests/sched/runxml.c: (main): * tests/sched/sched-stress.c: (main): * tests/seeking/seeking1.c: (event_received), (main): * tests/threadstate/threadstate2.c: (bus_handler), (timeout_func), (main): * tests/threadstate/threadstate3.c: (main): * tests/threadstate/threadstate4.c: (main): * tests/threadstate/threadstate5.c: (main): Fix the tests.
90 lines
2 KiB
C
90 lines
2 KiB
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <gst/gst.h>
|
|
|
|
static guint outcount, incount;
|
|
|
|
static void
|
|
buffer_handoff_sink (GstElement * src, GstBuffer * buf, GstElement * bin)
|
|
{
|
|
g_print ("\n\n *** buffer arrived in sink ***\n\n");
|
|
gst_element_set_state (bin, GST_STATE_NULL);
|
|
|
|
outcount++;
|
|
}
|
|
|
|
static void
|
|
buffer_handoff_src (GstElement * src, GstBuffer * buf, GstElement * bin)
|
|
{
|
|
g_print ("\n\n *** buffer started in src ***\n\n");
|
|
incount++;
|
|
}
|
|
|
|
/* eos will be called when the src element has an end of stream */
|
|
void
|
|
eos (GstElement * element, gpointer data)
|
|
{
|
|
g_print ("have eos, quitting\n");
|
|
}
|
|
|
|
int
|
|
main (int argc, char *argv[])
|
|
{
|
|
GstXML *xml;
|
|
GList *toplevelelements;
|
|
gint i = 1;
|
|
|
|
gst_init (&argc, &argv);
|
|
|
|
if (argc < 2) {
|
|
g_print ("usage: %s <xml file>\n", argv[0]);
|
|
exit (-1);
|
|
}
|
|
|
|
g_print ("\n *** using testfile %s\n", argv[1]);
|
|
|
|
xml = gst_xml_new ();
|
|
gst_xml_parse_file (xml, argv[1], NULL);
|
|
|
|
toplevelelements = gst_xml_get_topelements (xml);
|
|
|
|
while (toplevelelements) {
|
|
GstElement *bin = (GstElement *) toplevelelements->data;
|
|
GstElement *src, *sink;
|
|
|
|
g_print ("\n ***** testcase %d\n", i++);
|
|
|
|
src = gst_bin_get_by_name (GST_BIN (bin), "fakesrc");
|
|
if (src) {
|
|
g_signal_connect (G_OBJECT (src), "handoff",
|
|
G_CALLBACK (buffer_handoff_src), bin);
|
|
} else {
|
|
g_print ("could not find src element\n");
|
|
exit (-1);
|
|
}
|
|
|
|
sink = gst_bin_get_by_name (GST_BIN (bin), "fakesink");
|
|
if (sink) {
|
|
g_signal_connect (G_OBJECT (sink), "handoff",
|
|
G_CALLBACK (buffer_handoff_sink), bin);
|
|
} else {
|
|
g_print ("could not find sink element\n");
|
|
exit (-1);
|
|
}
|
|
|
|
incount = 0;
|
|
outcount = 0;
|
|
|
|
/* gst_element_set_state(bin, GST_STATE_READY); */
|
|
gst_element_set_state (bin, GST_STATE_PLAYING);
|
|
|
|
if (outcount != 1 && incount != 1) {
|
|
g_print ("test failed\n");
|
|
exit (-1);
|
|
}
|
|
|
|
toplevelelements = g_list_next (toplevelelements);
|
|
}
|
|
|
|
exit (0);
|
|
}
|