summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorThomas Vander Stichele <thomas@apestaart.org>2005-09-09 11:09:49 +0000
committerThomas Vander Stichele <thomas@apestaart.org>2005-09-09 11:09:49 +0000
commitdf82aa5a0178395d26dea66a4850e55144c74e9d (patch)
treec664bdc26b51655302737c6b7de3308ae75bb8f6 /gst
parentfb26ca3f3273deeff59687fa99a148f86ddf6f40 (diff)
gst-plugins-good.spec.in: spec file fixes
Original commit message from CVS: * gst-plugins-good.spec.in: spec file fixes * gst/udp/gstmultiudpsink.c: (gst_multiudpsink_class_init), (gst_multiudpsink_render), (gst_multiudpsink_add), (gst_multiudpsink_clear): it actually helps to actually stream if we hook up the add signal to an actual implementation * gst/udp/gstudpsrc.c: (gst_udpsrc_start): some debugging
Diffstat (limited to 'gst')
-rw-r--r--gst/udp/gstmultiudpsink.c21
-rw-r--r--gst/udp/gstudpsrc.c4
2 files changed, 18 insertions, 7 deletions
diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c
index ddc4be5e..50958259 100644
--- a/gst/udp/gstmultiudpsink.c
+++ b/gst/udp/gstmultiudpsink.c
@@ -62,7 +62,7 @@ enum
};
static void gst_multiudpsink_base_init (gpointer g_class);
-static void gst_multiudpsink_class_init (GstMultiUDPSink * klass);
+static void gst_multiudpsink_class_init (GstMultiUDPSinkClass * klass);
static void gst_multiudpsink_init (GstMultiUDPSink * udpsink);
static void gst_multiudpsink_finalize (GObject * object);
@@ -118,7 +118,7 @@ gst_multiudpsink_base_init (gpointer g_class)
}
static void
-gst_multiudpsink_class_init (GstMultiUDPSink * klass)
+gst_multiudpsink_class_init (GstMultiUDPSinkClass * klass)
{
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
@@ -168,6 +168,10 @@ gst_multiudpsink_class_init (GstMultiUDPSink * klass)
gstelement_class->change_state = gst_multiudpsink_change_state;
gstbasesink_class->render = gst_multiudpsink_render;
+ klass->add = gst_multiudpsink_add;
+ klass->remove = gst_multiudpsink_remove;
+ klass->clear = gst_multiudpsink_clear;
+ klass->get_stats = gst_multiudpsink_get_stats;
GST_DEBUG_CATEGORY_INIT (multiudpsink_debug, "multiudpsink", 0, "UDP sink");
}
@@ -195,7 +199,7 @@ static GstFlowReturn
gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
{
GstMultiUDPSink *sink;
- gint ret, size;
+ gint ret, size, num = 0;
guint8 *data;
GList *clients;
@@ -204,14 +208,15 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
size = GST_BUFFER_SIZE (buffer);
data = GST_BUFFER_DATA (buffer);
- GST_DEBUG ("about to send %d bytes", size);
-
g_mutex_lock (sink->client_lock);
+ GST_LOG_OBJECT (bsink, "about to send %d bytes", size);
+
for (clients = sink->clients; clients; clients = g_list_next (clients)) {
GstUDPClient *client;
client = (GstUDPClient *) clients->data;
- GST_DEBUG ("sending %d bytes to client %p", size, client);
+ ++num;
+ GST_LOG_OBJECT (sink, "sending %d bytes to client %p", size, client);
while (TRUE) {
ret = sendto (*client->sock, data, size, 0,
@@ -227,7 +232,7 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
}
g_mutex_unlock (sink->client_lock);
- GST_DEBUG ("sent %d bytes", size);
+ GST_LOG_OBJECT (sink, "sent %d bytes to %d clients", size, num);
return GST_FLOW_OK;
@@ -316,6 +321,7 @@ gst_multiudpsink_add (GstMultiUDPSink * sink, const gchar * host, gint port)
struct ip_mreq multi_addr;
GstUDPClient *client;
+ GST_DEBUG_OBJECT (sink, "adding client on host %s, port %d", host, port);
client = g_new0 (GstUDPClient, 1);
client->host = g_strdup (host);
client->port = port;
@@ -414,6 +420,7 @@ gst_multiudpsink_remove (GstMultiUDPSink * sink, const gchar * host, gint port)
void
gst_multiudpsink_clear (GstMultiUDPSink * sink)
{
+ GST_DEBUG_OBJECT (sink, "clearing");
g_mutex_lock (sink->client_lock);
g_list_foreach (sink->clients, (GFunc) free_client, sink);
g_list_free (sink->clients);
diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c
index 61fadcd4..e4625911 100644
--- a/gst/udp/gstudpsrc.c
+++ b/gst/udp/gstudpsrc.c
@@ -456,6 +456,7 @@ gst_udpsrc_start (GstBaseSrc * bsrc)
src = GST_UDPSRC (bsrc);
+ GST_DEBUG_OBJECT (src, "creating socket pair");
if ((ret = socketpair (PF_UNIX, SOCK_STREAM, 0, CONTROL_SOCKETS (src))) < 0)
goto no_socket_pair;
@@ -478,6 +479,7 @@ gst_udpsrc_start (GstBaseSrc * bsrc)
src->myaddr.sin_port = htons (src->port); /* short, network byte order */
src->myaddr.sin_addr.s_addr = INADDR_ANY;
+ GST_DEBUG_OBJECT (src, "binding on port %d", src->port);
if ((ret =
bind (src->sock, (struct sockaddr *) &src->myaddr,
sizeof (src->myaddr))) < 0)
@@ -498,8 +500,10 @@ gst_udpsrc_start (GstBaseSrc * bsrc)
goto getsockname_error;
port = ntohs (my_addr.sin_port);
+ GST_DEBUG_OBJECT (src, "bound, on port %d", port);
if (port != src->port) {
src->port = port;
+ GST_DEBUG_OBJECT (src, "notifying %d", port);
g_object_notify (G_OBJECT (src), "port");
}