title: GStreamer - Emit a signal to an element
body: <p>I have a pipeline written into a C program which redirects a video stream from stdin to multiple UDP clients. I want those clients to be added or removed dynamically, so it's not possible to define at compile time which of them and how many there will be. This is my pipeline (if I add a fixed <code>clients</code> parameter it works fine):</p>
  
  <pre><code>fdsrc name=origin \
  ! video/x-h264,width=320,height=240,framerate=30/1,profile=baseline,stream-format=avc,alignment=au \
  ! h264parse \
  ! rtph264pay \
      config-interval=1 \
      pt=96 \
  ! multiudpsink name=dest \
       sync=false
  </code></pre>
  
  <p>According to the GStreamer docs, I can achieve it by sending a signal in order to add or remove clients dynamically. In this case, it should be the <a href="https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-multiudpsink.html#GstMultiUDPSink-add" rel="nofollow noreferrer"><code>add</code> signal</a>.</p>
  
  <p>But I can't find any information about <strong>sending a signal to an element</strong> (in this case, to the <code>multiudpsink</code> element). It's easy to get the reference to my element:</p>
  
  <pre><code>GstElement *sink = gst_bin_get_by_name(GST_BIN(pipeline), "dest");
  /* TODO: send a signal to add a client */
  g_object_unref(sink);
  </code></pre>
  
  <p>But now how can I emit a signal to that element?</p>