udpsrc: more efficient memory handling
udpsrc: more efficient memory handling

Drop use of g_socket_get_available_bytes() which is
not useful on all systems (where it returns the size
of the entire buffer not that of the next pending
packet), and is yet another syscall and apparently
very inefficient on Windows in the UDP case.

Instead, when reading UDP packets, use the more featureful
g_socket_receive_message() call that allows to read into
scattered memory, and allocate one memory chunk which is
likely to be large enough for a packet, while also providing
a larger allocated memory chunk just in case the packet
is larger than expected. If the received data fits into the
first chunk, we'll just add that to the buffer we return
and re-use the fallback buffer for next time, otherwise we
add both chunks to the buffer.

This reduces memory waste more reliably on systems where
get_available_bytes() doesn't work properly.

In a multimedia streaming scenario, incoming UDP packets
are almost never fragmented and thus almost always smaller
than the MTU size, which is also why we don't try to do
something smarter with more fallback memory chunks of
different sizes. The fallback scenario is just for when
someone built a broken sender pipeline (not using a
payloader or somesuch)

https://bugzilla.gnome.org/show_bug.cgi?id=610364

jcaden/gst-plugins-good,shelsonjava/gst-plugins-good,Kurento/gst-plugins-good,sebras/gst-plugins-good,hizukiayaka/gst-plugins-good,ijsf/OpenWebRTC-gst-plugins-good,rawoul/gst-plugins-good,rawoul/gst-plugins-good,sebras/gst-plugins-good,StreamUtils/gst-plugins-good,stfl/gst-plugins-good,vatavuserban/gst-plugins-good,veo-labs/gst-plugins-good,loshca/gst-plugins-good,vatavuserban/gst-plugins-good,GStreamer/gst-plugins-good,Kurento/gst-plugins-good,veo-labs/gst-plugins-good,ikonst/gst-plugins-good,kittee/gst-plugins-good,froggatt/gst-plugins-good-m,hizukiayaka/gst-plugins-good,BigBrother-International/gst-plugins-good,StreamUtils/gst-plugins-good,GrokImageCompression/gst-plugins-good,veo-labs/gst-plugins-good,sebras/gst-plugins-good,froggatt/gst-plugins-good-m,pexip/gst-plugins-good,loshca/gst-plugins-good,sh0/gst-plugins-good,pexip/gst-plugins-good,stfl/gst-plugins-good,ijsf/OpenWebRTC-gst-plugins-good,shelsonjava/gst-plugins-good,Kurento/gst-plugins-good,ikonst/gst-plugins-good,jcaden/gst-plugins-good,loshca/gst-plugins-good,ikonst/gst-plugins-good,sh0/gst-plugins-good,froggatt/gst-plugins-good-m,stfl/gst-plugins-good,froggatt/gst-plugins-good-m,StreamUtils/gst-plugins-good,ijsf/OpenWebRTC-gst-plugins-good,jcaden/gst-plugins-good,sh0/gst-plugins-good,GrokImageCompression/gst-plugins-good,pexip/gst-plugins-good,veo-labs/gst-plugins-good,GrokImageCompression/gst-plugins-good,rawoul/gst-plugins-good,shelsonjava/gst-plugins-good,vatavuserban/gst-plugins-good,hizukiayaka/gst-plugins-good,kittee/gst-plugins-good,Kurento/gst-plugins-good,BigBrother-International/gst-plugins-good,chamois94/gst-plugins-good,kittee/gst-plugins-good,kittee/gst-plugins-good,StreamUtils/gst-plugins-good,sebras/gst-plugins-good,Kurento/gst-plugins-good,ijsf/OpenWebRTC-gst-plugins-good,stfl/gst-plugins-good,jcaden/gst-plugins-good,BigBrother-International/gst-plugins-good,sh0/gst-plugins-good,pexip/gst-plugins-good,pexip/gst-plugins-good,GrokImageCompression/gst-plugins-good,freedesktop-unofficial-mirror/gstreamer__gst-plugins-good,GStreamer/gst-plugins-good,loshca/gst-plugins-good,freedesktop-unofficial-mirror/gstreamer__gst-plugins-good,chamois94/gst-plugins-good,vatavuserban/gst-plugins-good,BigBrother-International/gst-plugins-good,hizukiayaka/gst-plugins-good,chamois94/gst-plugins-good,shelsonjava/gst-plugins-good,freedesktop-unofficial-mirror/gstreamer__gst-plugins-good,GStreamer/gst-plugins-good,freedesktop-unofficial-mirror/gstreamer__gst-plugins-good,rawoul/gst-plugins-good,GStreamer/gst-plugins-good,chamois94/gst-plugins-good,ikonst/gst-plugins-good