multisocketsink: Map `GstMemory`s individually when sending
authorWilliam Manley <will@williammanley.net>
Fri, 13 Mar 2015 12:49:31 +0000 (12:49 +0000)
committerWim Taymans <wtaymans@redhat.com>
Fri, 13 Mar 2015 15:20:50 +0000 (16:20 +0100)
commitb8232a74673afae38bc3bff70c7ed0d592209556
tree134f168220e38b19ade486f88ddaf91cab5a0c66
parent274984e83bf1bd501ae9ce2111e3a0b86597ecfb
multisocketsink: Map `GstMemory`s individually when sending

If a buffer is made up of non-contiguous `GstMemory`s `gst_buffer_map`
has to copy all the data into a new `GstMemory` which is contiguous.  By
mapping all the `GstMemory`s individually and then using scatter-gather
IO we avoid this situation.

This is a preparatory step for adding support to multisocketsink for
sending file descriptors, where a GstBuffer may be made up of several
`GstMemory`s, some of which are backed by a memfd or file, but I think this
patch is valid and useful on its own.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=746150
gst/tcp/gstmultisocketsink.c
tests/check/elements/multisocketsink.c