From 78adfea0f0d780421788543fe50fef7990f5717f Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Wed, 30 Nov 2005 13:08:08 +0000 Subject: [PATCH] First pass at cleaning up tests/ dir before moving the rest Original commit message from CVS: * configure.ac: * tests/bench-complexity.scm: * tests/bench-mass_elements.scm: * tests/complexity.c: * tests/complexity.gnuplot: * tests/instantiate/.cvsignore: * tests/instantiate/Makefile.am: * tests/instantiate/caps.c: * tests/mass_elements.c: * tests/network-clock-utils.scm: * tests/network-clock.scm: * tests/plot-data: First pass at cleaning up tests/ dir before moving the rest Combined with CVS surgery --- ChangeLog | 47 ++ configure.ac | 4 - tests/bench-complexity.scm | 69 --- tests/bench-mass_elements.scm | 68 --- tests/complexity.c | 134 ----- tests/complexity.gnuplot | 9 - tests/instantiate/.gitignore | 14 - tests/instantiate/Makefile.am | 4 - tests/instantiate/caps.c | 80 --- tests/mass_elements.c | 112 ---- tests/network-clock-utils.scm | 229 -------- tests/network-clock.scm | 205 ------- tests/plot-data | 81 --- tests/sched/.gitignore | 18 - tests/sched/Makefile.am | 12 - tests/sched/cases/(fs-fs).xml | 79 --- tests/sched/cases/(fs-i-fs).xml | 235 -------- tests/sched/cases/(fs-i-i-fs).xml | 627 -------------------- tests/sched/cases/(fs-i-q[i-fs]).xml | 107 ---- tests/sched/dynamic-pipeline.c | 64 -- tests/sched/interrupt1.c | 35 -- tests/sched/interrupt2.c | 38 -- tests/sched/interrupt3.c | 42 -- tests/sched/runtestcases | 15 - tests/sched/runxml.c | 90 --- tests/sched/sched-stress.c | 27 - tests/sched/sort.c | 160 ----- tests/sched/testcases | 1060 ---------------------------------- tests/sched/testcases1.tc | 18 - tests/seeking/.gitignore | 12 - tests/seeking/Makefile.am | 4 - tests/seeking/seeking1.c | 104 ---- tests/threadstate/.gitignore | 18 - tests/threadstate/Makefile.am | 4 - tests/threadstate/test1.c | 104 ---- tests/threadstate/test2.c | 108 ---- tests/threadstate/threadstate1.c | 41 -- tests/threadstate/threadstate2.c | 90 --- tests/threadstate/threadstate3.c | 44 -- tests/threadstate/threadstate4.c | 52 -- tests/threadstate/threadstate5.c | 52 -- 41 files changed, 47 insertions(+), 4269 deletions(-) delete mode 100755 tests/bench-complexity.scm delete mode 100755 tests/bench-mass_elements.scm delete mode 100644 tests/complexity.c delete mode 100644 tests/complexity.gnuplot delete mode 100644 tests/instantiate/.gitignore delete mode 100644 tests/instantiate/Makefile.am delete mode 100644 tests/instantiate/caps.c delete mode 100644 tests/mass_elements.c delete mode 100644 tests/network-clock-utils.scm delete mode 100755 tests/network-clock.scm delete mode 100755 tests/plot-data delete mode 100644 tests/sched/.gitignore delete mode 100644 tests/sched/Makefile.am delete mode 100644 tests/sched/cases/(fs-fs).xml delete mode 100644 tests/sched/cases/(fs-i-fs).xml delete mode 100644 tests/sched/cases/(fs-i-i-fs).xml delete mode 100644 tests/sched/cases/(fs-i-q[i-fs]).xml delete mode 100644 tests/sched/dynamic-pipeline.c delete mode 100644 tests/sched/interrupt1.c delete mode 100644 tests/sched/interrupt2.c delete mode 100644 tests/sched/interrupt3.c delete mode 100755 tests/sched/runtestcases delete mode 100644 tests/sched/runxml.c delete mode 100644 tests/sched/sched-stress.c delete mode 100644 tests/sched/sort.c delete mode 100644 tests/sched/testcases delete mode 100644 tests/sched/testcases1.tc delete mode 100644 tests/seeking/.gitignore delete mode 100644 tests/seeking/Makefile.am delete mode 100644 tests/seeking/seeking1.c delete mode 100644 tests/threadstate/.gitignore delete mode 100644 tests/threadstate/Makefile.am delete mode 100644 tests/threadstate/test1.c delete mode 100644 tests/threadstate/test2.c delete mode 100644 tests/threadstate/threadstate1.c delete mode 100644 tests/threadstate/threadstate2.c delete mode 100644 tests/threadstate/threadstate3.c delete mode 100644 tests/threadstate/threadstate4.c delete mode 100644 tests/threadstate/threadstate5.c diff --git a/ChangeLog b/ChangeLog index fc66986..24caaae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,52 @@ 2005-11-30 Thomas Vander Stichele + * docs/gst/gstreamer-sections.txt: + * tests/sched/.cvsignore: + * tests/sched/Makefile.am: + * tests/sched/cases/(fs-fs).xml: + * tests/sched/cases/(fs-i-fs).xml: + * tests/sched/cases/(fs-i-i-fs).xml: + * tests/sched/cases/(fs-i-q[i-fs]).xml: + * tests/sched/dynamic-pipeline.c: + * tests/sched/interrupt1.c: + * tests/sched/interrupt2.c: + * tests/sched/interrupt3.c: + * tests/sched/runtestcases: + * tests/sched/runxml.c: + * tests/sched/sched-stress.c: + * tests/sched/sort.c: + * tests/sched/testcases: + * tests/sched/testcases1.tc: + * tests/seeking/.cvsignore: + * tests/seeking/Makefile.am: + * tests/seeking/seeking1.c: + * tests/threadstate/.cvsignore: + * tests/threadstate/Makefile.am: + * tests/threadstate/test1.c: + * tests/threadstate/test2.c: + * tests/threadstate/threadstate1.c: + * tests/threadstate/threadstate2.c: + * tests/threadstate/threadstate3.c: + * tests/threadstate/threadstate4.c: + * tests/threadstate/threadstate5.c: + remove obsolete tests + * configure.ac: + * tests/bench-complexity.scm: + * tests/bench-mass_elements.scm: + * tests/complexity.c: + * tests/complexity.gnuplot: + * tests/instantiate/.cvsignore: + * tests/instantiate/Makefile.am: + * tests/instantiate/caps.c: + * tests/mass_elements.c: + * tests/network-clock-utils.scm: + * tests/network-clock.scm: + * tests/plot-data: + First pass at cleaning up tests/ dir before moving the rest + Combined with CVS surgery + +2005-11-30 Thomas Vander Stichele + * po/POTFILES.in: queue has moved, update diff --git a/configure.ac b/configure.ac index a96f997..c8d0723 100644 --- a/configure.ac +++ b/configure.ac @@ -487,10 +487,6 @@ plugins/elements/Makefile po/Makefile.in check/Makefile tests/Makefile -tests/instantiate/Makefile -tests/seeking/Makefile -tests/sched/Makefile -tests/threadstate/Makefile testsuite/Makefile testsuite/caps/Makefile testsuite/debug/Makefile diff --git a/tests/bench-complexity.scm b/tests/bench-complexity.scm deleted file mode 100755 index 985d0ae..0000000 --- a/tests/bench-complexity.scm +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/bash -# -*- scheme -*- -exec guile -s $0 "$@" -!# - -;; Quick hack to make some data files that gnuplot can read from -;; complexity. Guile 1.6. - -(use-modules (srfi srfi-13) - (srfi srfi-1) - (ice-9 optargs) - (ice-9 popen)) - -(define *phases* '(create set run destroy)) - -(define (read-lines port) - (let lp ((lines '())) - (let ((x (read-line port))) - (if (eof-object? x) - (begin - (close-port port) - (reverse! lines)) - (lp (cons x lines)))))) - -(define (parse-time str) - (and (char-numeric? (string-ref str 0)) - (fold (lambda (x ret) (+ (* ret 60) x)) 0 - (map (lambda (x) (with-input-from-string x read)) - (string-split str #\:))))) - -(define (run-test program . args) - (format #t "; running test: ~a\n" (cons program args)) - (map - cons - *phases* - (filter-map - parse-time - (read-lines - (open-input-pipe - (string-join (map object->string (cons program args)) " ")))))) - -(define (seq start stop step) - (let lp ((n start) (out '())) - (if (> n stop) - (reverse! out) - (lp (+ n step) (cons n out))))) - -(define (run-tests n-elements) - (let lp ((x 1) (out '())) - (if (> x n-elements) - (reverse! out) - (lp (* x 2) - (acons x (run-test "./complexity" x n-elements) out))))) - -(define (output-results results) - (let ((p (open-output-file "complexity.data"))) - (display "#complexity creation state-change run destroy\n" p) - (for-each - (lambda (line) - (display (car line) p) - (for-each - (lambda (t) (format p " ~a" t)) - (map cdr (cdr line))) - (newline p)) - results) - (close-port p))) - -(output-results - (apply run-tests (map string->number (cdr (program-arguments))))) diff --git a/tests/bench-mass_elements.scm b/tests/bench-mass_elements.scm deleted file mode 100755 index b9ae128..0000000 --- a/tests/bench-mass_elements.scm +++ /dev/null @@ -1,68 +0,0 @@ -#!/bin/bash -# -*- scheme -*- -exec guile -s $0 "$@" -!# - -;; Quick hack to make some data files that gnuplot can read from -;; mass-elements. Guile 1.6. - -(use-modules (srfi srfi-13) - (srfi srfi-1) - (ice-9 optargs) - (ice-9 popen)) - -(define *phases* '(create set run destroy)) - -(define (read-lines port) - (let lp ((lines '())) - (let ((x (read-line port))) - (if (eof-object? x) - (begin - (close-port port) - (reverse! lines)) - (lp (cons x lines)))))) - -(define (run-test n-identities) - (format #t "; running test: ~a\n" n-identities) - (let lp ((in (read-lines - (open-input-pipe - (format #f "./mass_elements ~A" - (number->string n-identities))))) - (out '())) - (if (null? in) - (begin - (or (eq? (length out) 4) (error "Invalid mass_elements output")) - (map cons *phases* (reverse! out))) - (let ((line (car in))) - (if (eqv? (string-ref line 0) #\*) - (lp (cdr in) out) - (lp (cdr in) - (cons (fold (lambda (x ret) (+ (* ret 60) x)) 0 - (map (lambda (x) (with-input-from-string x read)) - (string-split line #\:))) - out))))))) - -(define (run-tests start stop step) - (let lp ((n start) (out '())) - (if (> n stop) - (reverse! out) - (lp (+ n step) - (acons n (run-test n) out))))) - -(define (output-results results) - (let ((p (open-output-file "mass_elements.data"))) - (display "#num_identities creation state-change run destroy\n" p) - (let lp ((in results)) - (if (not (null? in)) - (let* ((line (car in)) - (n (car line))) - (display n p) - (for-each - (lambda (t) (format p " ~a" t)) - (map cdr (cdr line))) - (newline p) - (lp (cdr in))))) - (close-port p))) - -(output-results - (apply run-tests (map string->number (cdr (program-arguments))))) diff --git a/tests/complexity.c b/tests/complexity.c deleted file mode 100644 index 96fcd16..0000000 --- a/tests/complexity.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (C) 2004 Benjamin Otte - * Copyright (C) 2005 Andy Wingo - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include - -#define BUFFER_COUNT (1000) -#define SRC_ELEMENT "fakesrc" -#define SINK_ELEMENT "fakesink" - - -static GstClockTime -gst_get_current_time (void) -{ - GTimeVal tv; - - g_get_current_time (&tv); - return GST_TIMEVAL_TO_TIME (tv); -} - -gint -main (gint argc, gchar * argv[]) -{ - GstElement *pipeline, *src, *e; - GSList *saved_src_list, *src_list, *new_src_list; - guint complexity_order, n_elements, i, j, max_this_level; - GstClockTime start, end; - gboolean all_srcs_linked; - - gst_init (&argc, &argv); - - if (argc != 3) { - g_print ("usage: %s COMPLEXITY_ORDER N_ELEMENTS\n", argv[0]); - return 1; - } - - complexity_order = atoi (argv[1]); - n_elements = atoi (argv[2]); - - start = gst_get_current_time (); - - pipeline = gst_element_factory_make ("pipeline", NULL); - g_assert (pipeline); - - e = gst_element_factory_make ("fakesrc", NULL); - g_object_set (e, "num-buffers", BUFFER_COUNT, NULL); - g_object_set (e, "silent", TRUE, NULL); - gst_bin_add (GST_BIN (pipeline), e); - src_list = saved_src_list = g_slist_append (NULL, e); - - new_src_list = NULL; - - max_this_level = 1; - j = 0; - i = 0; - all_srcs_linked = FALSE; - for (i = 0, j = 0; i < n_elements; i++, j++) { - if (j >= max_this_level) { - g_slist_free (saved_src_list); - saved_src_list = g_slist_reverse (new_src_list); - new_src_list = NULL; - j = 0; - all_srcs_linked = FALSE; - max_this_level *= complexity_order; - } - - if (!src_list) { - if (j) - all_srcs_linked = TRUE; - src_list = saved_src_list; - } - - src = (GstElement *) src_list->data; - src_list = src_list->next; - - if (i + max_this_level < n_elements) { - e = gst_element_factory_make ("tee", NULL); - } else { - e = gst_element_factory_make ("fakesink", NULL); - g_object_set (e, "preroll-queue-len", 1, NULL); - } - g_object_set (e, "silent", TRUE, NULL); - new_src_list = g_slist_prepend (new_src_list, e); - - gst_bin_add (GST_BIN (pipeline), e); - if (!gst_element_link (src, e)) - g_assert_not_reached (); - } - - g_slist_free (saved_src_list); - g_slist_free (new_src_list); - - end = gst_get_current_time (); - g_print ("%" GST_TIME_FORMAT " - creating and linking %d elements\n", - GST_TIME_ARGS (end - start), i); - - start = gst_get_current_time (); - if (gst_element_set_state (pipeline, - GST_STATE_PLAYING) != GST_STATE_CHANGE_SUCCESS) - g_assert_not_reached (); - end = gst_get_current_time (); - g_print ("%" GST_TIME_FORMAT " - setting pipeline to playing\n", - GST_TIME_ARGS (end - start)); - - start = gst_get_current_time (); - gst_bus_poll (gst_element_get_bus (pipeline), - GST_MESSAGE_EOS | GST_MESSAGE_ERROR, -1); - end = gst_get_current_time (); - g_print ("%" GST_TIME_FORMAT " - putting %u buffers through\n", - GST_TIME_ARGS (end - start), BUFFER_COUNT); - - start = gst_get_current_time (); - g_object_unref (pipeline); - end = gst_get_current_time (); - g_print ("%" GST_TIME_FORMAT " - unreffing pipeline\n", - GST_TIME_ARGS (end - start)); - - return 0; -} diff --git a/tests/complexity.gnuplot b/tests/complexity.gnuplot deleted file mode 100644 index 5cb1a33..0000000 --- a/tests/complexity.gnuplot +++ /dev/null @@ -1,9 +0,0 @@ -set terminal postscript landscape monochrome dashed "Helvetica" 14 -set xlabel "Number of Forks Per Tee" -set ylabel "Seconds" -set logscale x -set title "Complex Pipeline Performance: N Forks per Tee, 1024 Elements" -plot "complexity.data" using 1:2 title "Element creation", \ - "complexity.data" using 1:3 title "State change", \ - "complexity.data" using 1:4 title "Processing 1000 buffers", \ - "complexity.data" using 1:5 title "Element destruction" diff --git a/tests/instantiate/.gitignore b/tests/instantiate/.gitignore deleted file mode 100644 index f497959..0000000 --- a/tests/instantiate/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -Makefile -Makefile.in -*.o -*.lo -*.la -.deps -.libs - -*.bb -*.bbg -*.da - -caps -create diff --git a/tests/instantiate/Makefile.am b/tests/instantiate/Makefile.am deleted file mode 100644 index 3f53e72..0000000 --- a/tests/instantiate/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -noinst_PROGRAMS = caps - -LDADD = $(GST_OBJ_LIBS) -AM_CFLAGS = $(GST_OBJ_CFLAGS) diff --git a/tests/instantiate/caps.c b/tests/instantiate/caps.c deleted file mode 100644 index 98187ad..0000000 --- a/tests/instantiate/caps.c +++ /dev/null @@ -1,80 +0,0 @@ -/* GStreamer - * Copyright (C) 2005 Andy Wingo - * - * caps.c: benchmark for caps creation and destruction - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - - -#include - - -#define NUM_CAPS 10000 - - -#define GST_AUDIO_INT_PAD_TEMPLATE_CAPS \ - "audio/x-raw-int, " \ - "rate = (int) [ 1, MAX ], " \ - "channels = (int) [ 1, MAX ], " \ - "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " \ - "width = (int) { 8, 16, 24, 32 }, " \ - "depth = (int) [ 1, 32 ], " \ - "signed = (boolean) { true, false }" - - -static GstClockTime -gst_get_current_time (void) -{ - GTimeVal tv; - - g_get_current_time (&tv); - return GST_TIMEVAL_TO_TIME (tv); -} - - -gint -main (gint argc, gchar * argv[]) -{ - GstCaps **capses; - GstCaps *protocaps; - GstClockTime start, end; - gint i; - - gst_init (&argc, &argv); - - protocaps = gst_caps_from_string (GST_AUDIO_INT_PAD_TEMPLATE_CAPS); - - start = gst_get_current_time (); - capses = g_new (GstCaps *, NUM_CAPS); - for (i = 0; i < NUM_CAPS; i++) - capses[i] = gst_caps_copy (protocaps); - end = gst_get_current_time (); - g_print ("%" GST_TIME_FORMAT " - creating %d caps\n", - GST_TIME_ARGS (end - start), i); - - start = gst_get_current_time (); - for (i = 0; i < NUM_CAPS; i++) - gst_caps_unref (capses[i]); - end = gst_get_current_time (); - g_print ("%" GST_TIME_FORMAT " - destroying %d caps\n", - GST_TIME_ARGS (end - start), i); - - g_free (capses); - gst_caps_unref (protocaps); - - return 0; -} diff --git a/tests/mass_elements.c b/tests/mass_elements.c deleted file mode 100644 index 2d4d0c5..0000000 --- a/tests/mass_elements.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (C) 2004 Benjamin Otte - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include - -#define IDENTITY_COUNT (1000) -#define BUFFER_COUNT (1000) -#define SRC_ELEMENT "fakesrc" -#define SINK_ELEMENT "fakesink" - - -static GstClockTime -gst_get_current_time (void) -{ - GTimeVal tv; - - g_get_current_time (&tv); - return GST_TIMEVAL_TO_TIME (tv); -} - -gint -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); - - if (argc > 1) - 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: %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 (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 (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 (); - last = current; - } - if (!gst_element_link (last, sink)) - g_assert_not_reached (); - end = gst_get_current_time (); - g_print ("%" GST_TIME_FORMAT " - creating %u identity elements\n", - GST_TIME_ARGS (end - start), identities); - - start = gst_get_current_time (); - if (gst_element_set_state (pipeline, - GST_STATE_PLAYING) != GST_STATE_CHANGE_SUCCESS) - g_assert_not_reached (); - end = gst_get_current_time (); - g_print ("%" GST_TIME_FORMAT " - setting pipeline to playing\n", - GST_TIME_ARGS (end - start)); - - start = gst_get_current_time (); - gst_bus_poll (gst_element_get_bus (pipeline), - GST_MESSAGE_EOS | GST_MESSAGE_ERROR, -1); - end = gst_get_current_time (); - g_print ("%" GST_TIME_FORMAT " - putting %u buffers through\n", - GST_TIME_ARGS (end - start), buffers); - - start = gst_get_current_time (); - g_object_unref (pipeline); - end = gst_get_current_time (); - g_print ("%" GST_TIME_FORMAT " - unreffing pipeline\n", - GST_TIME_ARGS (end - start)); - - return 0; -} diff --git a/tests/network-clock-utils.scm b/tests/network-clock-utils.scm deleted file mode 100644 index 174b5f7..0000000 --- a/tests/network-clock-utils.scm +++ /dev/null @@ -1,229 +0,0 @@ -;; GStreamer -;; Copyright (C) 2005 Andy Wingo - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2 of -;; the License, or (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, contact: -;; -;; Free Software Foundation Voice: +1-617-542-5942 -;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652 -;; Boston, MA 02111-1307, USA gnu@gnu.org - - -;;; Commentary: -;; -;; Utilities for the network clock simulator. -;; -;;; Code: - - -;; Init the rng. - -(use-modules ((srfi srfi-1) (fold unfold))) - -(define (read-bytes-from-file-as-integer f n) - (with-input-from-file f - (lambda () - (fold (lambda (x seed) (+ x (ash seed 8))) - 0 - (unfold zero? (lambda (n) (char->integer (read-char))) 1- n))))) - -(set! *random-state* (seed->random-state - (read-bytes-from-file-as-integer "/dev/random" 4))) - -;; General utilities. - -(define (iround x) - (if (inexact? x) - (inexact->exact (round x)) - x)) - -(define (filter proc l) - (cond - ((null? l) '()) - ((proc (car l)) (cons (car l) (filter proc (cdr l)))) - (else (filter proc (cdr l))))) - -(define (sum l) - (apply + l)) - -(define (avg . nums) - (/ (sum nums) (length nums))) - -(define (sq x) - (* x x)) - -(define (debug str . args) - (if *debug* - (apply format (current-error-port) str args))) - -(define (print-event kind x y) - (format #t "~a ~a ~a\n" kind x y)) - -;; Linear least squares. -;; -;; See http://mathworld.wolfram.com/LeastSquaresFitting.html -;; returns (values slope intercept r-squared) - -(define (least-squares x y) - (let ((n (length x))) - (let ((xbar (apply avg x)) - (ybar (apply avg y))) - (let ((sxx (- (sum (map sq x)) (* n (sq xbar)))) - (syy (- (sum (map sq y)) (* n (sq ybar)))) - (sxy (- (sum (map * x y)) (* n xbar ybar)))) - (let ((slope (/ sxy sxx))) - (values - slope - (- ybar (* slope xbar)) - (/ (sq sxy) (* sxx syy)))))))) - -;; Streams: lists with lazy cdrs. - -(define-macro (stream-cons kar kdr) - `(cons ,kar (delay ,kdr))) - -(define (stream-cdr stream) - (force (cdr stream))) - -(define (stream-car stream) - (car stream)) - -(define (stream-null? stream) - (null? stream)) - -(define (stream-ref stream n) - (if (zero? n) - (stream-car stream) - (stream-ref (stream-cdr stream) (1- n)))) - -(define (stream->list stream n) - (let lp ((in stream) (out '()) (n n)) - (if (zero? n) - (reverse! out) - (lp (stream-cdr in) (cons (stream-car in) out) (1- n))))) - -(define (stream-skip stream n) - (if (zero? n) - stream - (stream-skip (stream-cdr stream) (1- n)))) - -(define (stream-sample stream n) - (stream-cons (stream-car stream) - (stream-sample (stream-skip stream n) n))) - -(define (stream-map proc . streams) - (stream-cons (apply proc (map stream-car streams)) - (apply stream-map proc (map stream-cdr streams)))) - -(define (arithmetic-series start step) - (stream-cons start (arithmetic-series (+ start step) step))) - -(define (scale-stream stream factor) - (stream-map (lambda (t) (* t factor)) stream)) - -(define (stream-while pred proc . streams) - (if (apply pred (map stream-car streams)) - (begin - (apply proc (map stream-car streams)) - (apply stream-while pred proc (map stream-cdr streams))))) - -(define (stream-of val) - (stream-cons val (stream-of val))) - -(define (periodic-stream val period) - (let ((period (iround (max 1 (* *sample-frequency* period))))) - (let lp ((n 0)) - (if (zero? n) - (stream-cons val (lp period)) - (stream-cons #f (lp (1- n))))))) - - -;; Queues with a maximum length. - -(define (make-q l) - (cons l (last-pair l))) - -(define (q-head q) - (car q)) - -(define (q-tail q) - (car q)) - -(define (q-push q val) - (let ((tail (cons val '()))) - (if (null? (q-tail q)) - (make-q tail) - (let ((l (append! (q-head q) tail))) - (if (> (length (q-head q)) *window-size*) - (make-q (cdr (q-head q))) - q))))) - - -;; Parameters, settable via command line arguments. - -(define %parameters '()) -(define-macro (define-parameter name val) - (let ((str (symbol->string name))) - (or (and (eqv? (string-ref str 0) #\*) - (eqv? (string-ref str (1- (string-length str))) #\*)) - (error "Invalid parameter name" name)) - (let ((param (string->symbol - (substring str 1 (1- (string-length str))))) - (val-sym (gensym))) - `(begin - (define ,name #f) - (let ((,val-sym ,val)) - (set! ,name ,val-sym) - (set! %parameters (cons (cons ',param ,val-sym) - %parameters))))))) -(define (set-parameter! name val) - (define (symbol-append . args) - (string->symbol (apply string-append (map symbol->string args)))) - (or (assq name %parameters) - (error "Unknown parameter" name)) - (module-set! (current-module) (symbol-append '* name '*) val)) - -(define (parse-parameter-arguments args) - (define (usage) - (format #t "Usage: ~a ARG1...\n\n" "network-clock.scm") - (for-each - (lambda (pair) - (format #t "\t--~a=VAL \t(default: ~a)\n" (car pair) (cdr pair))) - %parameters)) - (define (unknown-arg arg) - (with-output-to-port (current-error-port) - (lambda () - (format #t "\nUnknown argument: ~a\n\n" arg) - (usage) - (quit)))) - (define (parse-arguments args) - (let lp ((in args) (out '())) - (cond - ((null? in) - (reverse! out)) - ((not (string=? (substring (car in) 0 2) "--")) - (unknown-arg (car in))) - (else - (let ((divider (or (string-index (car in) #\=) - (unknown-arg (car in))))) - (or (> divider 2) (unknown-arg (car in))) - (let ((param (string->symbol (substring (car in) 2 divider))) - (val (with-input-from-string (substring (car in) (1+ divider)) - read))) - (lp (cdr in) (acons param val out)))))))) - (for-each - (lambda (pair) - (or (false-if-exception - (set-parameter! (car pair) (cdr pair))) - (unknown-arg (format #f "--~a=~a" (car pair) (cdr pair))))) - (parse-arguments args))) diff --git a/tests/network-clock.scm b/tests/network-clock.scm deleted file mode 100755 index 10878c6..0000000 --- a/tests/network-clock.scm +++ /dev/null @@ -1,205 +0,0 @@ -#!/bin/bash -# -*- scheme -*- -exec guile --debug -l $0 -e main -- "$@" -!# - -;; GStreamer -;; Copyright (C) 2005 Andy Wingo - -;; This program is free software; you can redistribute it and/or -;; modify it under the terms of the GNU General Public License as -;; published by the Free Software Foundation; either version 2 of -;; the License, or (at your option) any later version. -;; -;; This program is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. -;; -;; You should have received a copy of the GNU General Public License -;; along with this program; if not, contact: -;; -;; Free Software Foundation Voice: +1-617-542-5942 -;; 59 Temple Place - Suite 330 Fax: +1-617-542-2652 -;; Boston, MA 02111-1307, USA gnu@gnu.org - - -;;; Commentary: -;; -;; Network clock simulator. -;; -;; Simulates the attempts of one clock to synchronize with another over -;; the network. Packets are sent out with a local timestamp, and come -;; back with the remote time added on to the packet. The remote time is -;; assumed to have been observed at the local time in between sending -;; the query and receiving the reply. -;; -;; The local clock will attempt to adjust its rate and offset by fitting -;; a line to the last N datapoints on hand, by default 32. A better fit, -;; as measured by the correlation coefficient, will result in a longer -;; time before the next query. Bad fits or a not-yet-full set of data -;; will result in many queries in quick succession. -;; -;; The rate and offset are set directly to the slope and intercept from -;; the linear regression. This results in discontinuities in the local -;; time. As clock times must be monotonically increasing, a jump down in -;; time will result instead in time standing still for a while. Smoothly -;; varying the rate such that no discontinuities are present has not -;; been investigated. -;; -;; Implementation-wise, this simulator processes events and calculates -;; times discretely. Times are represented as streams, also known as -;; lazy lists. This is an almost-pure functional simulator. The thing to -;; remember while reading is that stream-cons does not evaluate its -;; second argument, rather deferring that calculation until stream-cdr -;; is called. In that way all times are actually infinite series. -;; -;; Usage: See network-clock.scm --help. -;; -;;; Code: - - -(use-modules (ice-9 popen)) - - -(load "network-clock-utils.scm") - - -(define (time->samples t) - (iround (* t *sample-frequency*))) - - -(define (schedule-event events e time) - (let lp ((response-time (time->samples time)) - (stream events)) - (if (zero? response-time) - (if (not (stream-car stream)) - (stream-cons e (stream-cdr stream)) - (stream-cons (stream-car stream) (lp 0 (stream-cdr stream)))) - (stream-cons (stream-car stream) (lp (1- response-time) (stream-cdr stream)))))) - -(define (schedule-send-time-query events time) - (schedule-event events (list 'send-time-query) time)) - -(define (schedule-time-query events l) - (schedule-event events (list 'time-query l) - (+ *send-delay* (random *send-jitter*)))) - -(define (schedule-time-response events l r) - (schedule-event events (list 'time-response l r) - (+ *recv-delay* (random *recv-jitter*)))) - -(define (network-time remote-time local-time events m b x y t) - (let ((r (stream-car remote-time)) - (l (stream-car local-time)) - (event (stream-car events)) - (events (stream-cdr events))) - - (define (next events m b x y t) - (stream-cons - (+ (* m l) b) - (network-time - (stream-cdr remote-time) (stream-cdr local-time) events m b x y t))) - - (case (and=> event car) - ((send-time-query) - (cond - ((< (random 1.0) *packet-loss*) - (debug "; dropped time query: ~a\n" l) - (print-event 'packet-lost l (+ (* m l) b)) - (next events m b x y (time->samples *timeout*))) - (else - (debug "; sending time query: ~a\n" l) - (print-event 'packet-sent l (+ (* m l) b)) - (next (schedule-time-query events l) m b x y (time->samples *timeout*))))) - - ((time-query) - (debug "; time query received, replying with ~a\n" r) - (next (schedule-time-response events (cadr event) r) m b x y (and t (1- t)))) - - ((time-response) - (let ((x (q-push x (avg (cadr event) l))) - (y (q-push y (caddr event)))) - (call-with-values - (lambda () (least-squares (q-head x) (q-head y))) - (lambda (m b r-squared) - (define (next-time) - (max - (if (< (length (q-head x)) *window-size*) - 0 - (/ 1 (- 1 (min r-squared 0.99999)) 1000)) - 0.10)) - (debug "; new slope and offset: ~a ~a (~a)\n" m b r-squared) - (print-event 'packet-observed (avg (cadr event) l) (caddr event)) - (print-event 'packet-received l (+ (* m l) b)) - (next (schedule-send-time-query events (next-time)) m b x y #f))))) - - (else - (cond - ((not t) - ;; not waiting for a response - (next events m b x y t)) - ((<= t 0) - ;; we timed out - (next (schedule-send-time-query events 0.0) m b x y 0)) - (else - (next events m b x y (1- t)))))))) - -(define (run-simulation remote-speed local-speed) - (let ((absolute-time (arithmetic-series 0.0 (/ 1.0 *sample-frequency*))) - (event-stream (stream-of #f))) - (let ((remote-time (scale-stream absolute-time remote-speed)) - (local-time (scale-stream absolute-time local-speed))) - (values - absolute-time - remote-time - local-time - (network-time - remote-time - local-time - (schedule-send-time-query event-stream 0.0) - 1.0 - (stream-car local-time) - (make-q (list (stream-car local-time))) - (make-q (list (stream-car remote-time))) - #f))))) - -(define (print-simulation) - (display "Absolute time; Remote time; Local time; Network time\n") - (call-with-values - (lambda () (run-simulation *remote-rate* *local-rate*)) - (lambda streams - (apply - stream-while - (lambda (a r l n) (<= a *total-time*)) - (lambda (a r l n) (format #t "~a ~a ~a ~a\n" a r l n)) - streams)))) - -(define (plot-simulation) - (let ((port (open-output-pipe "./plot-data Network Clock Simulation"))) - (with-output-to-port port - print-simulation) - (close-pipe port))) - - -(define-parameter *sample-frequency* 40) -(define-parameter *send-delay* 0.1) -(define-parameter *recv-delay* 0.1) -(define-parameter *packet-loss* 0.01) -(define-parameter *send-jitter* 0.1) -(define-parameter *recv-jitter* 0.1) -(define-parameter *window-size* 32) -(define-parameter *local-rate* 1.0) -(define-parameter *remote-rate* 1.1) -(define-parameter *total-time* 5.0) -(define-parameter *timeout* 1.0) -(define-parameter *debug* #f) -(define-parameter *with-graph* #t) - - -(define (main args) - (parse-parameter-arguments (cdr args)) - (if *with-graph* - (plot-simulation) - (print-simulation)) - (quit)) diff --git a/tests/plot-data b/tests/plot-data deleted file mode 100755 index 6627a66..0000000 --- a/tests/plot-data +++ /dev/null @@ -1,81 +0,0 @@ -#!/usr/bin/env python - -from __future__ import division - -import pylab -import optparse -import sys - -def parse_data(l, state): - state['data'].append([float(x) for x in filter(None, l.split(' '))]) - return state - -def parse_event(l, state): - components = filter(None, l.split(' ')) - vals = [float(x) for x in components[1:]] - if not components[0] in state: - state[components[0]] = [vals] - else: - state[components[0]].append(vals) - return state - -def read_line(fd, state): - l = fd.readline() - if not l: - return None - l = l.strip() - if l[0].isdigit(): - return parse_data(l, state) - else: - return parse_event(l, state) - -def read_data(fd): - state = {'data':[], - 'packet-sent':[], - 'packet-lost':[], - 'packet-received':[], - 'packet-observed':[]} - newstate = state - while newstate: - state = newstate - newstate = read_line(fd, state) - return state - -def make_xticks(start, end, numticks): - return range(int(start), int(end), int((start-end)/numticks)) - -def make_plot(title): - l = sys.stdin.readline() - labels = l.strip().split(';') - state = read_data(sys.stdin) - data = state['data'] - lost_packets = state['packet-lost'] - obsv_packets = state['packet-observed'] - sent_packets = state['packet-sent'] - recd_packets = state['packet-received'] - - domain = [x[0] for x in data] - for i in range(1,len(labels)): - pylab.plot(domain, [x[i] for x in data], label=labels[i]) - pylab.plot([x[0] for x in lost_packets], [x[1] for x in lost_packets], - label='Client sent packet, but dropped', marker='x', linestyle=None, ms=8) - pylab.plot([x[0] for x in sent_packets], [x[1] for x in sent_packets], - label='Client sent packet', marker='^', linestyle=None, ms=8) - pylab.plot([x[0] for x in obsv_packets], [x[1] for x in obsv_packets], - label='Remote time observation', marker='D', linestyle=None, ms=8) - pylab.plot([x[0] for x in recd_packets], [x[1] for x in recd_packets], - label='Client received packet', marker='v', linestyle=None, ms=8) - pylab.legend() - pylab.ylabel(r'Clock time (s)') - pylab.xlabel(r'Real time (s)') - pylab.title(title) - pylab.grid(True) - pylab.show() - -def main(args): - parser = optparse.OptionParser() - - title = ' '.join(args[1:]) - make_plot(title) - -main(sys.argv) diff --git a/tests/sched/.gitignore b/tests/sched/.gitignore deleted file mode 100644 index f563157..0000000 --- a/tests/sched/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -Makefile -Makefile.in -*.o -*.lo -*.la -.deps -.libs - -runxml -log.txt -dynamic-pipeline -interrupt1 -interrupt2 -interrupt3 -sched-stress -*.bb -*.bbg -*.da diff --git a/tests/sched/Makefile.am b/tests/sched/Makefile.am deleted file mode 100644 index 9230080..0000000 --- a/tests/sched/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -if GST_DISABLE_LOADSAVE -noinst_PROGRAMS = -else -noinst_PROGRAMS = runxml dynamic-pipeline sched-stress interrupt1 interrupt2 interrupt3 sort -endif - -dynamic_pipeline_SOURCES = dynamic-pipeline.c -sched_stress_SOURCES = sched-stress.c -sched_stress_LDADD = $(GST_OBJ_LIBS) #-lefence - -LDADD = $(GST_OBJ_LIBS) -AM_CFLAGS = $(GST_OBJ_CFLAGS) diff --git a/tests/sched/cases/(fs-fs).xml b/tests/sched/cases/(fs-fs).xml deleted file mode 100644 index fa7dc97..0000000 --- a/tests/sched/cases/(fs-fs).xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - new_element - thread - 0.9.2 - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - fakesink.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - fakesrc.src - - - GtkObject::user_data - - - - - - bin2 - bin - 0.9.2 - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - fakesink.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - fakesrc.src - - - GtkObject::user_data - - - - - diff --git a/tests/sched/cases/(fs-i-fs).xml b/tests/sched/cases/(fs-i-fs).xml deleted file mode 100644 index 9171bd9..0000000 --- a/tests/sched/cases/(fs-i-fs).xml +++ /dev/null @@ -1,235 +0,0 @@ - - - - bin1 - bin - 0.9.2 - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - fakesrc.src - - - src - fakesink.sink - - - GstIdentity::loop_based - false - - - GtkObject::user_data - - - - - - bin2 - bin - 0.9.2 - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - fakesrc.src - - - src - fakesink.sink - - - GstIdentity::loop_based - true - - - GtkObject::user_data - - - - - - bin3 - thread - 0.9.2 - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - fakesrc.src - - - src - fakesink.sink - - - GstIdentity::loop_based - false - - - GtkObject::user_data - - - - - - bin4 - thread - 0.9.2 - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - fakesrc.src - - - src - fakesink.sink - - - GstIdentity::loop_based - true - - - GtkObject::user_data - - - - - diff --git a/tests/sched/cases/(fs-i-i-fs).xml b/tests/sched/cases/(fs-i-i-fs).xml deleted file mode 100644 index 2f49604..0000000 --- a/tests/sched/cases/(fs-i-i-fs).xml +++ /dev/null @@ -1,627 +0,0 @@ - - - - bin1 - bin - 0.9.2 - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity1.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity2.src - - - GtkObject::user_data - - - - identity1 - identity - 0.9.2 - - sink - fakesrc.src - - - src - identity2.sink - - - GstIdentity::loop_based - false - - - GtkObject::user_data - - - - identity2 - identity - 0.9.2 - - sink - identity1.src - - - src - fakesink.sink - - - GstIdentity::loop_based - false - - - GtkObject::user_data - - - - - - bin2 - bin - 0.9.2 - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity1.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - identity1 - identity - 0.9.2 - - sink - fakesrc.src - - - src - identity.sink - - - GstIdentity::loop_based - true - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - identity1.src - - - src - fakesink.sink - - - GstIdentity::loop_based - false - - - GtkObject::user_data - - - - - - bin3 - bin - 0.9.2 - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity1.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - identity1 - identity - 0.9.2 - - sink - fakesrc.src - - - src - identity.sink - - - GstIdentity::loop_based - false - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - identity1.src - - - src - fakesink.sink - - - GstIdentity::loop_based - true - - - GtkObject::user_data - - - - - - bin4 - bin - 0.9.2 - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity1.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - identity1 - identity - 0.9.2 - - sink - fakesrc.src - - - src - identity.sink - - - GstIdentity::loop_based - true - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - identity1.src - - - src - fakesink.sink - - - GstIdentity::loop_based - true - - - GtkObject::user_data - - - - - - thread1 - thread - 0.9.2 - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity1.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - identity1 - identity - 0.9.2 - - sink - fakesrc.src - - - src - identity.sink - - - GstIdentity::loop_based - false - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - identity1.src - - - src - fakesink.sink - - - GstIdentity::loop_based - false - - - GtkObject::user_data - - - - - - thread2 - thread - 0.9.2 - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity1.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - identity1 - identity - 0.9.2 - - sink - fakesrc.src - - - src - identity.sink - - - GstIdentity::loop_based - true - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - identity1.src - - - src - fakesink.sink - - - GstIdentity::loop_based - false - - - GtkObject::user_data - - - - - - thread3 - thread - 0.9.2 - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity1.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - identity1 - identity - 0.9.2 - - sink - fakesrc.src - - - src - identity.sink - - - GstIdentity::loop_based - false - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - identity1.src - - - src - fakesink.sink - - - GstIdentity::loop_based - true - - - GtkObject::user_data - - - - - - thread4 - thread - 0.9.2 - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity1.sink - - - GstFakeSrc::num_sources - 1 - - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - identity1 - identity - 0.9.2 - - sink - fakesrc.src - - - src - identity.sink - - - GstIdentity::loop_based - true - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - identity1.src - - - src - fakesink.sink - - - GstIdentity::loop_based - true - - - GtkObject::user_data - - - - - diff --git a/tests/sched/cases/(fs-i-q[i-fs]).xml b/tests/sched/cases/(fs-i-q[i-fs]).xml deleted file mode 100644 index 3d0abdc..0000000 --- a/tests/sched/cases/(fs-i-q[i-fs]).xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - new_element - bin - 0.9.2 - - GtkObject::user_data - - - - thread - thread - 0.9.2 - - GstThread::create_thread - true - - - GtkObject::user_data - - - - identity - identity - 0.9.2 - - sink - queue.src - - - src - fakesink.sink - - - GtkObject::user_data - - - - fakesink - fakesink - 0.9.2 - - sink - identity.src - - - GtkObject::user_data - - - - - - queue - queue - 0.9.2 - - sink - identity1.src - - - src - identity.sink - - - GstQueue::level - 0 - - - GstQueue::max_level - 20 - - - GtkObject::user_data - - - - fakesrc - fakesrc - 0.9.2 - - src - identity1.sink - - - GtkObject::user_data - - - - identity1 - identity - 0.9.2 - - sink - fakesrc.src - - - src - queue.sink - - - GtkObject::user_data - - - - - diff --git a/tests/sched/dynamic-pipeline.c b/tests/sched/dynamic-pipeline.c deleted file mode 100644 index a20a3f9..0000000 --- a/tests/sched/dynamic-pipeline.c +++ /dev/null @@ -1,64 +0,0 @@ -#include - -/* This test will fail because it tries to allocate two cothread_context's in - * one thread. This will cause a segfault. This is a problem with gstreamer's - * cothreading that is fixed in the newer cothreads package. - */ - -int -main (int argc, char *argv[]) -{ - GstElement *fakesrc, *fakesink1, *fakesink2, *pipe1, *pipe2; - - gst_init (&argc, &argv); - - if (argc != 1) { - g_print ("usage: %s\n", argv[0]); - exit (-1); - } - - fakesrc = gst_element_factory_make ("fakesrc", "fakesrc"); - fakesink1 = gst_element_factory_make ("fakesink", "fakesink1"); - fakesink2 = gst_element_factory_make ("fakesink", "fakesink2"); - - /* a crucial part of this test (and one that the old cothreads fails on) is - having two active pipelines in the same thread. */ - pipe1 = gst_pipeline_new ("pipe1"); - pipe2 = gst_pipeline_new ("pipe2"); - - /* make the first pipeline */ - gst_bin_add (GST_BIN (pipe1), fakesrc); - gst_bin_add (GST_BIN (pipe1), fakesink1); - gst_element_link_pads (fakesrc, "src", fakesink1, "sink"); - - /* initialize cothreads */ - gst_element_set_state (pipe1, GST_STATE_PLAYING); - - gst_element_set_state (pipe1, GST_STATE_READY); - - /* destroy the fakesink, but keep fakesrc (its state is GST_STATE_READY) */ - gst_element_unlink_pads (fakesrc, "src", fakesink1, "sink"); - gst_object_ref (fakesrc); - gst_bin_remove (GST_BIN (pipe1), fakesrc); - g_usleep (2 * G_USEC_PER_SEC); - gst_bin_remove (GST_BIN (pipe1), fakesink1); - - gst_object_unref (pipe1); - - /* make a new pipeline */ - gst_bin_add (GST_BIN (pipe2), fakesink2); - - /* don't change the new pipeline's state, it should change on the bin_add */ - gst_bin_add (GST_BIN (pipe2), fakesrc); - gst_element_link_pads (fakesrc, "src", fakesink2, "sink"); - - /* show the pipeline state */ - gst_xml_write_file (GST_ELEMENT (pipe2), stdout); - - /* try to iterate the pipeline */ - gst_element_set_state (pipe2, GST_STATE_PLAYING); - g_usleep (2 * G_USEC_PER_SEC); - gst_element_set_state (pipe2, GST_STATE_NULL); - - return 0; -} diff --git a/tests/sched/interrupt1.c b/tests/sched/interrupt1.c deleted file mode 100644 index b75aa16..0000000 --- a/tests/sched/interrupt1.c +++ /dev/null @@ -1,35 +0,0 @@ -#include - -int -main (int argc, char *argv[]) -{ - GstElement *pipeline, *queue, *src, *sink; - - gst_init (&argc, &argv); - - free (malloc (8)); /* -lefence */ - - pipeline = gst_pipeline_new ("pipeline"); - - src = gst_element_factory_make ("fakesrc", "src"); - - queue = gst_element_factory_make ("queue", "queue"); - sink = gst_element_factory_make ("fakesink", "sink"); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), queue); - gst_bin_add (GST_BIN (pipeline), sink); - - gst_element_link_pads (src, "src", queue, "sink"); - gst_element_link_pads (queue, "src", sink, "sink"); - - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_usleep (G_USEC_PER_SEC); - gst_element_set_state (pipeline, GST_STATE_PAUSED); - - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_usleep (G_USEC_PER_SEC); - gst_element_set_state (pipeline, GST_STATE_PAUSED); - - return 0; -} diff --git a/tests/sched/interrupt2.c b/tests/sched/interrupt2.c deleted file mode 100644 index 8d9667d..0000000 --- a/tests/sched/interrupt2.c +++ /dev/null @@ -1,38 +0,0 @@ -#include - -int -main (int argc, char *argv[]) -{ - GstElement *pipeline, *queue, *src, *identity, *sink; - - gst_init (&argc, &argv); - - free (malloc (8)); /* -lefence */ - - pipeline = gst_pipeline_new ("pipeline"); - - src = gst_element_factory_make ("fakesrc", "src"); - - queue = gst_element_factory_make ("queue", "queue"); - identity = gst_element_factory_make ("identity", "identity"); - sink = gst_element_factory_make ("fakesink", "sink"); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), queue); - gst_bin_add (GST_BIN (pipeline), identity); - gst_bin_add (GST_BIN (pipeline), sink); - - gst_element_link_pads (src, "src", queue, "sink"); - gst_element_link_pads (queue, "src", identity, "sink"); - gst_element_link_pads (identity, "src", sink, "sink"); - - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_usleep (G_USEC_PER_SEC); - gst_element_set_state (pipeline, GST_STATE_PAUSED); - - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_usleep (G_USEC_PER_SEC); - gst_element_set_state (pipeline, GST_STATE_PAUSED); - - return 0; -} diff --git a/tests/sched/interrupt3.c b/tests/sched/interrupt3.c deleted file mode 100644 index c4f9525..0000000 --- a/tests/sched/interrupt3.c +++ /dev/null @@ -1,42 +0,0 @@ -#include - -int -main (int argc, char *argv[]) -{ - GstElement *pipeline, *queue, *src, *adder, *sink; - GstPad *sinkpad; - - gst_init (&argc, &argv); - - free (malloc (8)); /* -lefence */ - - pipeline = gst_pipeline_new ("pipeline"); - - src = gst_element_factory_make ("fakesrc", "src"); - g_object_set (G_OBJECT (src), "sizetype", 2, NULL); - - queue = gst_element_factory_make ("queue", "queue"); - adder = gst_element_factory_make ("adder", "adder"); - sink = gst_element_factory_make ("fakesink", "sink"); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), queue); - gst_bin_add (GST_BIN (pipeline), adder); - gst_bin_add (GST_BIN (pipeline), sink); - - sinkpad = gst_element_get_request_pad (adder, "sink%d"); - - gst_element_link_pads (src, "src", queue, "sink"); - gst_pad_link (gst_element_get_pad (queue, "src"), sinkpad); - gst_element_link_pads (adder, "src", sink, "sink"); - - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_usleep (G_USEC_PER_SEC); - gst_element_set_state (pipeline, GST_STATE_PAUSED); - - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_usleep (G_USEC_PER_SEC); - gst_element_set_state (pipeline, GST_STATE_PAUSED); - - return 0; -} diff --git a/tests/sched/runtestcases b/tests/sched/runtestcases deleted file mode 100755 index c79ee3e..0000000 --- a/tests/sched/runtestcases +++ /dev/null @@ -1,15 +0,0 @@ -#/bin/bash - -echo "log" > log.txt - -for i in cases/*.xml -do - ./runxml $i - error=$? - if test $error -ne 0; - then - echo $i " error," $error >>log.txt - else - echo $i " ok" >>log.txt - fi -done diff --git a/tests/sched/runxml.c b/tests/sched/runxml.c deleted file mode 100644 index e20bfd0..0000000 --- a/tests/sched/runxml.c +++ /dev/null @@ -1,90 +0,0 @@ -#include -#include -#include - -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 \n", argv[0]); - exit (-1); - } - - g_print ("\n *** using testfile %s\n", argv[1]); - - xml = gst_xml_new (); - gst_xml_parse_file (xml, (const guchar *) 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); -} diff --git a/tests/sched/sched-stress.c b/tests/sched/sched-stress.c deleted file mode 100644 index cd8ca53..0000000 --- a/tests/sched/sched-stress.c +++ /dev/null @@ -1,27 +0,0 @@ -#include - -#define TAILLE 100 - -int -main (int argc, char *argv[]) -{ - GstElement *bin, *src, *dec, *sink; - int i; - - gst_init (&argc, &argv); - - free (malloc (8)); /* -lefence */ - - for (i = 0; i < TAILLE; i++) { - bin = gst_pipeline_new ("pipeline"); - src = gst_element_factory_make ("fakesrc", "source"); - dec = gst_element_factory_make ("identity", "decoder"); - sink = gst_element_factory_make ("fakesink", "sink"); - gst_bin_add_many (GST_BIN (bin), src, dec, sink, NULL); - gst_element_link_many (src, dec, sink, NULL); - gst_element_set_state (bin, GST_STATE_PLAYING); - gst_element_set_state (bin, GST_STATE_PAUSED); - } - - return 0; -} diff --git a/tests/sched/sort.c b/tests/sched/sort.c deleted file mode 100644 index b674635..0000000 --- a/tests/sched/sort.c +++ /dev/null @@ -1,160 +0,0 @@ -#include - -static GstElement * -make_pipeline1 () -{ - GstElement *fakesrc, *fakesink; - GstElement *pipeline; - - pipeline = gst_pipeline_new ("pipeline"); - g_assert (pipeline != NULL); - - fakesrc = gst_element_factory_make ("fakesrc", "fake_source"); - g_assert (fakesrc != NULL); - - fakesink = gst_element_factory_make ("fakesink", "fake_sink"); - g_assert (fakesink != NULL); - - gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL); - gst_element_link (fakesrc, fakesink); - - return pipeline; -} - -static GstElement * -make_pipeline2 () -{ - GstElement *fakesrc, *tee, *fakesink1, *fakesink2; - GstElement *pipeline; - - pipeline = gst_pipeline_new ("pipeline"); - g_assert (pipeline != NULL); - - fakesrc = gst_element_factory_make ("fakesrc", "fake_source"); - g_assert (fakesrc != NULL); - - tee = gst_element_factory_make ("tee", "tee"); - g_assert (tee != NULL); - - fakesink1 = gst_element_factory_make ("fakesink", "fake_sink1"); - g_assert (fakesink1 != NULL); - - fakesink2 = gst_element_factory_make ("fakesink", "fake_sink2"); - g_assert (fakesink2 != NULL); - - gst_bin_add_many (GST_BIN (pipeline), fakesrc, tee, fakesink1, fakesink2, - NULL); - gst_element_link (fakesrc, tee); - gst_element_link (tee, fakesink1); - gst_element_link (tee, fakesink2); - - return pipeline; -} - -static GstElement * -make_pipeline3 () -{ - GstElement *fakesrc, *tee, *identity, *fakesink1, *fakesink2; - GstElement *pipeline; - - pipeline = gst_pipeline_new ("pipeline"); - g_assert (pipeline != NULL); - - fakesrc = gst_element_factory_make ("fakesrc", "fake_source"); - g_assert (fakesrc != NULL); - - tee = gst_element_factory_make ("tee", "tee"); - g_assert (tee != NULL); - - identity = gst_element_factory_make ("identity", "identity"); - g_assert (identity != NULL); - - fakesink1 = gst_element_factory_make ("fakesink", "fake_sink1"); - g_assert (fakesink1 != NULL); - - fakesink2 = gst_element_factory_make ("fakesink", "fake_sink2"); - g_assert (fakesink2 != NULL); - - gst_bin_add_many (GST_BIN (pipeline), fakesrc, tee, identity, - fakesink1, fakesink2, NULL); - gst_element_link (fakesrc, tee); - gst_element_link (tee, identity); - gst_element_link (identity, fakesink1); - gst_element_link (tee, fakesink2); - - return pipeline; -} - -static GstElement * -make_pipeline4 () -{ - GstElement *fakesrc, *tee, *identity, *fakesink1, *fakesink2; - GstElement *pipeline; - - pipeline = gst_pipeline_new ("pipeline"); - g_assert (pipeline != NULL); - - fakesrc = gst_element_factory_make ("fakesrc", "fake_source"); - g_assert (fakesrc != NULL); - - tee = gst_element_factory_make ("tee", "tee"); - g_assert (tee != NULL); - - identity = gst_element_factory_make ("identity", "identity"); - g_assert (identity != NULL); - - fakesink1 = gst_element_factory_make ("fakesink", "fake_sink1"); - g_assert (fakesink1 != NULL); - - fakesink2 = gst_element_factory_make ("fakesink", "fake_sink2"); - g_assert (fakesink2 != NULL); - - gst_bin_add_many (GST_BIN (pipeline), fakesrc, tee, identity, - fakesink1, fakesink2, NULL); - gst_element_link (fakesrc, tee); - gst_element_link (identity, fakesink1); - - return pipeline; -} - -static void -print_elem (GstElement * elem, gpointer unused) -{ - g_print ("----> %s\n", GST_ELEMENT_NAME (elem)); - gst_object_unref (elem); -} - -int -main (int argc, gchar * argv[]) -{ - GstElement *bin; - GstIterator *it; - - gst_init (&argc, &argv); - - g_print ("pipeline 1\n"); - bin = make_pipeline1 (); - it = gst_bin_iterate_sorted (GST_BIN (bin)); - gst_iterator_foreach (it, (GFunc) print_elem, NULL); - gst_iterator_free (it); - - g_print ("pipeline 2\n"); - bin = make_pipeline2 (); - it = gst_bin_iterate_sorted (GST_BIN (bin)); - gst_iterator_foreach (it, (GFunc) print_elem, NULL); - gst_iterator_free (it); - - g_print ("pipeline 3\n"); - bin = make_pipeline3 (); - it = gst_bin_iterate_sorted (GST_BIN (bin)); - gst_iterator_foreach (it, (GFunc) print_elem, NULL); - gst_iterator_free (it); - - g_print ("pipeline 4\n"); - bin = make_pipeline4 (); - it = gst_bin_iterate_sorted (GST_BIN (bin)); - gst_iterator_foreach (it, (GFunc) print_elem, NULL); - gst_iterator_free (it); - - return 0; -} diff --git a/tests/sched/testcases b/tests/sched/testcases deleted file mode 100644 index c91ae3f..0000000 --- a/tests/sched/testcases +++ /dev/null @@ -1,1060 +0,0 @@ -* = loopbased - -/**************************************************************************************/ - * 1 bin - **************************************************************************************/ - -1) - - - [-bin-------------------------------] - ! [--------] [--------] ! - ! !faksesrc! !fakesink! ! - ! ! src -------- sink ! ! - ! [--------] [--------] ! - [-----------------------------------] - -fakesrc ! fakesink - -2) - - - [-bin-----------------------------------------------] - ! [--------] [--------] [--------] ! - ! !faksesrc! !identity! !fakesink! ! - ! ! src --- sink src ----- sink ! ! - ! [--------] [--------] [--------] ! - [---------------------------------------------------] - -fakesrc ! identity ! fakesink - -3) - - - [-bin-----------------------------------------------] - ! [--------] [--------] [--------] ! - ! !faksesrc! !identity! !fakesink! ! - ! ! src --- sink * src ----- sink ! ! - ! [--------] [--------] [--------] ! - [---------------------------------------------------] - -fakesrc ! @identity ! fakesink - -4) - - [-bin--------------------------------------------------------------] - ! [--------] [--------] [--------] [--------] ! - ! !faksesrc! !identity! !identity! !fakesink! ! - ! ! src --- sink src -- sink src -- sink ! ! - ! [--------] [--------] [--------] [--------] ! - [------------------------------------------------------------------] - -fakesrc ! identity ! identity ! fakesink - -4b) - - [-bin--------------------------------------------------------------] - ! [--------] [--------] [--------] [--------] ! - ! !faksesrc! !identity! !identity! !fakesink! ! - ! ! src --- sink * src -- sink src -- sink ! ! - ! [--------] [--------] [--------] [--------] ! - [------------------------------------------------------------------] - -fakesrc ! @identity ! identity ! fakesink - -5) - - [------------------------------------------------------------------] - ! [--------] [--------] [--------] [--------] ! - ! !faksesrc! !identity! !identity! !fakesink! ! - ! ! src --- sink src -- sink * src -- sink ! ! - ! [--------] [--------] [--------] [--------] ! - [------------------------------------------------------------------] - -fakesrc ! identity ! @identity ! fakesink - -5b) - - [------------------------------------------------------------------] - ! [--------] [--------] [--------] [--------] ! - ! !faksesrc! !identity! !identity! !fakesink! ! - ! ! src --- sink * src -- sink * src -- sink ! ! - ! [--------] [--------] [--------] [--------] ! - [------------------------------------------------------------------] - -fakesrc ! @identity ! @identity ! fakesink - - -/**************************************************************************************/ - * bin-in-bin based - **************************************************************************************/ - -6) - - [-bin-----------------------------------] - [ [-bin-------------------------------] ] - [ ! [--------] [--------] ! ] - [ ! !faksesrc! !fakesink! ! ] - [ ! ! src -------- sink ! ! ] - [ ! [--------] [--------] ! ] - [ [-----------------------------------] ] - [---------------------------------------] - -(fakesrc ! fakesink) - -7) - - [-bin-----------------------------------] - [ [-bin----------] ] - [ ! [--------] ] [--------] ] - [ ! !faksesrc! ] !fakesink! ] - [ ! ! src -------- sink ! ] - [ ! [--------] ] [--------] ] - [ [--------------] ] - [---------------------------------------] - -(fakesrc) ! fakesink - -8) - - [-bin-----------------------------------] - [ [-bin-------------] ] - [ [--------] [ [--------] ! ] - [ !faksesrc! [ !fakesink! ! ] - [ ! src -------- sink ! ! ] - [ [--------] [ [--------] ! ] - [ [-----------------] ] - [---------------------------------------] - -fakesrc ! (fakesink) - -9) - - [-bin---------------------------------------------------] - [ [-bin-------------] ! - [ [--------] [--------] ! [--------] ! ! - [ !faksesrc! !identity! ! !fakesink! ! ! - [ ! src --- sink src ----- sink ! ! ! - [ [--------] [--------] ! [--------] ! ! - [ [-----------------] ! - [-------------------------------------------------------] - -fakesrc ! identity ! (fakesink) - -10) - - [-bin---------------------------------------------------] - [ [-bin-------------] ! - [ [--------] [--------] ! [--------] ! ! - [ !faksesrc! !identity! ! !fakesink! ! ! - [ ! src --- sink * src ----- sink ! ! ! - [ [--------] [--------] ! [--------] ! ! - [ [-----------------] ! - [-------------------------------------------------------] - -fakesrc ! @identity ! (fakesink) - -11) - - [-bin---------------------------------------------------] - [ [-bin--------------------------------] ! - [ [--------] ! [--------] [--------] ! ! - [ !faksesrc! ! !identity! !fakesink! ! ! - [ ! src --- sink src ----- sink ! ! ! - [ [--------] ! [--------] [--------] ! ! - [ [------------------------------------] ! - [-------------------------------------------------------] - -fakesrc ! (identity ! fakesink) - -12) - - [-bin---------------------------------------------------] - [ [-bin--------------------------------] ! - [ [--------] ! [--------] [--------] ! ! - [ !faksesrc! ! !identity! !fakesink! ! ! - [ ! src --- sink * src ----- sink ! ! ! - [ [--------] ! [--------] [--------] ! ! - [ [------------------------------------] ! - [-------------------------------------------------------] - -fakesrc ! (@identity ! fakesink) - -13) - - [-bin---------------------------------------------------] - [ [-bin-----------------------------] ! - [ [ [--------] [--------] ! [--------] ! - [ [ !faksesrc! !identity! ! !fakesink! ! - [ [ ! src --- sink src ----- sink ! ! - [ [ [--------] [--------] ! [--------] ! - [ [---------------------------------] ! - [-------------------------------------------------------] - -(fakesrc ! identity) ! fakesink - -14) - - [-bin---------------------------------------------------] - ! [-bin-----------------------------] ! - ! ! [--------] [--------] ! [--------] ! - ! ! !faksesrc! !identity! ! !fakesink! ! - ! ! ! src --- sink * src ----- sink ! ! - ! ! [--------] [--------] ! [--------] ! - ! [---------------------------------] ! - [-------------------------------------------------------] - -(fakesrc ! @identity) ! fakesink - -15) - - [-bin----------------------------------------------------------------] - ! [-bin-----------------------------] ! - ! ! [--------] [--------] ! [--------] [--------] ! - ! ! !faksesrc! !identity! ! !identity! !fakesink! ! - ! ! ! src --- sink src -- sink src -- sink ! ! - ! ! [--------] [--------] ! [--------] [--------] ! - ! [---------------------------------] ! - [--------------------------------------------------------------------] - -(fakesrc ! identity) ! identity ! fakesink - -16) - - [-bin----------------------------------------------------------------] - ! [-bin----------------------------] ! - ! [--------] [--------] ! [--------] [--------] ! ! - ! !faksesrc! !identity! ! !identity! !fakesink! ! ! - ! ! src --- sink src -- sink src -- sink ! ! ! - ! [--------] [--------] ! [--------] [--------] ! ! - ! [--------------------------------] ! - [--------------------------------------------------------------------] - -fakesrc ! identity ! (identity ! fakesink) - -17) - - [-bin----------------------------------------------------------------] - ! [-bin----------------------------] ! - ! [--------] [--------] ! [--------] [--------] ! ! - ! !faksesrc! !identity! ! !identity! !fakesink! ! ! - ! ! src --- sink src -- sink * src -- sink ! ! ! - ! [--------] [--------] ! [--------] [--------] ! ! - ! [--------------------------------] ! - [--------------------------------------------------------------------] - -fakesrc ! identity ! (@identity ! fakesink) - -18) - - [-bin----------------------------------------------------------------] - ! [-bin----------------------------] ! - ! [--------] [--------] ! [--------] [--------] ! ! - ! !faksesrc! !identity! ! !identity! !fakesink! ! ! - ! ! src --- sink * src -- sink * src -- sink ! ! ! - ! [--------] [--------] ! [--------] [--------] ! ! - ! [--------------------------------] ! - [--------------------------------------------------------------------] - -fakesrc ! @identity ! @identity ! fakesink - -19) - - [-bin----------------------------------------------------------------] - ! [-bin-----------------------------] ! - ! ! [--------] [--------] ! [--------] [--------] ! - ! ! !faksesrc! !identity! ! !identity! !fakesink! ! - ! ! ! src --- sink * src -- sink src -- sink ! ! - ! ! [--------] [--------] ! [--------] [--------] ! - ! [---------------------------------] ! - [--------------------------------------------------------------------] - -(fakesrc ! @identity) ! identity ! fakesink - -20) - - [-bin----------------------------------------------------------------] - ! [-bin-----------------------------] ! - ! ! [--------] [--------] ! [--------] [--------] ! - ! ! !faksesrc! !identity! ! !identity! !fakesink! ! - ! ! ! src --- sink src -- sink * src -- sink ! ! - ! ! [--------] [--------] ! [--------] [--------] ! - ! [---------------------------------] ! - [--------------------------------------------------------------------] - -(fakesrc ! identity) ! @identity ! fakesink - -21) - - [-bin----------------------------------------------------------------] - ! [-bin-----------------------------] ! - ! ! [--------] [--------] ! [--------] [--------] ! - ! ! !faksesrc! !identity! ! !identity! !fakesink! ! - ! ! ! src --- sink * src -- sink * src -- sink ! ! - ! ! [--------] [--------] ! [--------] [--------] ! - ! [---------------------------------] ! - [--------------------------------------------------------------------] - -(fakesrc ! @identity) ! @identity ! fakesink - -22) - - [-bin--------------------------------------------------------------------] - ! [-bin----------------------------] [-bin-----------------------------] ! - ! ! [--------] [--------] ! ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink ! ! ! - ! ! [--------] [--------] ! ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [------------------------------------------------------------------------] - -(fakesrc ! identity) ! (identity ! fakesink) - -23) - - [-bin--------------------------------------------------------------------] - ! [-bin----------------------------] [-bin-----------------------------] ! - ! ! [--------] [--------] ! ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src --- sink * src -- sink ! ! ! - ! ! [--------] [--------] ! ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [------------------------------------------------------------------------] - -(fakesrc ! identity) ! (@identity ! fakesink) - -24) - - [-bin--------------------------------------------------------------------] - ! [-bin----------------------------] [-bin-----------------------------] ! - ! ! [--------] [--------] ! ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! ! !identity! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink ! ! ! - ! ! [--------] [--------] ! ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [------------------------------------------------------------------------] - -(fakesrc ! @identity) ! (identity ! fakesink) - -25) - - [-bin--------------------------------------------------------------------] - ! [-bin----------------------------] [-bin-----------------------------] ! - ! ! [--------] [--------] ! ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! ! !identity! !fakesink! ! ! - ! ! ! src --- sink * src --- sink * src -- sink ! ! ! - ! ! [--------] [--------] ! ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [------------------------------------------------------------------------] - -(fakesrc ! @identity) ! (@identity ! fakesink) - -/**************************************************************************************/ - * threads - **************************************************************************************/ - -26) - - [-bin-----------------------------------] - [ [-thread----------------------------] ] - [ ! [--------] [--------] ! ] - [ ! !faksesrc! !fakesink! ! ] - [ ! ! src -------- sink ! ! ] - [ ! [--------] [--------] ! ] - [ [-----------------------------------] ] - [---------------------------------------] - -[fakesrc ! fakesink] - -27) - - [-thread--------------------------------] - [ [-bin-------------------------------] ] - [ ! [--------] [--------] ! ] - [ ! !faksesrc! !fakesink! ! ] - [ ! ! src -------- sink ! ! ] - [ ! [--------] [--------] ! ] - [ [-----------------------------------] ] - [---------------------------------------] - -28) - - [-bin--------------------------------------------] - [ [-thread-------] ] - [ ! [--------] ] [-----] [--------] ] - [ ! !faksesrc! ] !queue! !fakesink! ] - [ ! ! src --- sink src -- sink ! ] - [ ! [--------] ] [-----] [--------] ] - [ [--------------] ] - [------------------------------------------------] - - -29) - - [-bin--------------------------------------------] - [ [-thread--------] ] - [ [--------] [-----] [ [--------] ! ] - [ !faksesrc! !queue! [ !fakesink! ! ] - [ ! src -- sink src --- sink ! ! ] - [ [--------] [-----] [ [--------] ! ] - [ [---------------] ] - [------------------------------------------------] - - -30) - - [-bin---------------------------------------------------------------] - [ [-thread--------] ! - [ [--------] [--------] [-----] ! [--------] ! ! - [ !faksesrc! !identity! !queue! ! !fakesink! ! ! - [ ! src --- sink src -- sink src --- sink ! ! ! - [ [--------] [--------] [-----] ! [--------] ! ! - [ [---------------] ! - [-------------------------------------------------------------------] - - -31) - - [-bin---------------------------------------------------------------] - [ [-thread--------] ! - [ [--------] [--------] [-----] ! [--------] ! ! - [ !faksesrc! !identity! !queue! ! !fakesink! ! ! - [ ! src --- sink * src -- sink src --- sink ! ! ! - [ [--------] [--------] [-----] ! [--------] ! ! - [ [---------------] ! - [-------------------------------------------------------------------] - - - -32) - - [-bin------------------------------------------------------------------] - [ [-thread-----------------------------] ! - [ [--------] [-----] ! [--------] [--------] ! ! - [ !faksesrc! !queue! ! !identity! !fakesink! ! ! - [ ! src --- sink src --- sink src ----- sink ! ! ! - [ [--------] [-----] ! [--------] [--------] ! ! - [ [------------------------------------] ! - [----------------------------------------------------------------------] - - -33) - - [-bin------------------------------------------------------------------] - [ [-thread-----------------------------] ! - [ [--------] [-----] ! [--------] [--------] ! ! - [ !faksesrc! !queue! ! !identity! !fakesink! ! ! - [ ! src --- sink src --- sink * src ----- sink ! ! ! - [ [--------] [-----] ! [--------] [--------] ! ! - [ [------------------------------------] ! - [----------------------------------------------------------------------] - - -34) - - [-bin---------------------------------------------------------------] - [ [-thread--------------------------] ! - [ [ [--------] [--------] ! [-----] [--------] ! - [ [ !faksesrc! !identity! ! !queue! !fakesink! ! - [ [ ! src --- sink src --- sink src -- sink ! ! - [ [ [--------] [--------] ! [-----] [--------] ! - [ [---------------------------------] ! - [-------------------------------------------------------------------] - - -35) - - [-bin---------------------------------------------------------------] - [ [-thread--------------------------] ! - [ [ [--------] [--------] ! [-----] [--------] ! - [ [ !faksesrc! !identity! ! !queue! !fakesink! ! - [ [ ! src --- sink * src --- sink src -- sink ! ! - [ [ [--------] [--------] ! [-----] [--------] ! - [ [---------------------------------] ! - [-------------------------------------------------------------------] - - -36) - - [-bin------------------------------------------------------------------------------] - ! [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] [--------] [--------] ! - ! ! !faksesrc! !identity! ! !queue! !identity! !fakesink! ! - ! ! ! src --- sink src -- sink src -- sink src -- sink ! ! - ! ! [--------] [--------] ! [-----] [--------] [--------] ! - ! [---------------------------------] ! - [----------------------------------------------------------------------------------] - - -37) - - [-bin------------------------------------------------------------------------------] - ! [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] [--------] [--------] ! - ! ! !faksesrc! !identity! ! !queue! !identity! !fakesink! ! - ! ! ! src --- sink * src -- sink src -- sink src -- sink ! ! - ! ! [--------] [--------] ! [-----] [--------] [--------] ! - ! [---------------------------------] ! - [----------------------------------------------------------------------------------] - - -38) - - [-bin------------------------------------------------------------------------------] - ! [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] [--------] [--------] ! - ! ! !faksesrc! !identity! ! !queue! !identity! !fakesink! ! - ! ! ! src --- sink src -- sink src -- sink * src -- sink ! ! - ! ! [--------] [--------] ! [-----] [--------] [--------] ! - ! [---------------------------------] ! - [----------------------------------------------------------------------------------] - - -39) - - [-bin------------------------------------------------------------------------------] - ! [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] [--------] [--------] ! - ! ! !faksesrc! !identity! ! !queue! !identity! !fakesink! ! - ! ! ! src --- sink * src -- sink src -- sink * src -- sink ! ! - ! ! [--------] [--------] ! [-----] [--------] [--------] ! - ! [---------------------------------] ! - [----------------------------------------------------------------------------------] - - -40) - - [-bin------------------------------------------------------------------------------] - ! [-thread-------------------------] ! - ! [--------] [--------] [-----] ! [--------] [--------] ! ! - ! !faksesrc! !identity! !queue! ! !identity! !fakesink! ! ! - ! ! src --- sink src -- sink src -- sink src -- sink ! ! ! - ! [--------] [--------] [-----] ! [--------] [--------] ! ! - ! [--------------------------------] ! - [----------------------------------------------------------------------------------] - -41) - - [-bin-------------------------------------------------------------------------------] - ! [-thread--------------------------] ! - ! [--------] [--------] [-----] ! [--------] [--------] ! ! - ! !faksesrc! !identity! !queue! ! !identity! !fakesink! ! ! - ! ! src --- sink src -- sink src -- sink * src -- sink ! ! ! - ! [--------] [--------] [-----] ! [--------] [--------] ! ! - ! [--------------------------------] ! - [-----------------------------------------------------------------------------------] - -42) - - [-bin------------------------------------------------------------------------------] - ! [-thread-------------------------] ! - ! [--------] [--------] [-----] ! [--------] [--------] ! ! - ! !faksesrc! !identity! !queue! ! !identity! !fakesink! ! ! - ! ! src --- sink * src -- sink src -- sink src -- sink ! ! ! - ! [--------] [--------] [-----] ! [--------] [--------] ! ! - ! [--------------------------------] ! - [----------------------------------------------------------------------------------] - - -43) - - [-bin------------------------------------------------------------------------------] - ! [-thread-------------------------] ! - ! [--------] [--------] [-----] ! [--------] [--------] ! ! - ! !faksesrc! !identity! !queue! ! !identity! !fakesink! ! ! - ! ! src --- sink * src -- sink src -- sink * src -- sink ! ! ! - ! [--------] [--------] [-----] ! [--------] [--------] ! ! - ! [--------------------------------] ! - [----------------------------------------------------------------------------------] - - - -/********************************************************************************** - * two threads in bin - **********************************************************************************/ - -44) - - [-bin---------------------------------------------------------------------------------] - ! [-thread-------------------------] [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - - -45) - - [-bin---------------------------------------------------------------------------------] - ! [-thread-------------------------] [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - - -46) - - [-bin---------------------------------------------------------------------------------] - ! [-thread-------------------------] [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink * src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - - -47) - - [-bin---------------------------------------------------------------------------------] - ! [-thread-------------------------] [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink * src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - - -48) - - [-bin---------------------------------------------------------------] - ! [-thread-------] [-thread--------------------------] ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src -- sink src -- sink ! ! ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------] [---------------------------------] ! - [-------------------------------------------------------------------] - - -49) - - [-bin---------------------------------------------------------------] - ! [-thread-------] [-thread--------------------------] ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src -- sink * src -- sink ! ! ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------] [---------------------------------] ! - [-------------------------------------------------------------------] - - -50) - - [-bin----------------------------------------------------------------] - ! [-thread-------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------] - - -51) - - [-bin----------------------------------------------------------------] - ! [-thread-------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------] - - -52) - - [-bin----------------------------------------------] - ! [-thread-------] [-thread---------] ! - ! ! [--------] ! [-----] ! [--------] ! ! - ! ! !faksesrc! ! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src -- sink ! ! ! - ! ! [--------] ! [-----] ! [--------] ! ! - ! [--------------] [----------------] ! - [--------------------------------------------------] - -52b) - - [-bin----------------------------------------------------------------------------------------------] - ! [-thread-------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - - -52c) - - [-bin----------------------------------------------------------------------------------------------] - ! [-thread-------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - -52d) - - [-bin----------------------------------------------------------------------------------------------] - ! [-thread-------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink * src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - -52e) - - [-bin----------------------------------------------------------------------------------------------] - ! [-thread-------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink * src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - - - - -/********************************************************************************** - * thread-bin in bin - **********************************************************************************/ - -/** thread first ******/ - -53) - - [-bin---------------------------------------------------------------------------------] - ! [-thread-------------------------] [-bin-----------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - - -54) - - [-bin---------------------------------------------------------------------------------] - ! [-thread-------------------------] [-bin-----------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - - -55) - - [-bin---------------------------------------------------------------------------------] - ! [-thread-------------------------] [-bin-----------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink * src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - - -56) - - [-bin---------------------------------------------------------------------------------] - ! [-thread-------------------------] [-bin-----------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink * src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - -57) - - [-bin----------------------------------------------] - ! [-thread-------] [-bin------------] ! - ! ! [--------] ! [-----] ! [--------] ! ! - ! ! !faksesrc! ! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src -- sink ! ! ! - ! ! [--------] ! [-----] ! [--------] ! ! - ! [--------------] [----------------] ! - [--------------------------------------------------] - - -58) - - [-bin---------------------------------------------------------------] - ! [-thread-------] [-bin-----------------------------] ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src -- sink src -- sink ! ! ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------] [---------------------------------] ! - [-------------------------------------------------------------------] - - -59) - - [-bin---------------------------------------------------------------] - ! [-thread-------] [-bin-----------------------------] ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src -- sink * src -- sink ! ! ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------] [---------------------------------] ! - [-------------------------------------------------------------------] - - -60) - - [-bin----------------------------------------------------------------] - ! [-thread-------------------------] [-bin------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------] - - -61) - - [-bin----------------------------------------------------------------] - ! [-thread-------------------------] [-bin------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------] - -/* non blocking queue ? */ - -61a) - - [-bin----------------------------------------------------------------------------------------------] - ! [-thread-------------------------] [-bin------------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - - -61b) - - [-bin----------------------------------------------------------------------------------------------] - ! [-thread-------------------------] [-bin------------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - - -61c) - - [-bin----------------------------------------------------------------------------------------------] - ! [-thread-------------------------] [-bin------------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink * src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - - -61d) - - [-bin----------------------------------------------------------------------------------------------] - ! [-thread-------------------------] [-bin------------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink * src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - - -/** bin first ******/ - -62) - - [-bin---------------------------------------------------------------------------------] - ! [-bin----------------------------] [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - - -63) - - [-bin---------------------------------------------------------------------------------] - ! [-bin----------------------------] [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - - -64) - - [-bin---------------------------------------------------------------------------------] - ! [-bin----------------------------] [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink * src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - - -65) - - [-bin---------------------------------------------------------------------------------] - ! [-bin----------------------------] [-thread--------------------------] ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink * src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------------------------] [---------------------------------] ! - [-------------------------------------------------------------------------------------] - - -66) - - [-bin----------------------------------------------] - ! [-bin----------] [-thread---------] ! - ! ! [--------] ! [-----] ! [--------] ! ! - ! ! !faksesrc! ! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src -- sink ! ! ! - ! ! [--------] ! [-----] ! [--------] ! ! - ! [--------------] [----------------] ! - [--------------------------------------------------] - - -67) - - [-bin---------------------------------------------------------------] - ! [-bin----------] [-thread--------------------------] ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src -- sink src -- sink ! ! ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------] [---------------------------------] ! - [-------------------------------------------------------------------] - - -68) - - [-bin---------------------------------------------------------------] - ! [-bin----------] [-thread--------------------------] ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! ! !faksesrc! ! !queue! ! !identity! !fakesink! ! ! - ! ! ! src --- sink src -- sink * src -- sink ! ! ! - ! ! [--------] ! [-----] ! [--------] [--------] ! ! - ! [--------------] [---------------------------------] ! - [-------------------------------------------------------------------] - - -69) - - [-bin----------------------------------------------------------------] - ! [-bin----------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------] - - -70) - - [-bin----------------------------------------------------------------] - ! [-bin----------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! ! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------] - - -71) - - [-bin----------------------------------------------------------------------------------------------] - ! [-bin----------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - - -72) - - [-bin----------------------------------------------------------------------------------------------] - ! [-bin----------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - - -73) - - [-bin----------------------------------------------------------------------------------------------] - ! [-bin----------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink src --- sink src -- sink * src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - - -74) - - [-bin----------------------------------------------------------------------------------------------] - ! [-bin----------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink * src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] - - -75) - - [-bin----------------------------------------------------------------------------------------------] - ! [-bin----------------------------] [-thread---------] ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! ! !faksesrc! !identity! ! !queue! !identity! !queue! ! !fakesink! ! ! - ! ! ! src --- sink * src --- sink src -- sink * src -- sink src -- sink ! ! ! - ! ! [--------] [--------] ! [-----] [--------] [-----] ! [--------] ! ! - ! [--------------------------------] [----------------] ! - [--------------------------------------------------------------------------------------------------] diff --git a/tests/sched/testcases1.tc b/tests/sched/testcases1.tc deleted file mode 100644 index 28ee331..0000000 --- a/tests/sched/testcases1.tc +++ /dev/null @@ -1,18 +0,0 @@ -tcN: fakesrc-fakesink -tcP: fakesrc ! fakesink -tcS: A, fakesrc0, handoff -tcS: B, fakesink0, handoff -tcI: 2 -tcT: 2000 -tcR: A,1,B,1,A,1,B,1 - - -tcN: fakesrc-identity-fakesink -tcP: fakesrc ! identity ! fakesink -tcS: A, fakesrc0, handoff -tcS: B, identity, handoff -tcS: C, fakesink0, handoff -tcI: 2 -tcT: 2000 -tcR: A,1,B,1,C,1,A,1,B,1,C,1 - diff --git a/tests/seeking/.gitignore b/tests/seeking/.gitignore deleted file mode 100644 index c348f9f..0000000 --- a/tests/seeking/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -Makefile -Makefile.in -*.o -*.lo -*.la -.deps -.libs - -seeking1 -*.bb -*.bbg -*.da diff --git a/tests/seeking/Makefile.am b/tests/seeking/Makefile.am deleted file mode 100644 index 62e066d..0000000 --- a/tests/seeking/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -noinst_PROGRAMS = seeking1 - -LDADD = $(GST_OBJ_LIBS) -AM_CFLAGS = $(GST_OBJ_CFLAGS) diff --git a/tests/seeking/seeking1.c b/tests/seeking/seeking1.c deleted file mode 100644 index b812d50..0000000 --- a/tests/seeking/seeking1.c +++ /dev/null @@ -1,104 +0,0 @@ -#include - -static gint looping; -static GstEvent *event; -static GstPad *pad; - -static void -event_received (GObject * object, GstEvent * event, GstElement * pipeline) -{ -#if 0 - if (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT_DONE) { - g_print ("segment done\n"); - if (--looping == 1) { - event = gst_event_new_segment_seek (GST_FORMAT_DEFAULT | - GST_SEEK_METHOD_SET | GST_SEEK_FLAG_FLUSH, 20, 25); - } else { - event = gst_event_new_segment_seek (GST_FORMAT_DEFAULT | - GST_SEEK_METHOD_SET | - GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SEGMENT_LOOP, 50, 55); - } - gst_pad_send_event (pad, event); - } -#endif -} - -gint -main (gint argc, gchar * argv[]) -{ - GstElement *pipeline; - GstElement *fakesrc; - GstElement *fakesink; - - /* guint64 value; */ - GstFormat format; - - gst_init (&argc, &argv); - - pipeline = gst_pipeline_new ("pipeline"); - - fakesrc = gst_element_factory_make ("fakesrc", "src"); - - fakesink = gst_element_factory_make ("fakesink", "sink"); - - gst_bin_add (GST_BIN (pipeline), fakesrc); - gst_bin_add (GST_BIN (pipeline), fakesink); - - gst_element_link_pads (fakesrc, "src", fakesink, "sink"); - - gst_element_set_state (pipeline, GST_STATE_READY); - - pad = gst_element_get_pad (fakesrc, "src"); - - g_print ("doing segment seek from 5 to 10\n"); - - gst_pad_send_event (pad, - gst_event_new_seek (1.0, GST_FORMAT_DEFAULT, - GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SEGMENT, - GST_SEEK_TYPE_SET, 5, GST_SEEK_TYPE_SET, 10)); - - format = GST_FORMAT_DEFAULT; - -#if 0 - gst_pad_query (pad, GST_QUERY_START, &format, &value); - g_print ("configured for start %" G_GINT64_FORMAT "\n", value); - gst_pad_query (pad, GST_QUERY_SEGMENT_END, &format, &value); - g_print ("configured segment end %" G_GINT64_FORMAT "\n", value); -#endif - - - gst_element_set_state (pipeline, GST_STATE_PLAYING); - - g_signal_connect (G_OBJECT (pipeline), "deep_notify", - G_CALLBACK (gst_object_default_deep_notify), NULL); - - g_usleep (2 * G_USEC_PER_SEC); - - g_print - ("doing segment seek from 50 to 55 with looping (2 times), then 20 to 25 without looping\n"); - looping = 3; - - event = - gst_event_new_seek (1.0, GST_FORMAT_DEFAULT, - GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_SEGMENT, - GST_SEEK_TYPE_SET, 50, GST_SEEK_TYPE_SET, 55); - gst_pad_send_event (pad, event); - - g_signal_connect (G_OBJECT (gst_element_get_pad (fakesink, "sink")), - "event_received", G_CALLBACK (event_received), event); - -#if 0 - gst_pad_query (pad, GST_QUERY_START, &format, &value); - g_print ("configured for start %" G_GINT64_FORMAT "\n", value); - gst_pad_query (pad, GST_QUERY_SEGMENT_END, &format, &value); - g_print ("configured segment end %" G_GINT64_FORMAT "\n", value); -#endif - - gst_element_set_state (pipeline, GST_STATE_PLAYING); - - g_usleep (2 * G_USEC_PER_SEC); - - gst_element_set_state (pipeline, GST_STATE_NULL); - - return 0; -} diff --git a/tests/threadstate/.gitignore b/tests/threadstate/.gitignore deleted file mode 100644 index 1520ff6..0000000 --- a/tests/threadstate/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -Makefile -Makefile.in -*.o -*.lo -*.la -.deps -.libs - -test1 -test2 -threadstate1 -threadstate2 -threadstate3 -threadstate4 -threadstate5 -*.bb -*.bbg -*.da diff --git a/tests/threadstate/Makefile.am b/tests/threadstate/Makefile.am deleted file mode 100644 index 05e755c..0000000 --- a/tests/threadstate/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -noinst_PROGRAMS = threadstate1 threadstate2 threadstate3 threadstate4 threadstate5 test1 test2 - -LDADD = $(GST_OBJ_LIBS) -AM_CFLAGS = $(GST_OBJ_CFLAGS) diff --git a/tests/threadstate/test1.c b/tests/threadstate/test1.c deleted file mode 100644 index e4478be..0000000 --- a/tests/threadstate/test1.c +++ /dev/null @@ -1,104 +0,0 @@ -/* GStreamer - * Copyright (C) <1999> Erik Walthinsen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include - -typedef struct -{ - GMutex *mutex; - GCond *cond; - gint var; -} ThreadInfo; - -static void * -thread_loop (void *arg) -{ - ThreadInfo *info = (ThreadInfo *) arg; - - g_print ("thread: entering %p\n", info); - - g_print ("thread: lock\n"); - g_mutex_lock (info->mutex); - g_print ("thread: signal spinup\n"); - g_cond_signal (info->cond); - - g_print ("thread: wait ACK\n"); - g_cond_wait (info->cond, info->mutex); - info->var = 1; - g_print ("thread: signal var change\n"); - g_cond_signal (info->cond); - g_print ("thread: unlock\n"); - g_mutex_unlock (info->mutex); - - g_print ("thread: exit\n"); - return NULL; -} - -gint -main (gint argc, gchar * argv[]) -{ - ThreadInfo *info; - GThread *thread; - GError *error = NULL; - gint res = 0; - - if (!g_thread_supported ()) - g_thread_init (NULL); - - info = g_new (ThreadInfo, 1); - info->mutex = g_mutex_new (); - info->cond = g_cond_new (); - info->var = 0; - - g_print ("main: lock\n"); - g_mutex_lock (info->mutex); - - thread = g_thread_create (thread_loop, info, TRUE, &error); - - if (error != NULL) { - g_print ("Unable to start thread: %s\n", error->message); - g_error_free (error); - res = -1; - goto done; - } - - g_print ("main: wait spinup\n"); - g_cond_wait (info->cond, info->mutex); - - g_print ("main: signal ACK\n"); - g_cond_signal (info->cond); - - g_print ("main: waiting for thread to change var\n"); - g_cond_wait (info->cond, info->mutex); - - g_print ("main: var == %d\n", info->var); - if (info->var != 1) - g_print ("main: !!error!! expected var == 1, got %d\n", info->var); - g_mutex_unlock (info->mutex); - - g_print ("main: join\n"); - g_thread_join (thread); - -done: - g_mutex_free (info->mutex); - g_cond_free (info->cond); - g_free (info); - - return res; -} diff --git a/tests/threadstate/test2.c b/tests/threadstate/test2.c deleted file mode 100644 index 4841cdd..0000000 --- a/tests/threadstate/test2.c +++ /dev/null @@ -1,108 +0,0 @@ -/* GStreamer - * Copyright (C) <1999> Erik Walthinsen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include - -typedef struct -{ - GMutex *mutex; - GCond *cond_t; - GCond *cond_p; - gint var; -} ThreadInfo; - -static void * -thread_loop (void *arg) -{ - ThreadInfo *info = (ThreadInfo *) arg; - - g_print ("thread: entering %p\n", info); - - g_print ("thread: lock\n"); - g_mutex_lock (info->mutex); - g_print ("thread: signal spinup\n"); - g_cond_signal (info->cond_t); - - g_print ("thread: wait ACK\n"); - g_cond_wait (info->cond_p, info->mutex); - info->var = 1; - g_print ("thread: signal var change\n"); - g_cond_signal (info->cond_t); - g_print ("thread: unlock\n"); - g_mutex_unlock (info->mutex); - - g_print ("thread: exit\n"); - return NULL; -} - -gint -main (gint argc, gchar * argv[]) -{ - ThreadInfo *info; - GThread *thread; - GError *error = NULL; - gint res = 0; - - if (!g_thread_supported ()) - g_thread_init (NULL); - - info = g_new (ThreadInfo, 1); - info->mutex = g_mutex_new (); - info->cond_t = g_cond_new (); - info->cond_p = g_cond_new (); - info->var = 0; - - g_print ("main: lock\n"); - g_mutex_lock (info->mutex); - - thread = g_thread_create (thread_loop, info, TRUE, &error); - - if (error != NULL) { - g_print ("Unable to start thread: %s\n", error->message); - g_error_free (error); - res = -1; - goto done; - } - - g_print ("main: wait spinup\n"); - g_cond_wait (info->cond_t, info->mutex); - - g_print ("main: signal ACK\n"); - g_cond_signal (info->cond_p); - - g_print ("main: waiting for thread to change var\n"); - g_cond_wait (info->cond_t, info->mutex); - - g_print ("main: var == %d\n", info->var); - if (info->var != 1) { - g_print ("main: !!error!! expected var == 1, got %d\n", info->var); - } - g_mutex_unlock (info->mutex); - - g_print ("main: join\n"); - g_thread_join (thread); - -done: - g_mutex_free (info->mutex); - g_cond_free (info->cond_t); - g_cond_free (info->cond_p); - g_free (info); - - return res; -} diff --git a/tests/threadstate/threadstate1.c b/tests/threadstate/threadstate1.c deleted file mode 100644 index 58d8b87..0000000 --- a/tests/threadstate/threadstate1.c +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include - -/* this pipeline is: - * { fakesrc ! fakesink } - */ - - -int -main (int argc, char *argv[]) -{ - GstElement *fakesrc, *fakesink; - GstElement *pipeline; - gint x; - - gst_init (&argc, &argv); - - pipeline = gst_pipeline_new ("pipeline"); - g_assert (pipeline != NULL); - - fakesrc = gst_element_factory_make ("fakesrc", "fake_source"); - g_assert (fakesrc != NULL); - - fakesink = gst_element_factory_make ("fakesink", "fake_sink"); - g_assert (fakesink != NULL); - - gst_bin_add_many (GST_BIN (pipeline), fakesrc, fakesink, NULL); - gst_element_link (fakesrc, fakesink); - - for (x = 0; x < 10; x++) { - g_print ("playing %d\n", x); - gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); - g_usleep (G_USEC_PER_SEC); - - g_print ("pausing %d\n", x); - gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PAUSED); - g_usleep (G_USEC_PER_SEC); - } - - exit (0); -} diff --git a/tests/threadstate/threadstate2.c b/tests/threadstate/threadstate2.c deleted file mode 100644 index 3843d19..0000000 --- a/tests/threadstate/threadstate2.c +++ /dev/null @@ -1,90 +0,0 @@ -#include -#include - -static GMainLoop *loop; -static gboolean EOS = FALSE; - -/* this pipeline is: - * { filesrc ! mad ! osssink } - */ - -static gboolean -bus_handler (GstBus * bus, GstMessage * message, gpointer data) -{ - switch (GST_MESSAGE_TYPE (message)) { - case GST_MESSAGE_EOS: - g_print ("have eos, quitting\n"); - EOS = TRUE; - if (g_main_loop_is_running (loop)) - g_main_loop_quit (loop); - break; - default: - break; - } - return TRUE; -} - -static gboolean -timeout_func (GMainLoop * loop) -{ - g_main_loop_quit (loop); - - return TRUE; -} - -int -main (int argc, char *argv[]) -{ - GstElement *filesrc, *osssink; - GstElement *pipeline; - GstElement *mad; - gint x; - GstBus *bus; - - gst_init (&argc, &argv); - - if (argc != 2) { - g_print ("usage: %s \n", argv[0]); - exit (-1); - } - - /* create a new pipeline to hold the elements */ - pipeline = gst_pipeline_new ("pipeline"); - g_assert (pipeline != NULL); - - /* create a disk reader */ - filesrc = gst_element_factory_make ("filesrc", "disk_source"); - g_assert (filesrc != NULL); - g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL); - - /* and an audio sink */ - osssink = gst_element_factory_make ("osssink", "play_audio"); - g_assert (osssink != NULL); - - /* did i mention that this is an mp3 player? */ - mad = gst_element_factory_make ("mad", "mp3_decoder"); - g_assert (mad != NULL); - - gst_bin_add_many (GST_BIN (pipeline), filesrc, mad, osssink, NULL); - gst_element_link_many (filesrc, mad, osssink, NULL); - - loop = g_main_loop_new (NULL, FALSE); - g_timeout_add (2 * 1000, (GSourceFunc) timeout_func, loop); - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_watch (bus, GST_MESSAGE_ANY, (GstBusFunc) bus_handler, pipeline); - - for (x = 0; x < 10; x++) { - g_print ("playing %d\n", x); - gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); - g_main_loop_run (loop); - if (EOS) - break; - - g_print ("pausing %d\n", x); - gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PAUSED); - g_main_loop_run (loop); - } - - exit (0); -} diff --git a/tests/threadstate/threadstate3.c b/tests/threadstate/threadstate3.c deleted file mode 100644 index c0acfdf..0000000 --- a/tests/threadstate/threadstate3.c +++ /dev/null @@ -1,44 +0,0 @@ -#include -#include - -/* this pipeline is: - * { { fakesrc ! fakesink } } - */ - -int -main (int argc, char *argv[]) -{ - GstElement *fakesrc, *fakesink; - GstElement *pipeline, *pipeline2; - gint x; - - gst_init (&argc, &argv); - - pipeline = gst_pipeline_new ("pipeline"); - g_assert (pipeline != NULL); - - pipeline2 = gst_pipeline_new ("pipeline2"); - g_assert (pipeline2 != NULL); - - gst_bin_add (GST_BIN (pipeline), GST_ELEMENT (pipeline2)); - - fakesrc = gst_element_factory_make ("fakesrc", "fake_source"); - g_assert (fakesrc != NULL); - - fakesink = gst_element_factory_make ("fakesink", "fake_sink"); - g_assert (fakesink != NULL); - - gst_bin_add_many (GST_BIN (pipeline2), fakesrc, fakesink, NULL); - gst_element_link (fakesrc, fakesink); - - for (x = 0; x < 10; x++) { - g_print ("playing %d\n", x); - gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING); - g_usleep (G_USEC_PER_SEC); - - g_print ("nulling %d\n", x); - gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_NULL); - g_usleep (G_USEC_PER_SEC); - } - exit (0); -} diff --git a/tests/threadstate/threadstate4.c b/tests/threadstate/threadstate4.c deleted file mode 100644 index 4163a90..0000000 --- a/tests/threadstate/threadstate4.c +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include - -/* this pipeline is: - * { { fakesrc } ! queue ! fakesink } - */ - -int -main (int argc, char *argv[]) -{ - GstElement *fakesrc, *fakesink; - GstElement *pipeline, *pipeline2; - GstElement *queue; - gint x; - - gst_init (&argc, &argv); - - pipeline = gst_pipeline_new ("pipeline"); - g_assert (pipeline != NULL); - - pipeline2 = gst_pipeline_new ("pipeline"); - g_assert (pipeline2 != NULL); - - queue = gst_element_factory_make ("queue", "the_queue"); - g_assert (queue != NULL); - - - fakesrc = gst_element_factory_make ("fakesrc", "fake_source"); - g_assert (fakesrc != NULL); - - fakesink = gst_element_factory_make ("fakesink", "fake_sink"); - g_assert (fakesink != NULL); - - gst_bin_add_many (GST_BIN (pipeline), pipeline2, queue, fakesink, NULL); - - gst_bin_add (GST_BIN (pipeline2), fakesrc); - gst_element_add_pad (pipeline2, gst_ghost_pad_new ("src", - gst_element_get_pad (fakesrc, "src"))); - gst_element_link_many (pipeline2, queue, fakesink, NULL); - - for (x = 0; x < 10; x++) { - g_print ("playing %d\n", x); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_usleep (G_USEC_PER_SEC); - - g_print ("nulling %d\n", x); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_usleep (G_USEC_PER_SEC); - } - - exit (0); -} diff --git a/tests/threadstate/threadstate5.c b/tests/threadstate/threadstate5.c deleted file mode 100644 index 4e58561..0000000 --- a/tests/threadstate/threadstate5.c +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include - -/* this pipeline is: - * { fakesrc ! { queue ! fakesink } } - */ - -int -main (int argc, char *argv[]) -{ - GstElement *fakesrc, *fakesink; - GstElement *pipeline, *pipeline2; - GstElement *queue; - gint x; - - gst_init (&argc, &argv); - - pipeline = gst_pipeline_new ("pipeline"); - g_assert (pipeline != NULL); - - pipeline2 = gst_pipeline_new ("pipeline"); - g_assert (pipeline2 != NULL); - - queue = gst_element_factory_make ("queue", "the_queue"); - g_assert (queue != NULL); - - fakesrc = gst_element_factory_make ("fakesrc", "fake_source"); - g_assert (fakesrc != NULL); - - fakesink = gst_element_factory_make ("fakesink", "fake_sink"); - g_assert (fakesink != NULL); - - gst_bin_add_many (GST_BIN (pipeline), fakesrc, pipeline2, NULL); - gst_bin_add_many (GST_BIN (pipeline2), queue, fakesink, NULL); - - gst_element_add_pad (pipeline2, gst_ghost_pad_new ("sink", - gst_element_get_pad (queue, "sink"))); - gst_element_link_many (queue, fakesink, NULL); - gst_element_link_many (fakesrc, pipeline2, NULL); - - for (x = 0; x < 10; x++) { - g_print ("playing %d\n", x); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_usleep (G_USEC_PER_SEC); - - g_print ("nulling %d\n", x); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_usleep (G_USEC_PER_SEC); - } - - exit (0); -} -- 2.7.4