multifdsink: add num-fds property
authorArnout Vandecappelle <arnout@mind.be>
Fri, 15 May 2009 21:05:45 +0000 (23:05 +0200)
committerWim Taymans <wim@metal.(none)>
Fri, 15 May 2009 21:07:01 +0000 (23:07 +0200)
multifdsink::num-fds

gst/tcp/gstmultifdsink.c

index b558e52..4a440e9 100644 (file)
@@ -218,6 +218,8 @@ enum
 
   PROP_RESEND_STREAMHEADER,
 
+  PROP_NUM_FDS,
+
   PROP_LAST
 };
 
@@ -520,6 +522,11 @@ gst_multi_fd_sink_class_init (GstMultiFdSinkClass * klass)
           DEFAULT_RESEND_STREAMHEADER,
           G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
+  g_object_class_install_property (gobject_class, PROP_NUM_FDS,
+      g_param_spec_uint ("num-fds", "Number of fds",
+          "The current number of client file descriptors.",
+          0, G_MAXUINT, 0, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+
   /**
    * GstMultiFdSink::add:
    * @gstmultifdsink: the multifdsink element to emit this signal on
@@ -2798,6 +2805,9 @@ gst_multi_fd_sink_get_property (GObject * object, guint prop_id, GValue * value,
     case PROP_RESEND_STREAMHEADER:
       g_value_set_boolean (value, multifdsink->resend_streamheader);
       break;
+    case PROP_NUM_FDS:
+      g_value_set_uint (value, g_hash_table_size (multifdsink->fd_hash));
+      break;
 
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);