diff options
Diffstat (limited to 'tests/icles/dccp')
-rw-r--r-- | tests/icles/dccp/README | 52 | ||||
-rw-r--r-- | tests/icles/dccp/call/DCCPClient.c | 152 | ||||
-rw-r--r-- | tests/icles/dccp/call/DCCPServer.c | 145 | ||||
-rw-r--r-- | tests/icles/dccp/call/README | 1 | ||||
-rw-r--r-- | tests/icles/dccp/file/DCCPClientSaveFile.c | 113 | ||||
-rw-r--r-- | tests/icles/dccp/file/DCCPServerSendFile.c | 112 | ||||
-rw-r--r-- | tests/icles/dccp/mic/DCCPClientPlayMic.c | 116 | ||||
-rw-r--r-- | tests/icles/dccp/mic/DCCPServerMic.c | 111 | ||||
-rw-r--r-- | tests/icles/dccp/mp3/DCCPClientPlayMP3.c | 117 | ||||
-rw-r--r-- | tests/icles/dccp/mp3/DCCPServerSendMP3.c | 113 | ||||
-rw-r--r-- | tests/icles/dccp/mp3Speex/DCCPClientPlaySpeexMP3.c | 120 | ||||
-rw-r--r-- | tests/icles/dccp/mp3Speex/DCCPServerSendSpeexMP3.c | 128 | ||||
-rw-r--r-- | tests/icles/dccp/mp3Stream/DCCPClientPlayMP3Stream.c | 113 | ||||
-rw-r--r-- | tests/icles/dccp/mp3Stream/DCCPServerSendMP3Stream.c | 113 |
14 files changed, 0 insertions, 1506 deletions
diff --git a/tests/icles/dccp/README b/tests/icles/dccp/README deleted file mode 100644 index e76ead5e5..000000000 --- a/tests/icles/dccp/README +++ /dev/null @@ -1,52 +0,0 @@ -Applications - -If you want to compile the applications you will need to run this command-line: -gcc -Wall $(pkg-config --cflags --libs gstreamer-0.10) <applicationName>.c -o <applicationName> - -To run: -./<applicationName> - - -Command-line - -###### Pipe to transmit a file # - -* Server: -gst-launch -v filesrc location=file ! dccpserversink port=9011 ccid=2 - -* Client: -gst-launch -v dccpclientsrc host=localhost port=9011 ccid=2 ! filesink location=fileDist - -###### Pipe to transmit from the microphone # - -* Server: -gst-launch -v alsasrc ! dccpserversink port=9011 ccid=2 - -* Client: -gst-launch -v dccpclientsrc host=localhost port=9011 ccid=2 caps="audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100, channels=(int)2" ! alsasink - -###### Pipe to transmit a MP3 # - -* Server: -gst-launch -v filesrc location=music.mp3 ! mad ! dccpserversink port=9011 ccid=2 - -* Client: -gst-launch -v dccpclientsrc host=localhost port=9011 ccid=2 caps="audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100, channels=(int)2" ! alsasink - -###### Pipe to stream a MP3 # - -* Server: -gst-launch -v filesrc location=music.mp3 ! mp3parse ! dccpserversink port=9011 ccid=2 - -* Client: -gst-launch -v dccpclientsrc host=localhost port=9011 ccid=2 ! decodebin ! alsasink --- We also tested with mpg123, to use it: mpg123 dccp://localhost:9011 - -###### Pipe to transmit a MP3 with dccp, speex and rtp # - -* Server: -gst-launch -v filesrc location=music.mp3 ! mad ! audioconvert ! capsfilter caps="audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)1" ! speexenc ! rtpspeexpay ! dccpserversink port=9011 ccid=2 - -* Client: -gst-launch -v dccpclientsrc host=localhost port=9011 ccid=2 caps="application/x-rtp, media=(string)audio, payload=(int)110, clock-rate=(int)44100, encoding-name=(string)SPEEX, ssrc=(guint)152981653, clock-base=(guint)1553719649, seqnum-base=(guint)3680, encoding-params=(string)1" ! rtpspeexdepay ! speexdec ! alsasink - diff --git a/tests/icles/dccp/call/DCCPClient.c b/tests/icles/dccp/call/DCCPClient.c deleted file mode 100644 index 5f7eb019c..000000000 --- a/tests/icles/dccp/call/DCCPClient.c +++ /dev/null @@ -1,152 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - -void -start_dccpserversink_pipe (GstElement * object, gint socket, gpointer data) -{ - GstElement *dccpserversink = (GstElement *) data; - g_object_set (G_OBJECT (dccpserversink), "sockfd", socket, NULL); - - g_print ("Setting pipelinesink to PLAYING\n"); - GstElement *pipelinesink = - (GstElement *) gst_element_get_parent (dccpserversink); - gst_element_set_state (pipelinesink, GST_STATE_PLAYING); - gst_object_unref (pipelinesink); -} - - -int -main (int argc, char *argv[]) -{ - - GstElement *pipelinesink, *alsasrc, *dccpserversink; - GstElement *pipelinesrc, *alsasink, *dccpclientsrc; - GMainLoop *loop; - GstBus *bus; - GstCaps *caps; - - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* check input arguments */ - if (argc != 2) { - g_print ("%s\n", "see usage: serverHost"); - return -1; - } - - /* create elements */ - pipelinesink = gst_pipeline_new ("audio-sender"); - alsasrc = gst_element_factory_make ("alsasrc", "alsa-source"); - dccpserversink = gst_element_factory_make ("dccpserversink", "server-sink"); - pipelinesrc = gst_pipeline_new ("audio-receiver"); - alsasink = gst_element_factory_make ("alsasink", "alsa-sink"); - dccpclientsrc = gst_element_factory_make ("dccpclientsrc", "client-source"); - - - if (!pipelinesink || !alsasrc || !dccpserversink || !pipelinesrc || !alsasink - || !dccpclientsrc) { - g_print ("One element could not be created\n"); - return -1; - } - - caps = - gst_caps_from_string - ("audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100, channels=(int)2"); - g_object_set (G_OBJECT (dccpclientsrc), "caps", caps, NULL); - - g_object_set (G_OBJECT (dccpclientsrc), "host", argv[1], NULL); - /*g_object_set (G_OBJECT (dccpclientsrc), "ccid", 3, NULL); - g_object_set (G_OBJECT (dccpserversink), "ccid", 3, NULL); */ - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipelinesink)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipelinesrc)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipelinesink), alsasrc, dccpserversink, NULL); - gst_element_link_many (alsasrc, dccpserversink, NULL); - - gst_bin_add_many (GST_BIN (pipelinesrc), dccpclientsrc, alsasink, NULL); - gst_element_link (dccpclientsrc, alsasink); - - g_signal_connect (dccpclientsrc, "connected", - (GCallback) start_dccpserversink_pipe, dccpserversink); - - /* Now set to playing and iterate. */ - g_print ("Setting pipelinesrc to PLAYING\n"); - gst_element_set_state (pipelinesrc, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipelinesink, GST_STATE_NULL); - g_print ("Deleting pipelinesink\n"); - gst_object_unref (GST_OBJECT (pipelinesink)); - - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipelinesrc, GST_STATE_NULL); - g_print ("Deleting pipelinesrc\n"); - gst_object_unref (GST_OBJECT (pipelinesrc)); - - - return 0; -} diff --git a/tests/icles/dccp/call/DCCPServer.c b/tests/icles/dccp/call/DCCPServer.c deleted file mode 100644 index fe0e34fa2..000000000 --- a/tests/icles/dccp/call/DCCPServer.c +++ /dev/null @@ -1,145 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - -void -start_dccpclientsrc_pipe (GstElement * object, gint socket, gpointer data) -{ - GstElement *dccpclientsrc = (GstElement *) data; - g_object_set (G_OBJECT (dccpclientsrc), "sockfd", socket, NULL); - - g_print ("Setting pipelinesrc to PLAYING\n"); - GstElement *pipelinesrc = - (GstElement *) gst_element_get_parent (dccpclientsrc); - gst_element_set_state (pipelinesrc, GST_STATE_PLAYING); - gst_object_unref (pipelinesrc); -} - - -int -main (int argc, char *argv[]) -{ - - GstElement *pipelinesink, *alsasrc, *dccpserversink; - GstElement *pipelinesrc, *alsasink, *dccpclientsrc; - GMainLoop *loop; - GstBus *bus; - GstCaps *caps; - - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* create elements */ - pipelinesink = gst_pipeline_new ("audio-sender"); - alsasrc = gst_element_factory_make ("alsasrc", "alsa-source"); - dccpserversink = gst_element_factory_make ("dccpserversink", "server-sink"); - pipelinesrc = gst_pipeline_new ("audio-receiver"); - alsasink = gst_element_factory_make ("alsasink", "alsa-sink"); - dccpclientsrc = gst_element_factory_make ("dccpclientsrc", "client-source"); - - - if (!pipelinesink || !alsasrc || !dccpserversink || !pipelinesrc || !alsasink - || !dccpclientsrc) { - g_print ("One element could not be created\n"); - return -1; - } - - caps = - gst_caps_from_string - ("audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100, channels=(int)2"); - g_object_set (G_OBJECT (dccpclientsrc), "caps", caps, NULL); - - /*g_object_set (G_OBJECT (dccpclientsrc), "ccid", 3, NULL); - g_object_set (G_OBJECT (dccpserversink), "ccid", 3, NULL); */ - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipelinesink)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipelinesrc)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipelinesink), alsasrc, dccpserversink, NULL); - gst_element_link_many (alsasrc, dccpserversink, NULL); - - gst_bin_add_many (GST_BIN (pipelinesrc), dccpclientsrc, alsasink, NULL); - gst_element_link (dccpclientsrc, alsasink); - - g_signal_connect (dccpserversink, "connected", - (GCallback) start_dccpclientsrc_pipe, dccpclientsrc); - - /* Now set to playing and iterate. */ - g_print ("Setting pipelinesink to PLAYING\n"); - gst_element_set_state (pipelinesink, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipelinesink, GST_STATE_NULL); - g_print ("Deleting pipelinesink\n"); - gst_object_unref (GST_OBJECT (pipelinesink)); - - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipelinesrc, GST_STATE_NULL); - g_print ("Deleting pipelinesrc\n"); - gst_object_unref (GST_OBJECT (pipelinesrc)); - - - return 0; -} diff --git a/tests/icles/dccp/call/README b/tests/icles/dccp/call/README deleted file mode 100644 index ed53abd65..000000000 --- a/tests/icles/dccp/call/README +++ /dev/null @@ -1 +0,0 @@ -This application tests the socket sharing. diff --git a/tests/icles/dccp/file/DCCPClientSaveFile.c b/tests/icles/dccp/file/DCCPClientSaveFile.c deleted file mode 100644 index cdd7fe29e..000000000 --- a/tests/icles/dccp/file/DCCPClientSaveFile.c +++ /dev/null @@ -1,113 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - - -int -main (int argc, char *argv[]) -{ - - GMainLoop *loop; - GstBus *bus; - GstElement *pipeline, *filesink, *dccpclientsrc; - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* check input arguments */ - if (argc != 4) { - g_print ("%s\n", "see usage: serverHost serverPort location"); - return -1; - } - - /* create elements */ - pipeline = gst_pipeline_new ("audio-sender"); - filesink = gst_element_factory_make ("filesink", "file-sink"); - dccpclientsrc = gst_element_factory_make ("dccpclientsrc", "client-source"); - - - if (!pipeline || !filesink || !dccpclientsrc) { - g_print ("One element could not be created\n"); - return -1; - } - - g_object_set (G_OBJECT (dccpclientsrc), "host", argv[1], NULL); - g_object_set (G_OBJECT (dccpclientsrc), "port", atoi (argv[2]), NULL); - /*g_object_set (G_OBJECT (dccpclientsrc), "ccid", 3, NULL); */ - g_object_set (G_OBJECT (filesink), "location", argv[3], NULL); - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipeline), dccpclientsrc, filesink, NULL); - - gst_element_link (dccpclientsrc, filesink); - - - /* Now set to playing and iterate. */ - g_print ("Setting to PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_print ("Deleting pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); - - return 0; -} diff --git a/tests/icles/dccp/file/DCCPServerSendFile.c b/tests/icles/dccp/file/DCCPServerSendFile.c deleted file mode 100644 index 768381fe0..000000000 --- a/tests/icles/dccp/file/DCCPServerSendFile.c +++ /dev/null @@ -1,112 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - - -int -main (int argc, char *argv[]) -{ - - GMainLoop *loop; - GstBus *bus; - GstElement *pipeline, *filesrc, *dccpserversink; - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* check input arguments */ - if (argc != 3) { - g_print ("%s\n", "see usage: port mp3Location"); - return -1; - } - - /* create elements */ - pipeline = gst_pipeline_new ("audio-sender"); - filesrc = gst_element_factory_make ("filesrc", "file-source"); - dccpserversink = gst_element_factory_make ("dccpserversink", "server-sink"); - - - if (!pipeline || !filesrc || !dccpserversink) { - g_print ("One element could not be created\n"); - return -1; - } - - g_object_set (G_OBJECT (dccpserversink), "port", atoi (argv[1]), NULL); - /*g_object_set (G_OBJECT (dccpserversink), "ccid", 3, NULL); */ - g_object_set (G_OBJECT (filesrc), "location", argv[2], NULL); - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipeline), filesrc, dccpserversink, NULL); - - gst_element_link_many (filesrc, dccpserversink, NULL); - - - /* Now set to playing and iterate. */ - g_print ("Setting to PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_print ("Deleting pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); - - return 0; -} diff --git a/tests/icles/dccp/mic/DCCPClientPlayMic.c b/tests/icles/dccp/mic/DCCPClientPlayMic.c deleted file mode 100644 index 4cd0c3b52..000000000 --- a/tests/icles/dccp/mic/DCCPClientPlayMic.c +++ /dev/null @@ -1,116 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - - -int -main (int argc, char *argv[]) -{ - - GMainLoop *loop; - GstBus *bus; - GstElement *pipeline, *alsasink, *dccpclientsrc; - GstCaps *caps; - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* check input arguments */ - if (argc != 3) { - g_print ("%s\n", "see usage: serverHost serverPort"); - return -1; - } - - /* create elements */ - pipeline = gst_pipeline_new ("audio-receiver"); - alsasink = gst_element_factory_make ("alsasink", "alsa-sink"); - dccpclientsrc = gst_element_factory_make ("dccpclientsrc", "client-source"); - - if (!pipeline || !alsasink || !dccpclientsrc) { - g_print ("One element could not be created\n"); - return -1; - } - - caps = - gst_caps_from_string - ("audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100, channels=(int)2"); - - g_object_set (G_OBJECT (dccpclientsrc), "caps", caps, NULL); - g_object_set (G_OBJECT (dccpclientsrc), "host", argv[1], NULL); - g_object_set (G_OBJECT (dccpclientsrc), "port", atoi (argv[2]), NULL); - /*g_object_set (G_OBJECT (dccpclientsrc), "ccid", 3, NULL); */ - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipeline), dccpclientsrc, alsasink, NULL); - - gst_element_link (dccpclientsrc, alsasink); - - /* Now set to playing and iterate. */ - g_print ("Setting to PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_print ("Deleting pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); - - return 0; -} diff --git a/tests/icles/dccp/mic/DCCPServerMic.c b/tests/icles/dccp/mic/DCCPServerMic.c deleted file mode 100644 index d40119802..000000000 --- a/tests/icles/dccp/mic/DCCPServerMic.c +++ /dev/null @@ -1,111 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - - -int -main (int argc, char *argv[]) -{ - - GMainLoop *loop; - GstBus *bus; - GstElement *pipeline, *alsasrc, *dccpserversink; - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* check input arguments */ - if (argc != 2) { - g_print ("%s\n", "see usage: port"); - return -1; - } - - /* create elements */ - pipeline = gst_pipeline_new ("audio-sender"); - alsasrc = gst_element_factory_make ("alsasrc", "alsa-source"); - dccpserversink = gst_element_factory_make ("dccpserversink", "server-sink"); - - - if (!pipeline || !alsasrc || !dccpserversink) { - g_print ("One element could not be created\n"); - return -1; - } - - g_object_set (G_OBJECT (dccpserversink), "port", atoi (argv[1]), NULL); - /*g_object_set (G_OBJECT (dccpserversink), "ccid", 3, NULL); */ - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipeline), alsasrc, dccpserversink, NULL); - - gst_element_link_many (alsasrc, dccpserversink, NULL); - - - /* Now set to playing and iterate. */ - g_print ("Setting to PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_print ("Deleting pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); - - return 0; -} diff --git a/tests/icles/dccp/mp3/DCCPClientPlayMP3.c b/tests/icles/dccp/mp3/DCCPClientPlayMP3.c deleted file mode 100644 index ac55d25d0..000000000 --- a/tests/icles/dccp/mp3/DCCPClientPlayMP3.c +++ /dev/null @@ -1,117 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - - -int -main (int argc, char *argv[]) -{ - - GMainLoop *loop; - GstBus *bus; - GstElement *pipeline, *alsasink, *dccpclientsrc; - GstCaps *caps; - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* check input arguments */ - if (argc != 3) { - g_print ("%s\n", "see usage: serverHost serverPort"); - return -1; - } - - /* create elements */ - pipeline = gst_pipeline_new ("audio-sender"); - alsasink = gst_element_factory_make ("alsasink", "alsa-sink"); - dccpclientsrc = gst_element_factory_make ("dccpclientsrc", "client-source"); - - if (!pipeline || !alsasink || !dccpclientsrc) { - g_print ("One element could not be created\n"); - return -1; - } - - caps = - gst_caps_from_string - ("audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)32, depth=(int)32, rate=(int)44100, channels=(int)2"); - g_object_set (G_OBJECT (dccpclientsrc), "caps", caps, NULL); - gst_object_unref (caps); - - g_object_set (G_OBJECT (dccpclientsrc), "host", argv[1], NULL); - g_object_set (G_OBJECT (dccpclientsrc), "port", atoi (argv[2]), NULL); - /*g_object_set (G_OBJECT (dccpclientsrc), "ccid", 2, NULL); */ - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipeline), dccpclientsrc, alsasink, NULL); - - gst_element_link_many (dccpclientsrc, alsasink, NULL); - - /* Now set to playing and iterate. */ - g_print ("Setting to PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_print ("Deleting pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); - - return 0; -} diff --git a/tests/icles/dccp/mp3/DCCPServerSendMP3.c b/tests/icles/dccp/mp3/DCCPServerSendMP3.c deleted file mode 100644 index a7d9d5da6..000000000 --- a/tests/icles/dccp/mp3/DCCPServerSendMP3.c +++ /dev/null @@ -1,113 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - - -int -main (int argc, char *argv[]) -{ - - GMainLoop *loop; - GstBus *bus; - GstElement *pipeline, *filesrc, *dccpserversink, *mad; - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* check input arguments */ - if (argc != 3) { - g_print ("%s\n", "see usage: port mp3Location"); - return -1; - } - - /* create elements */ - pipeline = gst_pipeline_new ("audio-sender"); - filesrc = gst_element_factory_make ("filesrc", "file-source"); - mad = gst_element_factory_make ("mad", "mad"); - dccpserversink = gst_element_factory_make ("dccpserversink", "server-sink"); - - - if (!pipeline || !filesrc || !dccpserversink || !mad) { - g_print ("One element could not be created\n"); - return -1; - } - - g_object_set (G_OBJECT (dccpserversink), "port", atoi (argv[1]), NULL); - /*g_object_set (G_OBJECT (dccpserversink), "ccid", 2, NULL); */ - g_object_set (G_OBJECT (filesrc), "location", argv[2], NULL); - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipeline), filesrc, mad, dccpserversink, NULL); - - gst_element_link_many (filesrc, mad, dccpserversink, NULL); - - - /* Now set to playing and iterate. */ - g_print ("Setting to PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_print ("Deleting pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); - - return 0; -} diff --git a/tests/icles/dccp/mp3Speex/DCCPClientPlaySpeexMP3.c b/tests/icles/dccp/mp3Speex/DCCPClientPlaySpeexMP3.c deleted file mode 100644 index 4d260f2a6..000000000 --- a/tests/icles/dccp/mp3Speex/DCCPClientPlaySpeexMP3.c +++ /dev/null @@ -1,120 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - - -int -main (int argc, char *argv[]) -{ - - GMainLoop *loop; - GstBus *bus; - GstElement *pipeline, *alsasink, *rtpspeexdepay, *speexdec, *dccpclientsrc; - GstCaps *caps; - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* check input arguments */ - if (argc != 3) { - g_print ("%s\n", "see usage: serverHost serverPort"); - return -1; - } - - /* create elements */ - pipeline = gst_pipeline_new ("audio-sender"); - alsasink = gst_element_factory_make ("alsasink", "alsa-sink"); - rtpspeexdepay = gst_element_factory_make ("rtpspeexdepay", "rtpspeexdepay"); - speexdec = gst_element_factory_make ("speexdec", "speexdec"); - dccpclientsrc = gst_element_factory_make ("dccpclientsrc", "client-source"); - - if (!pipeline || !alsasink || !rtpspeexdepay || !speexdec || !dccpclientsrc) { - g_print ("One element could not be created\n"); - return -1; - } - - caps = - gst_caps_from_string - ("application/x-rtp, media=(string)audio, payload=(int)110, clock-rate=(int)44100, encoding-name=(string)SPEEX, ssrc=(guint)152981653, clock-base=(guint)1553719649, seqnum-base=(guint)3680, encoding-params=(string)1"); - g_object_set (G_OBJECT (dccpclientsrc), "caps", caps, NULL); - gst_object_unref (caps); - - g_object_set (G_OBJECT (dccpclientsrc), "host", argv[1], NULL); - g_object_set (G_OBJECT (dccpclientsrc), "port", atoi (argv[2]), NULL); - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipeline), dccpclientsrc, rtpspeexdepay, speexdec, - alsasink, NULL); - - gst_element_link_many (dccpclientsrc, rtpspeexdepay, speexdec, alsasink, - NULL); - - /* Now set to playing and iterate. */ - g_print ("Setting to PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_print ("Deleting pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); - - return 0; -} diff --git a/tests/icles/dccp/mp3Speex/DCCPServerSendSpeexMP3.c b/tests/icles/dccp/mp3Speex/DCCPServerSendSpeexMP3.c deleted file mode 100644 index a5d9e0d7d..000000000 --- a/tests/icles/dccp/mp3Speex/DCCPServerSendSpeexMP3.c +++ /dev/null @@ -1,128 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - - -int -main (int argc, char *argv[]) -{ - - GMainLoop *loop; - GstBus *bus; - GstElement *pipeline, *filesrc, *mad, *audioconvert, *capsfilter, *speexenc, - *rtpspeexpay, *dccpserversink; - GstCaps *caps; - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* check input arguments */ - if (argc != 3) { - g_print ("%s\n", "see usage: port mp3Location"); - return -1; - } - - /* create elements */ - pipeline = gst_pipeline_new ("audio-sender"); - filesrc = gst_element_factory_make ("filesrc", "file-source"); - mad = gst_element_factory_make ("mad", "mad"); - audioconvert = gst_element_factory_make ("audioconvert", "audioconvert"); - capsfilter = gst_element_factory_make ("capsfilter", "capsfilter"); - speexenc = gst_element_factory_make ("speexenc", "speexenc"); - rtpspeexpay = gst_element_factory_make ("rtpspeexpay", "rtpspeexpay"); - dccpserversink = gst_element_factory_make ("dccpserversink", "server-sink"); - - - if (!pipeline || !filesrc || !dccpserversink || !mad || !audioconvert - || !capsfilter || !speexenc || !rtpspeexpay) { - g_print ("One element could not be created\n"); - return -1; - } - - g_object_set (G_OBJECT (dccpserversink), "port", atoi (argv[1]), NULL); - g_object_set (G_OBJECT (filesrc), "location", argv[2], NULL); - - caps = - gst_caps_from_string - ("audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)1"); - g_object_set (G_OBJECT (capsfilter), "caps", caps, NULL); - gst_object_unref (caps); - - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipeline), filesrc, mad, audioconvert, capsfilter, - speexenc, rtpspeexpay, dccpserversink, NULL); - - gst_element_link_many (filesrc, mad, audioconvert, capsfilter, speexenc, - rtpspeexpay, dccpserversink, NULL); - - - /* Now set to playing and iterate. */ - g_print ("Setting to PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_print ("Deleting pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); - - return 0; -} diff --git a/tests/icles/dccp/mp3Stream/DCCPClientPlayMP3Stream.c b/tests/icles/dccp/mp3Stream/DCCPClientPlayMP3Stream.c deleted file mode 100644 index fb09e4ba3..000000000 --- a/tests/icles/dccp/mp3Stream/DCCPClientPlayMP3Stream.c +++ /dev/null @@ -1,113 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - - -int -main (int argc, char *argv[]) -{ - - GMainLoop *loop; - GstBus *bus; - GstElement *pipeline, *alsasink, *mad, *audioconvert, *dccpclientsrc; - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* check input arguments */ - if (argc != 3) { - g_print ("%s\n", "see usage: serverHost serverPort"); - return -1; - } - - /* create elements */ - pipeline = gst_pipeline_new ("audio-sender"); - dccpclientsrc = gst_element_factory_make ("dccpclientsrc", "client-source"); - mad = gst_element_factory_make ("mad", "mad"); - audioconvert = gst_element_factory_make ("audioconvert", "audioconvert"); - alsasink = gst_element_factory_make ("alsasink", "alsa-sink"); - - if (!pipeline || !alsasink || !mad || !audioconvert || !dccpclientsrc) { - g_print ("One element could not be created\n"); - return -1; - } - - g_object_set (G_OBJECT (dccpclientsrc), "host", argv[1], NULL); - g_object_set (G_OBJECT (dccpclientsrc), "port", atoi (argv[2]), NULL); - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipeline), dccpclientsrc, mad, audioconvert, - alsasink, NULL); - - gst_element_link_many (dccpclientsrc, mad, audioconvert, alsasink, NULL); - - - /* Now set to playing and iterate. */ - g_print ("Setting to PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_print ("Deleting pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); - - return 0; -} diff --git a/tests/icles/dccp/mp3Stream/DCCPServerSendMP3Stream.c b/tests/icles/dccp/mp3Stream/DCCPServerSendMP3Stream.c deleted file mode 100644 index 2b090a200..000000000 --- a/tests/icles/dccp/mp3Stream/DCCPServerSendMP3Stream.c +++ /dev/null @@ -1,113 +0,0 @@ -/* GStreamer - * Copyright (C) <2007> Leandro Melo de Sales <leandroal@gmail.com> - * - * 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 <stdio.h> -#include <stdlib.h> -#include <gst/gst.h> - -static gboolean -bus_call (GstBus * bus, GstMessage * msg, gpointer data) -{ - - GMainLoop *loop = (GMainLoop *) data; - - switch (GST_MESSAGE_TYPE (msg)) { - case GST_MESSAGE_EOS: - g_print ("End-of-stream\n"); - g_main_loop_quit (loop); - break; - case GST_MESSAGE_ERROR:{ - gchar *debug; - GError *err; - - gst_message_parse_error (msg, &err, &debug); - g_free (debug); - - g_print ("Error: %s\n", err->message); - g_error_free (err); - - g_main_loop_quit (loop); - break; - } - default: - break; - } - - return TRUE; -} - - -int -main (int argc, char *argv[]) -{ - - GMainLoop *loop; - GstBus *bus; - GstElement *pipeline, *filesrc, *mp3parse, *dccpserversink; - - /* initialize GStreamer */ - gst_init (&argc, &argv); - loop = g_main_loop_new (NULL, FALSE); - - /* check input arguments */ - if (argc != 3) { - g_print ("%s\n", "see usage: port mp3Location"); - return -1; - } - - /* create elements */ - pipeline = gst_pipeline_new ("audio-sender"); /* create pipeline with the name audio-sender */ - filesrc = gst_element_factory_make ("filesrc", "file-source"); /* create filesrc element with the name file-source */ - mp3parse = gst_element_factory_make ("mp3parse", "mp3parse"); - dccpserversink = gst_element_factory_make ("dccpserversink", "server-sink"); - - - if (!pipeline || !filesrc || !mp3parse || !dccpserversink) { - g_print ("One element could not be created\n"); - return -1; - } - - g_object_set (G_OBJECT (dccpserversink), "port", atoi (argv[1]), NULL); - g_object_set (G_OBJECT (filesrc), "location", argv[2], NULL); - - bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); - gst_bus_add_watch (bus, bus_call, loop); - gst_object_unref (bus); - - /* put all elements in a bin */ - gst_bin_add_many (GST_BIN (pipeline), filesrc, mp3parse, dccpserversink, - NULL); - /* Link the elements at the pipeline */ - gst_element_link_many (filesrc, mp3parse, dccpserversink, NULL); - - - /* Now set to playing and iterate. */ - g_print ("Setting to PLAYING\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("Running\n"); - g_main_loop_run (loop); - - /* clean up nicely */ - g_print ("Returned, stopping playback\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); - g_print ("Deleting pipeline\n"); - gst_object_unref (GST_OBJECT (pipeline)); - - return 0; -} |