gst/udp/gstmultiudpsink.*: Track packets sent per client in addition to bytes sent; provide this info through get-sta...

Original commit message from CVS:
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_render),
(gst_multiudpsink_remove), (gst_multiudpsink_get_stats):
* gst/udp/gstmultiudpsink.h:
Track packets sent per client in addition to bytes sent; provide
this info through get-stats signal
This commit is contained in:
Michael Smith 2005-12-29 16:36:19 +00:00
parent 00b3a309e2
commit 603daf45ac
3 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,11 @@
2005-12-29 Michael Smith <msmith@fluendo.com>
* gst/udp/gstmultiudpsink.c: (gst_multiudpsink_render),
(gst_multiudpsink_remove), (gst_multiudpsink_get_stats):
* gst/udp/gstmultiudpsink.h:
Track packets sent per client in addition to bytes sent; provide
this info through get-stats signal
2005-12-29 Tim-Philipp Müller <tim at centricular dot net>
* gst/auparse/gstauparse.c: (gst_au_parse_dispose):

View file

@ -228,6 +228,7 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
}
} else {
client->bytes_sent += ret;
client->packets_sent++;
break;
}
}
@ -465,14 +466,20 @@ gst_multiudpsink_get_stats (GstMultiUDPSink * sink, const gchar * host,
GValue value = { 0 };
/* Result is a value array of (bytes_sent, connect_time, disconnect_time) */
result = g_value_array_new (3);
/* Result is a value array of (bytes_sent, packets_sent,
* connect_time, disconnect_time), all as uint64 */
result = g_value_array_new (4);
g_value_init (&value, G_TYPE_UINT64);
g_value_set_uint64 (&value, client->bytes_sent);
result = g_value_array_append (result, &value);
g_value_unset (&value);
g_value_init (&value, G_TYPE_UINT64);
g_value_set_uint64 (&value, client->packets_sent);
result = g_value_array_append (result, &value);
g_value_unset (&value);
g_value_init (&value, G_TYPE_UINT64);
g_value_set_uint64 (&value, client->connect_time);
result = g_value_array_append (result, &value);

View file

@ -60,6 +60,7 @@ typedef struct {
/* Per-client stats */
guint64 bytes_sent;
guint64 packets_sent;
guint64 connect_time;
guint64 disconnect_time;
} GstUDPClient;