summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/old/examples/Makefile.am14
-rw-r--r--tests/old/examples/level/Makefile.am11
-rw-r--r--tests/old/examples/level/README39
-rw-r--r--tests/old/examples/level/demo.c155
-rw-r--r--tests/old/examples/level/plot.c123
-rw-r--r--tests/old/examples/switch/.gitignore1
-rw-r--r--tests/old/examples/switch/Makefile.am7
-rw-r--r--tests/old/examples/switch/switcher.c104
8 files changed, 0 insertions, 454 deletions
diff --git a/tests/old/examples/Makefile.am b/tests/old/examples/Makefile.am
deleted file mode 100644
index 4620963e..00000000
--- a/tests/old/examples/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-if HAVE_GTK
-GTK_SUBDIRS=dynparams level $(FT2_SUBDIRS)
-else
-GTK_SUBDIRS=
-endif
-
-if USE_GCONF
-GCONF_SUBDIRS=gstplay
-else
-GCONF_SUBDIRS=
-endif
-
-SUBDIRS=$(GTK_SUBDIRS) $(GCONF_SUBDIRS) switch
-DIST_SUBDIRS=capsfilter dynparams indexing gstplay switch level
diff --git a/tests/old/examples/level/Makefile.am b/tests/old/examples/level/Makefile.am
deleted file mode 100644
index bf76136f..00000000
--- a/tests/old/examples/level/Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
-noinst_PROGRAMS = demo plot
-
-demo_SOURCES = demo.c
-demo_CFLAGS = $(GTK_CFLAGS) $(GST_CFLAGS)
-demo_LDFLAGS = $(GTK_LIBS) $(GST_LIBS)
-
-plot_SOURCES = plot.c
-plot_CFLAGS = $(GTK_CFLAGS) $(GST_CFLAGS)
-plot_LDFLAGS = $(GTK_LIBS) $(GST_LIBS)
-
-EXTRA_DIST = README
diff --git a/tests/old/examples/level/README b/tests/old/examples/level/README
deleted file mode 100644
index 0ae84188..00000000
--- a/tests/old/examples/level/README
+++ /dev/null
@@ -1,39 +0,0 @@
-level plugin by thomas <thomas@apestaart.org>
-
-this plugin signals:
- - running time since last EOS/start
- - channel
- - RMS level
- - peak level
- - decaying peak level
-over the given interval.
-
-This is useful for a VU meter display and for plotting out the signal graph.
-The VU meter can either display RMS, or display immediate peak level and
-have the falloff decaying peak level displayed as a line.
-
-The interval for signal emission, ttl of decay peak, and falloff of decay peak
-can all be set.
-
-The element only takes unsigned data in; it could be extended to signed as
-well, if separate fast chain functions are made that displaces the incoming
-data to its midpoint (ie, 0,65535 should be mapped to -32768, 32767)
-
-There are two demo apps, apps and plot. apps will create some GTK sliders
-to display the volume. plot will output data readable by gnuplot.
-
-Here is a sample plot script to plot output of the plot command that was
-stored to plot.dat
-
-set xlabel "Seconds"
-set ylabel "dB"
-set yrange [-60:0]
-plot 'plot.dat' using 1:2 title 'L RMS' with lines, \
- 'plot.dat' using 1:3 title 'L peak' with lines, \
- 'plot.dat' using 1:4 title 'L decay' with lines
-
-plot 'plot.dat' using 1:5 title 'R RMS' with lines, \
- 'plot.dat' using 1:6 title 'R peak' with lines, \
- 'plot.dat' using 1:7 title 'R decay' with lines
-
-
diff --git a/tests/old/examples/level/demo.c b/tests/old/examples/level/demo.c
deleted file mode 100644
index 366b54c3..00000000
--- a/tests/old/examples/level/demo.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/* GStreamer
- * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
- *
- * demo.c: sample application to display VU meter-like output of level
- * Copyright (C) 2003
- * Thomas Vander Stichele <thomas at apestaart dot org>
- *
- * 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gst/gst.h>
-#include <gtk/gtk.h>
-
-/* global array for the scale widgets, we'll assume stereo */
-GtkWidget *elapsed;
-GtkWidget *scale[2][3];
-
-static void
-level_callback (GstElement * element, gdouble time, gint channel,
- gdouble rms, gdouble peak, gdouble decay)
-{
- gchar *label;
-
- label = g_strdup_printf ("%.3f", time);
- gtk_label_set (GTK_LABEL (elapsed), label);
- g_free (label);
- gtk_range_set_value (GTK_RANGE (scale[channel][0]), rms);
- gtk_range_set_value (GTK_RANGE (scale[channel][1]), peak);
- gtk_range_set_value (GTK_RANGE (scale[channel][2]), decay);
-}
-
-static gboolean
-idler (gpointer data)
-{
- GstElement *pipeline = GST_ELEMENT (data);
-
- g_print ("+");
- if (gst_bin_iterate (GST_BIN (pipeline)))
- return TRUE;
- gtk_main_quit ();
- return FALSE;
-}
-
-static void
-setup_gui ()
-{
- GtkWidget *window;
- GtkWidget *vbox;
- GtkWidget *label, *hbox;
- int c;
-
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- g_signal_connect (window, "destroy", gtk_main_quit, NULL);
-
- vbox = gtk_vbox_new (TRUE, 0);
- gtk_container_add (GTK_CONTAINER (window), vbox);
-
- /* elapsed widget */
- hbox = gtk_hbox_new (TRUE, 0);
- label = gtk_label_new ("Elapsed");
- elapsed = gtk_label_new ("0.000");
- gtk_container_add (GTK_CONTAINER (hbox), label);
- gtk_container_add (GTK_CONTAINER (hbox), elapsed);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
-
- for (c = 0; c < 2; ++c) {
- /* RMS */
- hbox = gtk_hbox_new (TRUE, 0);
- label = gtk_label_new ("RMS");
- gtk_container_add (GTK_CONTAINER (hbox), label);
- scale[c][0] = gtk_hscale_new_with_range (-90.0, 0.0, 0.2);
- gtk_widget_set_size_request (scale[c][0], 100, -1);
- gtk_container_add (GTK_CONTAINER (hbox), scale[c][0]);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
- /* peak */
- hbox = gtk_hbox_new (TRUE, 0);
- label = gtk_label_new ("peak");
- gtk_container_add (GTK_CONTAINER (hbox), label);
- scale[c][1] = gtk_hscale_new_with_range (-90.0, 0.0, 0.2);
- gtk_widget_set_size_request (scale[c][1], 100, -1);
- gtk_container_add (GTK_CONTAINER (hbox), scale[c][1]);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
- /* decay */
- hbox = gtk_hbox_new (TRUE, 0);
- label = gtk_label_new ("decaying peek");
- gtk_container_add (GTK_CONTAINER (hbox), label);
- scale[c][2] = gtk_hscale_new_with_range (-90.0, 0.0, 0.2);
- gtk_widget_set_size_request (scale[c][2], 100, -1);
- gtk_container_add (GTK_CONTAINER (hbox), scale[c][2]);
- gtk_container_add (GTK_CONTAINER (vbox), hbox);
- }
-
- gtk_widget_show_all (GTK_WIDGET (window));
-}
-
-int
-main (int argc, char *argv[])
-{
-
- GstElement *pipeline = NULL;
- GError *error = NULL;
- GstElement *level;
-
- gst_init (&argc, &argv);
- gtk_init (&argc, &argv);
-
- pipeline = gst_parse_launchv ((const gchar **) &argv[1], &error);
- if (error) {
- g_print ("pipeline could not be constructed: %s\n", error->message);
- g_print ("Please give a complete pipeline with a 'level' element.\n");
- g_print ("Example: audiotestsrc ! level ! %s\n", DEFAULT_AUDIOSINK);
- g_error_free (error);
- return 1;
- }
-
- level = gst_bin_get_by_name (GST_BIN (pipeline), "level0");
- if (level == NULL) {
- g_print ("Please give a pipeline with a 'level' element in it\n");
- return 1;
- }
-
- g_object_set (level, "signal", TRUE, NULL);
- g_signal_connect (level, "level", G_CALLBACK (level_callback), NULL);
-
-
- /* setup GUI */
- setup_gui ();
-
- /* connect level signal */
-
- /* go to main loop */
- gst_element_set_state (pipeline, GST_STATE_PLAYING);
- g_idle_add (idler, pipeline);
-
- gtk_main ();
-
- return 0;
-}
diff --git a/tests/old/examples/level/plot.c b/tests/old/examples/level/plot.c
deleted file mode 100644
index 51ad2f7d..00000000
--- a/tests/old/examples/level/plot.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/* GStreamer
- * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
- *
- * plot.c: output data points to be graphed with gnuplot
- * Copyright (C) 2003
- * Thomas Vander Stichele <thomas at apestaart dot org>
- *
- * 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gst/gst.h>
-#include <gtk/gtk.h>
-
-gboolean got_channel[2] = { FALSE, FALSE }; /* to see if we got the signal for this one yet */
-gint channels = 0; /* guess at how many channels there are */
-gdouble last_time = 0.0; /* time of last signal */
-gdouble values[2][3]; /* array of levels from which to print */
-
-static void
-level_callback (GstElement * element, gdouble time, gint channel,
- gdouble rms, gdouble peak, gdouble decay)
-{
- int i = 0, j = 0;
- gboolean got_all = FALSE;
-
- if (channel + 1 > channels)
- channels = channel + 1;
-
- /* reset got_channel if this is a new time point */
- if (time > last_time) {
- for (i = 0; i < channels; ++i)
- got_channel[i] = FALSE;
- last_time = time;
- }
-
- /* store values */
- got_channel[channel] = TRUE;
- values[channel][0] = rms;
- values[channel][1] = peak;
- values[channel][2] = decay;
-
- /* check if we have all channels, and output if we do */
- /* FIXME: this fails on the first, no ? */
- got_all = TRUE;
- for (i = 0; i < channels; ++i)
- if (!got_channel[i])
- got_all = FALSE;
- if (got_all) {
- g_print ("%f ", time);
- for (i = 0; i < channels; ++i)
- for (j = 0; j < 3; ++j)
- g_print ("%f ", values[i][j]);
- g_print ("\n");
- }
-}
-
-static gboolean
-idler (gpointer data)
-{
- GstElement *pipeline = GST_ELEMENT (data);
-
- if (gst_bin_iterate (GST_BIN (pipeline)))
- return TRUE;
-
- gtk_main_quit ();
- return FALSE;
-}
-
-int
-main (int argc, char *argv[])
-{
-
- GstElement *pipeline = NULL;
- GError *error = NULL;
- GstElement *level;
-
- gst_init (&argc, &argv);
- gtk_init (&argc, &argv);
-
- pipeline = gst_parse_launchv ((const gchar **) &argv[1], &error);
- if (error) {
- g_print ("pipeline could not be constructed: %s\n", error->message);
- g_print ("Please give a complete pipeline with a 'level' element.\n");
- g_print ("Example: audiotestsrc ! level ! %s\n", DEFAULT_AUDIOSINK);
- g_error_free (error);
- return 1;
- }
-
- level = gst_bin_get_by_name (GST_BIN (pipeline), "level0");
- if (level == NULL) {
- g_print ("Please give a pipeline with a 'level' element in it\n");
- return 1;
- }
-
- g_object_set (level, "signal", TRUE, NULL);
- g_signal_connect (level, "level", G_CALLBACK (level_callback), NULL);
-
-
- /* go to main loop */
- gst_element_set_state (pipeline, GST_STATE_PLAYING);
- g_idle_add (idler, pipeline);
-
- gtk_main ();
-
- return 0;
-}
diff --git a/tests/old/examples/switch/.gitignore b/tests/old/examples/switch/.gitignore
deleted file mode 100644
index 7893c435..00000000
--- a/tests/old/examples/switch/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-switcher
diff --git a/tests/old/examples/switch/Makefile.am b/tests/old/examples/switch/Makefile.am
deleted file mode 100644
index 9a706048..00000000
--- a/tests/old/examples/switch/Makefile.am
+++ /dev/null
@@ -1,7 +0,0 @@
-
-noinst_PROGRAMS = switcher
-
-switcher_SOURCES = switcher.c
-switcher_CFLAGS = $(GST_CFLAGS)
-switcher_LDFLAGS = $(GST_LIBS)
-
diff --git a/tests/old/examples/switch/switcher.c b/tests/old/examples/switch/switcher.c
deleted file mode 100644
index 92bf501e..00000000
--- a/tests/old/examples/switch/switcher.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* GStreamer
- * Copyright (C) 2003 Julien Moutte <julien@moutte.net>
- *
- * 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gst/gst.h>
-
-static GMainLoop *loop = NULL;
-
-
-
-static void
-got_eos (GstElement * pipeline)
-{
- g_main_loop_quit (loop);
-}
-
-static gboolean
-idle_iterate (GstElement * pipeline)
-{
- gst_bin_iterate (GST_BIN (pipeline));
- return (GST_STATE (GST_ELEMENT (pipeline)) == GST_STATE_PLAYING);
-}
-
-static gboolean
-switch_timer (GstElement * video_switch)
-{
- gint nb_sources, active_source;
-
- g_object_get (G_OBJECT (video_switch), "nb_sources", &nb_sources, NULL);
- g_object_get (G_OBJECT (video_switch), "active_source", &active_source, NULL);
-
- active_source++;
-
- if (active_source > nb_sources - 1)
- active_source = 0;
-
- g_object_set (G_OBJECT (video_switch), "active_source", active_source, NULL);
-
- g_message ("current number of sources : %d, active source %d",
- nb_sources, active_source);
-
- return (GST_STATE (GST_ELEMENT (video_switch)) == GST_STATE_PLAYING);
-}
-
-int
-main (int argc, char *argv[])
-{
- GstElement *pipeline, *src1, *src2, *video_switch, *video_sink;
-
- /* Initing GStreamer library */
- gst_init (&argc, &argv);
-
- loop = g_main_loop_new (NULL, FALSE);
-
- pipeline = gst_pipeline_new ("pipeline");
- src1 = gst_element_factory_make ("videotestsrc", "src1");
- g_object_set (G_OBJECT (src1), "pattern", 0, NULL);
- src2 = gst_element_factory_make ("videotestsrc", "src2");
- g_object_set (G_OBJECT (src2), "pattern", 1, NULL);
- video_switch = gst_element_factory_make ("switch", "video_switch");
- video_sink = gst_element_factory_make (DEFAULT_VIDEOSINK, "video_sink");
-
- gst_bin_add_many (GST_BIN (pipeline), src1, src2, video_switch,
- video_sink, NULL);
-
- gst_element_link (src1, video_switch);
- gst_element_link (src2, video_switch);
- gst_element_link (video_switch, video_sink);
-
- g_signal_connect (G_OBJECT (pipeline), "eos", G_CALLBACK (got_eos), NULL);
-
- gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_PLAYING);
-
- g_idle_add ((GSourceFunc) idle_iterate, pipeline);
- g_timeout_add (2000, (GSourceFunc) switch_timer, video_switch);
-
- g_main_loop_run (loop);
-
- gst_element_set_state (GST_ELEMENT (pipeline), GST_STATE_READY);
-
- /* unref */
- gst_object_unref (GST_OBJECT (pipeline));
-
- exit (0);
-}