summaryrefslogtreecommitdiffstats
path: root/ext/shout/gstshout.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/shout/gstshout.c')
-rw-r--r--ext/shout/gstshout.c131
1 files changed, 66 insertions, 65 deletions
diff --git a/ext/shout/gstshout.c b/ext/shout/gstshout.c
index 3deb8cc6..5f546dee 100644
--- a/ext/shout/gstshout.c
+++ b/ext/shout/gstshout.c
@@ -50,19 +50,19 @@ enum
enum
{
ARG_0,
- ARG_IP, /* the ip of the server */
- ARG_PORT, /* the encoder port number on the server */
- ARG_PASSWORD, /* the encoder password on the server */
- ARG_PUBLIC, /* is this stream public? */
- ARG_NAME, /* Name of the stream */
- ARG_DESCRIPTION, /* Description of the stream */
- ARG_GENRE, /* Genre of the stream */
- ARG_MOUNT, /* mountpoint of stream (icecast only) */
- ARG_DUMPFILE, /* Dumpfile on the server for this stream (icecast only) */
- ARG_ICY, /* use icy headers for login? (for use with shoutcast) */
- ARG_AIM, /* AIM number (shoutcast only) */
- ARG_ICQ, /* ICQ number (shoutcast only) */
- ARG_IRC, /* IRC server (shoutcast only) */
+ ARG_IP, /* the ip of the server */
+ ARG_PORT, /* the encoder port number on the server */
+ ARG_PASSWORD, /* the encoder password on the server */
+ ARG_PUBLIC, /* is this stream public? */
+ ARG_NAME, /* Name of the stream */
+ ARG_DESCRIPTION, /* Description of the stream */
+ ARG_GENRE, /* Genre of the stream */
+ ARG_MOUNT, /* mountpoint of stream (icecast only) */
+ ARG_DUMPFILE, /* Dumpfile on the server for this stream (icecast only) */
+ ARG_ICY, /* use icy headers for login? (for use with shoutcast) */
+ ARG_AIM, /* AIM number (shoutcast only) */
+ ARG_ICQ, /* ICQ number (shoutcast only) */
+ ARG_IRC, /* IRC server (shoutcast only) */
};
static GstStaticPadTemplate sink_template_factory =
@@ -70,7 +70,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS ("audio/mpeg, "
- "mpegversion = (int) 1, " "layer = (int) [ 1, 3 ]")
+ "mpegversion = (int) 1, " "layer = (int) [ 1, 3 ]")
);
static void gst_icecastsend_class_init (GstIcecastSendClass * klass);
@@ -104,9 +104,10 @@ gst_icecastsend_get_type (void)
sizeof (GstIcecastSend), 0,
(GInstanceInitFunc) gst_icecastsend_init,
};
+
icecastsend_type =
- g_type_register_static (GST_TYPE_ELEMENT, "GstIcecastSend",
- &icecastsend_info, 0);
+ g_type_register_static (GST_TYPE_ELEMENT, "GstIcecastSend",
+ &icecastsend_info, 0);
}
return icecastsend_type;
}
@@ -132,33 +133,33 @@ gst_icecastsend_class_init (GstIcecastSendClass * klass)
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_IP, g_param_spec_string ("ip", "ip", "ip", NULL, G_PARAM_READWRITE)); /* CHECKME */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PORT, g_param_spec_int ("port", "port", "port", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_IP, g_param_spec_string ("ip", "ip", "ip", NULL, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PORT, g_param_spec_int ("port", "port", "port", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PASSWORD, g_param_spec_string ("password", "password", "password", NULL, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PASSWORD, g_param_spec_string ("password", "password", "password", NULL, G_PARAM_READWRITE)); /* CHECKME */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PUBLIC, g_param_spec_boolean ("public", "public", "public", TRUE, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PUBLIC, g_param_spec_boolean ("public", "public", "public", TRUE, G_PARAM_READWRITE)); /* CHECKME */
/* metadata */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NAME, g_param_spec_string ("name", "name", "name", NULL, G_PARAM_READWRITE)); /* CHECKME */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DESCRIPTION, g_param_spec_string ("description", "description", "description", NULL, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DESCRIPTION, g_param_spec_string ("description", "description", "description", NULL, G_PARAM_READWRITE)); /* CHECKME */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_GENRE, g_param_spec_string ("genre", "genre", "genre", NULL, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_GENRE, g_param_spec_string ("genre", "genre", "genre", NULL, G_PARAM_READWRITE)); /* CHECKME */
/* icecast only */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MOUNT, g_param_spec_string ("mount", "mount", "mount", NULL, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MOUNT, g_param_spec_string ("mount", "mount", "mount", NULL, G_PARAM_READWRITE)); /* CHECKME */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DUMPFILE, g_param_spec_string ("dumpfile", "dumpfile", "dumpfile", NULL, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DUMPFILE, g_param_spec_string ("dumpfile", "dumpfile", "dumpfile", NULL, G_PARAM_READWRITE)); /* CHECKME */
/* shoutcast only */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ICY, g_param_spec_boolean ("icy", "icy", "icy", FALSE, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ICY, g_param_spec_boolean ("icy", "icy", "icy", FALSE, G_PARAM_READWRITE)); /* CHECKME */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_AIM, g_param_spec_string ("aim", "aim", "aim", NULL, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_AIM, g_param_spec_string ("aim", "aim", "aim", NULL, G_PARAM_READWRITE)); /* CHECKME */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ICQ, g_param_spec_string ("icq", "icq", "icq", NULL, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ICQ, g_param_spec_string ("icq", "icq", "icq", NULL, G_PARAM_READWRITE)); /* CHECKME */
- g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_IRC, g_param_spec_string ("irc", "irc", "irc", NULL, G_PARAM_READWRITE)); /* CHECKME */
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_IRC, g_param_spec_string ("irc", "irc", "irc", NULL, G_PARAM_READWRITE)); /* CHECKME */
gobject_class->set_property = gst_icecastsend_set_property;
@@ -174,7 +175,7 @@ gst_icecastsend_init (GstIcecastSend * icecastsend)
icecastsend->sinkpad =
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
- "sink"), "sink");
+ "sink"), "sink");
gst_element_add_pad (GST_ELEMENT (icecastsend), icecastsend->sinkpad);
gst_pad_set_chain_function (icecastsend->sinkpad, gst_icecastsend_chain);
@@ -232,7 +233,7 @@ gst_icecastsend_set_property (GObject * object, guint prop_id,
switch (prop_id) {
case ARG_IP:
if (icecastsend->ip)
- g_free (icecastsend->ip);
+ g_free (icecastsend->ip);
icecastsend->ip = g_strdup (g_value_get_string (value));
break;
case ARG_PORT:
@@ -240,64 +241,64 @@ gst_icecastsend_set_property (GObject * object, guint prop_id,
break;
case ARG_PASSWORD:
if (icecastsend->password)
- g_free (icecastsend->password);
+ g_free (icecastsend->password);
icecastsend->password = g_strdup (g_value_get_string (value));
break;
- case ARG_PUBLIC: /* is this stream public? */
+ case ARG_PUBLIC: /* is this stream public? */
icecastsend->public = g_value_get_boolean (value);
break;
- case ARG_NAME: /* Name of the stream */
+ case ARG_NAME: /* Name of the stream */
if (icecastsend->name)
- g_free (icecastsend->name);
+ g_free (icecastsend->name);
icecastsend->name = g_strdup (g_value_get_string (value));
break;
- case ARG_DESCRIPTION: /* Description of the stream */
+ case ARG_DESCRIPTION: /* Description of the stream */
if (icecastsend->description)
- g_free (icecastsend->description);
+ g_free (icecastsend->description);
icecastsend->description = g_strdup (g_value_get_string (value));
break;
- case ARG_GENRE: /* Genre of the stream */
+ case ARG_GENRE: /* Genre of the stream */
if (icecastsend->genre)
- g_free (icecastsend->genre);
+ g_free (icecastsend->genre);
icecastsend->genre = g_strdup (g_value_get_string (value));
break;
- case ARG_MOUNT: /* mountpoint of stream (icecast only) */
+ case ARG_MOUNT: /* mountpoint of stream (icecast only) */
if (icecastsend->mount)
- g_free (icecastsend->mount);
+ g_free (icecastsend->mount);
icecastsend->mount = g_strdup (g_value_get_string (value));
break;
- case ARG_DUMPFILE: /* Dumpfile on the server for this stream (icecast only) */
+ case ARG_DUMPFILE: /* Dumpfile on the server for this stream (icecast only) */
if (icecastsend->dumpfile)
- g_free (icecastsend->dumpfile);
+ g_free (icecastsend->dumpfile);
icecastsend->dumpfile = g_strdup (g_value_get_string (value));
break;
- case ARG_ICY: /* use icy headers for login? (for use with shoutcast) */
+ case ARG_ICY: /* use icy headers for login? (for use with shoutcast) */
icecastsend->icy = g_value_get_boolean (value);
break;
- case ARG_AIM: /* AIM number (shoutcast only) */
+ case ARG_AIM: /* AIM number (shoutcast only) */
if (icecastsend->aim)
- g_free (icecastsend->aim);
+ g_free (icecastsend->aim);
icecastsend->aim = g_strdup (g_value_get_string (value));
break;
- case ARG_ICQ: /* ICQ number (shoutcast only) */
+ case ARG_ICQ: /* ICQ number (shoutcast only) */
if (icecastsend->icq)
- g_free (icecastsend->icq);
+ g_free (icecastsend->icq);
icecastsend->icq = g_strdup (g_value_get_string (value));
break;
- case ARG_IRC: /* IRC server (shoutcast only) */
+ case ARG_IRC: /* IRC server (shoutcast only) */
if (icecastsend->irc)
- g_free (icecastsend->irc);
+ g_free (icecastsend->irc);
icecastsend->irc = g_strdup (g_value_get_string (value));
break;
@@ -326,43 +327,43 @@ gst_icecastsend_get_property (GObject * object, guint prop_id, GValue * value,
case ARG_PASSWORD:
g_value_set_string (value, icecastsend->password);
break;
- case ARG_PUBLIC: /* is this stream public? */
+ case ARG_PUBLIC: /* is this stream public? */
g_value_set_boolean (value, icecastsend->public);
break;
- case ARG_NAME: /* Name of the stream */
+ case ARG_NAME: /* Name of the stream */
g_value_set_string (value, icecastsend->name);
break;
- case ARG_DESCRIPTION: /* Description of the stream */
+ case ARG_DESCRIPTION: /* Description of the stream */
g_value_set_string (value, icecastsend->description);
break;
- case ARG_GENRE: /* Genre of the stream */
+ case ARG_GENRE: /* Genre of the stream */
g_value_set_string (value, icecastsend->genre);
break;
- case ARG_MOUNT: /* mountpoint of stream (icecast only) */
+ case ARG_MOUNT: /* mountpoint of stream (icecast only) */
g_value_set_string (value, icecastsend->mount);
break;
- case ARG_DUMPFILE: /* Dumpfile on the server for this stream (icecast only) */
+ case ARG_DUMPFILE: /* Dumpfile on the server for this stream (icecast only) */
g_value_set_string (value, icecastsend->dumpfile);
break;
- case ARG_ICY: /* use icy headers for login? (for use with shoutcast) */
+ case ARG_ICY: /* use icy headers for login? (for use with shoutcast) */
g_value_set_boolean (value, icecastsend->icy);
break;
- case ARG_AIM: /* AIM number (shoutcast only) */
+ case ARG_AIM: /* AIM number (shoutcast only) */
g_value_set_string (value, icecastsend->aim);
break;
- case ARG_ICQ: /* ICQ number (shoutcast only) */
+ case ARG_ICQ: /* ICQ number (shoutcast only) */
g_value_set_string (value, icecastsend->icq);
break;
- case ARG_IRC: /* IRC server (shoutcast only) */
+ case ARG_IRC: /* IRC server (shoutcast only) */
g_value_set_string (value, icecastsend->irc);
break;
@@ -407,12 +408,12 @@ gst_icecastsend_change_state (GstElement * element)
icecastsend->conn.irc = icecastsend->irc; */
if (shout_connect (&icecastsend->conn)) {
- g_print ("connected to server...\n");
+ g_print ("connected to server...\n");
} else {
- g_warning ("couldn't connect to server... (%i: %s)\n",
- icecastsend->conn.error, SHOUT_ERRORS[icecastsend->conn.error]);
- shout_disconnect (&icecastsend->conn);
- return GST_STATE_FAILURE;
+ g_warning ("couldn't connect to server... (%i: %s)\n",
+ icecastsend->conn.error, SHOUT_ERRORS[icecastsend->conn.error]);
+ shout_disconnect (&icecastsend->conn);
+ return GST_STATE_FAILURE;
}
break;
case GST_STATE_PAUSED_TO_READY: