From d0ab9172c57379263c019bb4ae835de71e690038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Wed, 14 Aug 2013 19:12:16 +0100 Subject: [PATCH] examples: remove prehistoric examples --- tests/examples/capsfilter/Makefile.am | 6 - tests/examples/capsfilter/capsfilter1.c | 87 ------- tests/examples/gstplay/.gitignore | 1 - tests/examples/gstplay/Makefile.am | 11 - tests/examples/gstplay/player.c | 176 ------------- tests/examples/indexing/.gitignore | 1 - tests/examples/indexing/Makefile.am | 7 - tests/examples/indexing/indexmpeg.c | 321 ------------------------ tests/examples/level/Makefile.am | 11 - tests/examples/level/README | 39 --- tests/examples/level/demo.c | 155 ------------ tests/examples/level/plot.c | 124 --------- 12 files changed, 939 deletions(-) delete mode 100644 tests/examples/capsfilter/Makefile.am delete mode 100644 tests/examples/capsfilter/capsfilter1.c delete mode 100644 tests/examples/gstplay/.gitignore delete mode 100644 tests/examples/gstplay/Makefile.am delete mode 100644 tests/examples/gstplay/player.c delete mode 100644 tests/examples/indexing/.gitignore delete mode 100644 tests/examples/indexing/Makefile.am delete mode 100644 tests/examples/indexing/indexmpeg.c delete mode 100644 tests/examples/level/Makefile.am delete mode 100644 tests/examples/level/README delete mode 100644 tests/examples/level/demo.c delete mode 100644 tests/examples/level/plot.c diff --git a/tests/examples/capsfilter/Makefile.am b/tests/examples/capsfilter/Makefile.am deleted file mode 100644 index f8562fee72..0000000000 --- a/tests/examples/capsfilter/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -noinst_PROGRAMS = capsfilter1 - -LDADD = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) - - diff --git a/tests/examples/capsfilter/capsfilter1.c b/tests/examples/capsfilter/capsfilter1.c deleted file mode 100644 index 861256b6f2..0000000000 --- a/tests/examples/capsfilter/capsfilter1.c +++ /dev/null @@ -1,87 +0,0 @@ -#include -#include - -/* This app uses a filter to connect colorspace and videosink - * so that only RGB data can pass the connection, colorspace will use - * a converter to convert the I420 data to RGB. Without a filter, this - * connection would use the I420 format (assuming Xv is enabled) */ - -static void -new_pad_func (GstElement * element, GstPad * newpad, gpointer data) -{ - GstElement *pipeline = (GstElement *) data; - GstElement *queue = gst_bin_get_by_name (GST_BIN (pipeline), "queue"); - - if (!strcmp (gst_pad_get_name (newpad), "video_00")) { - gst_element_set_state (pipeline, GST_STATE_PAUSED); - gst_pad_link (newpad, gst_element_get_pad (queue, "sink")); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - } -} - -gint -main (gint argc, gchar * argv[]) -{ - GstElement *pipeline; - GstElement *filesrc; - GstElement *demux; - GstElement *thread; - GstElement *queue; - GstElement *mpeg2dec; - GstElement *colorspace; - GstElement *videosink; - gboolean res; - - gst_init (&argc, &argv); - - if (argc < 2) { - g_print ("usage: %s \n", argv[0]); - return (-1); - } - - pipeline = gst_pipeline_new ("main_pipeline"); - filesrc = gst_element_factory_make ("filesrc", "filesrc"); - g_return_val_if_fail (filesrc, -1); - g_object_set (G_OBJECT (filesrc), "location", argv[1], NULL); - demux = gst_element_factory_make ("mpegdemux", "demux"); - g_return_val_if_fail (demux, -1); - g_signal_connect (G_OBJECT (demux), "new_pad", G_CALLBACK (new_pad_func), - pipeline); - - thread = gst_thread_new ("thread"); - queue = gst_element_factory_make ("queue", "queue"); - mpeg2dec = gst_element_factory_make ("mpeg2dec", "mpeg2dec"); - g_return_val_if_fail (mpeg2dec, -1); - colorspace = gst_element_factory_make ("videoconvert", "colorspace"); - g_return_val_if_fail (colorspace, -1); - videosink = gst_element_factory_make (DEFAULT_VIDEOSINK, "videosink"); - g_return_val_if_fail (videosink, -1); - - gst_bin_add (GST_BIN (pipeline), filesrc); - gst_bin_add (GST_BIN (pipeline), demux); - - gst_bin_add (GST_BIN (thread), queue); - gst_bin_add (GST_BIN (thread), mpeg2dec); - gst_bin_add (GST_BIN (thread), colorspace); - gst_bin_add (GST_BIN (thread), videosink); - gst_bin_add (GST_BIN (pipeline), thread); - - gst_element_link_pads (filesrc, "src", demux, "sink"); - gst_element_link_pads (queue, "src", mpeg2dec, "sink"); - gst_element_link_pads (mpeg2dec, "src", colorspace, "sink"); - /* force RGB data passing between colorspace and videosink */ - res = gst_element_link_pads_filtered (colorspace, "src", videosink, "sink", - gst_caps_new_simple ("video/x-raw-rgb", NULL)); - if (!res) { - g_print ("could not connect colorspace and videosink\n"); - return -1; - } - - gst_element_set_state (pipeline, GST_STATE_PLAYING); - - while (gst_bin_iterate (GST_BIN (pipeline))); - - gst_element_set_state (pipeline, GST_STATE_NULL); - - return 0; -} diff --git a/tests/examples/gstplay/.gitignore b/tests/examples/gstplay/.gitignore deleted file mode 100644 index a1eb1c4331..0000000000 --- a/tests/examples/gstplay/.gitignore +++ /dev/null @@ -1 +0,0 @@ -player diff --git a/tests/examples/gstplay/Makefile.am b/tests/examples/gstplay/Makefile.am deleted file mode 100644 index 6d7cf3afc3..0000000000 --- a/tests/examples/gstplay/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ - -noinst_PROGRAMS = player - -player_SOURCES = player.c -player_CFLAGS = $(GST_CFLAGS) $(GCONF_CFLAGS) -player_LDFLAGS = \ - $(GST_LIBS) \ - $(top_builddir)/gst-libs/gst/gconf/libgstgconf-@GST_API_VERSION@.la \ - $(top_builddir)/gst-libs/gst/play/libgstplay-@GST_API_VERSION@.la \ - $(top_builddir)/gst-libs/gst/libgstinterfaces-$(GST_API_VERSION).la - diff --git a/tests/examples/gstplay/player.c b/tests/examples/gstplay/player.c deleted file mode 100644 index 9b958be319..0000000000 --- a/tests/examples/gstplay/player.c +++ /dev/null @@ -1,176 +0,0 @@ -/* GStreamer - * Copyright (C) 2003 Julien Moutte - * - * 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., 51 Franklin St, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include -#include - -static GMainLoop *loop = NULL; -static gint64 length = 0; - -static void -print_tag (const GstTagList * list, const gchar * tag, gpointer unused) -{ - gint i, count; - - count = gst_tag_list_get_tag_size (list, tag); - - for (i = 0; i < count; i++) { - gchar *str; - - if (gst_tag_get_type (tag) == G_TYPE_STRING) { - if (!gst_tag_list_get_string_index (list, tag, i, &str)) - g_assert_not_reached (); - } else { - str = - g_strdup_value_contents (gst_tag_list_get_value_index (list, tag, i)); - } - - if (i == 0) { - g_print ("%15s: %s\n", gst_tag_get_nick (tag), str); - } else { - g_print (" : %s\n", str); - } - - g_free (str); - } -} - -static void -got_found_tag (GstPlay * play, GstElement * source, GstTagList * tag_list) -{ - gst_tag_list_foreach (tag_list, print_tag, NULL); -} - -static void -got_time_tick (GstPlay * play, gint64 time_nanos) -{ - g_print ("time tick %f\n", time_nanos / (float) GST_SECOND); -} - -static void -got_stream_length (GstPlay * play, gint64 length_nanos) -{ - g_print ("got length %" G_GUINT64_FORMAT "\n", length_nanos); - length = length_nanos; -} - -static void -got_video_size (GstPlay * play, gint width, gint height) -{ - g_print ("got video size %d, %d\n", width, height); -} - -static void -got_eos (GstPlay * play) -{ - g_print ("End Of Stream\n"); - g_main_loop_quit (loop); -} - -static gboolean -seek_timer (GstPlay * play) -{ - gst_play_seek_to_time (play, length / 2); - return FALSE; -} - -int -main (int argc, char *argv[]) -{ - GstPlay *play; - GstElement *data_src, *video_sink, *audio_sink, *vis_element; - GError *error = NULL; - - /* Initing GStreamer library */ - gst_init (&argc, &argv); - - if (argc != 2) { - g_print ("usage: %s