summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLeandro Melo de Sales <leandroal@gmail.com>2008-08-21 13:22:38 +0000
committerStefan Kost <ensonic@users.sourceforge.net>2008-08-21 13:22:38 +0000
commit605482a1a852a42aba6263811d7fa57b110728ba (patch)
tree14a29b92472bd9ebfc207581f54b307967842e29 /tests
parentfd66868120ad27860d140d1a54040dcbffc014a5 (diff)
Add dccp plugin. Fixes #542390.
Original commit message from CVS: patch by: Leandro Melo de Sales <leandroal@gmail.com> * configure.ac: * docs/plugins/Makefile.am: * docs/plugins/gst-plugins-bad-plugins-docs.sgml: * docs/plugins/gst-plugins-bad-plugins-sections.txt: * docs/plugins/gst-plugins-bad-plugins.args: * docs/plugins/gst-plugins-bad-plugins.hierarchy: * docs/plugins/gst-plugins-bad-plugins.interfaces: * docs/plugins/gst-plugins-bad-plugins.prerequisites: * docs/plugins/gst-plugins-bad-plugins.signals: * docs/plugins/inspect/plugin-dccp.xml: * gst/dccp/Makefile.am: * gst/dccp/gstdccp.c: * gst/dccp/gstdccp.h: * gst/dccp/gstdccpclientsink.c: * gst/dccp/gstdccpclientsink.h: * gst/dccp/gstdccpclientsrc.c: * gst/dccp/gstdccpclientsrc.h: * gst/dccp/gstdccpplugin.c: * gst/dccp/gstdccpserversink.c: * gst/dccp/gstdccpserversink.h: * gst/dccp/gstdccpserversrc.c: * gst/dccp/gstdccpserversrc.h: * tests/icles/dccp/README: * tests/icles/dccp/call/README: * tests/icles/dccp/call/DCCPClient.c: * tests/icles/dccp/call/DCCPServer.c: * tests/icles/dccp/file/DCCPClientSaveFile.c: * tests/icles/dccp/file/DCCPServerSendFile.c: * tests/icles/dccp/mic/DCCPClientPlayMic.c: * tests/icles/dccp/mic/DCCPServerMic.c: * tests/icles/dccp/mp3/DCCPClientPlayMP3.c: * tests/icles/dccp/mp3/DCCPServerSendMP3.c: * tests/icles/dccp/mp3Speex/DCCPClientPlaySpeexMP3.c: * tests/icles/dccp/mp3Speex/DCCPServerSendSpeexMP3.c: * tests/icles/dccp/mp3Stream/DCCPClientPlayMP3Stream.c: * tests/icles/dccp/mp3Stream/DCCPServerSendMP3Stream.c: Add dccp plugin. Fixes #542390.
Diffstat (limited to 'tests')
-rw-r--r--tests/icles/dccp/README52
-rw-r--r--tests/icles/dccp/call/DCCPClient.c151
-rw-r--r--tests/icles/dccp/call/DCCPServer.c144
-rw-r--r--tests/icles/dccp/call/README1
-rw-r--r--tests/icles/dccp/file/DCCPClientSaveFile.c113
-rw-r--r--tests/icles/dccp/file/DCCPServerSendFile.c112
-rw-r--r--tests/icles/dccp/mic/DCCPClientPlayMic.c116
-rw-r--r--tests/icles/dccp/mic/DCCPServerMic.c111
-rw-r--r--tests/icles/dccp/mp3/DCCPClientPlayMP3.c117
-rw-r--r--tests/icles/dccp/mp3/DCCPServerSendMP3.c113
-rw-r--r--tests/icles/dccp/mp3Speex/DCCPClientPlaySpeexMP3.c120
-rw-r--r--tests/icles/dccp/mp3Speex/DCCPServerSendSpeexMP3.c128
-rw-r--r--tests/icles/dccp/mp3Stream/DCCPClientPlayMP3Stream.c113
-rw-r--r--tests/icles/dccp/mp3Stream/DCCPServerSendMP3Stream.c113
14 files changed, 1504 insertions, 0 deletions
diff --git a/tests/icles/dccp/README b/tests/icles/dccp/README
new file mode 100644
index 000000000..e76ead5e5
--- /dev/null
+++ b/tests/icles/dccp/README
@@ -0,0 +1,52 @@
+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
new file mode 100644
index 000000000..5266f7859
--- /dev/null
+++ b/tests/icles/dccp/call/DCCPClient.c
@@ -0,0 +1,151 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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);
+}
+
+
+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
new file mode 100644
index 000000000..dc1b497b3
--- /dev/null
+++ b/tests/icles/dccp/call/DCCPServer.c
@@ -0,0 +1,144 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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);
+}
+
+
+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
new file mode 100644
index 000000000..ed53abd65
--- /dev/null
+++ b/tests/icles/dccp/call/README
@@ -0,0 +1 @@
+This application tests the socket sharing.
diff --git a/tests/icles/dccp/file/DCCPClientSaveFile.c b/tests/icles/dccp/file/DCCPClientSaveFile.c
new file mode 100644
index 000000000..99ac243ca
--- /dev/null
+++ b/tests/icles/dccp/file/DCCPClientSaveFile.c
@@ -0,0 +1,113 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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
new file mode 100644
index 000000000..a5de89432
--- /dev/null
+++ b/tests/icles/dccp/file/DCCPServerSendFile.c
@@ -0,0 +1,112 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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
new file mode 100644
index 000000000..0a697fa7b
--- /dev/null
+++ b/tests/icles/dccp/mic/DCCPClientPlayMic.c
@@ -0,0 +1,116 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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
new file mode 100644
index 000000000..d28206845
--- /dev/null
+++ b/tests/icles/dccp/mic/DCCPServerMic.c
@@ -0,0 +1,111 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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
new file mode 100644
index 000000000..e23c5a593
--- /dev/null
+++ b/tests/icles/dccp/mp3/DCCPClientPlayMP3.c
@@ -0,0 +1,117 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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
new file mode 100644
index 000000000..6dba1712c
--- /dev/null
+++ b/tests/icles/dccp/mp3/DCCPServerSendMP3.c
@@ -0,0 +1,113 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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
new file mode 100644
index 000000000..d05b41980
--- /dev/null
+++ b/tests/icles/dccp/mp3Speex/DCCPClientPlaySpeexMP3.c
@@ -0,0 +1,120 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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
new file mode 100644
index 000000000..58166dd17
--- /dev/null
+++ b/tests/icles/dccp/mp3Speex/DCCPServerSendSpeexMP3.c
@@ -0,0 +1,128 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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
new file mode 100644
index 000000000..b4942be57
--- /dev/null
+++ b/tests/icles/dccp/mp3Stream/DCCPClientPlayMP3Stream.c
@@ -0,0 +1,113 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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
new file mode 100644
index 000000000..c17f79e33
--- /dev/null
+++ b/tests/icles/dccp/mp3Stream/DCCPServerSendMP3Stream.c
@@ -0,0 +1,113 @@
+/* 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., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, 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;
+}