[Live-devel] Is memmove() necessary when using blocking call?

Avramoni, Sorin sorin.avramoni at intel.com
Mon May 11 23:00:13 PDT 2020


Ok, thanks for the answer!


Sorin.

________________________________
From: live-devel <live-devel-bounces at us.live555.com> on behalf of Ross Finlayson <finlayson at live555.com>
Sent: Monday, May 11, 2020 12:41:18 PM
To: LIVE555 Streaming Media - development & use
Subject: Re: [Live-devel] Is memmove() necessary when using blocking call?



> On May 11, 2020, at 9:19 PM, Avramoni, Sorin <sorin.avramoni at intel.com> wrote:
>
> I am wonder since I have a blocking mechanism it is possible to not use memmove() and just use a reference to my buffers?

Generally speaking, no, because the data in your buffer is not the only data that gets sent in a RTP packet.  There is also the RTP header, which the LIVE555 library puts in each outgoing UDP packet, before your payload data.  Therefore it would not be possible to send a RTP packet by just passing a pointer to your payload data, without copying the data.

Things get even more complicated if your payload data is too large to fit in an outgoing UDP packet.  In that case, the LIVE555 library has to construct a RTP header (and perhaps an extra ‘fragmentation header’, depending on the RTP payload type) for each outgoing packet.  Your payload data will end up being split among multiple outgoing RTP packets.

(Yes, it might be possible to avoid some data copying using a ‘scatter-gather’ I/O interface (e.g., using “sendmmsg()”), but that would require a major (and non-backward-compatible) overhaul of LIVE555’s buffering mechanism - something that’s not likely to happen anytime soon.)


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


_______________________________________________
live-devel mailing list
live-devel at lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20200512/3f9bbf2b/attachment.htm>


More information about the live-devel mailing list