diff options
author | Michael Smith <msmith@xiph.org> | 2005-12-29 16:36:19 +0000 |
---|---|---|
committer | Michael Smith <msmith@xiph.org> | 2005-12-29 16:36:19 +0000 |
commit | 603daf45ac63e278fc5762789c1ded487321a1bd (patch) | |
tree | f62d883dc1052371426fcd6ef8fb8fc3091de137 /gst/udp | |
parent | 00b3a309e20928063ab6c34e4f528a21de1b6254 (diff) |
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
Diffstat (limited to 'gst/udp')
-rw-r--r-- | gst/udp/gstmultiudpsink.c | 11 | ||||
-rw-r--r-- | gst/udp/gstmultiudpsink.h | 1 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gst/udp/gstmultiudpsink.c b/gst/udp/gstmultiudpsink.c index 5883e529..ed9be9e1 100644 --- a/gst/udp/gstmultiudpsink.c +++ b/gst/udp/gstmultiudpsink.c @@ -228,6 +228,7 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer) } } else { client->bytes_sent += ret; + client->packets_sent++; break; } } @@ -465,8 +466,9 @@ 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); @@ -474,6 +476,11 @@ gst_multiudpsink_get_stats (GstMultiUDPSink * sink, const gchar * host, 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); g_value_unset (&value); diff --git a/gst/udp/gstmultiudpsink.h b/gst/udp/gstmultiudpsink.h index e8cbf8f9..a9c84e05 100644 --- a/gst/udp/gstmultiudpsink.h +++ b/gst/udp/gstmultiudpsink.h @@ -60,6 +60,7 @@ typedef struct { /* Per-client stats */ guint64 bytes_sent; + guint64 packets_sent; guint64 connect_time; guint64 disconnect_time; } GstUDPClient; |