[Live-devel] Timing Issue on Processing of a Received Packet

Ross Finlayson finlayson at live555.com
Tue Apr 24 17:43:59 PDT 2007


>May be I should simplify the question. The issue is the following.
>
>We have a new MediaSink and there is a image processing duty when
>AfterGettingFrame method is invoked. My question is, if that duty
>takes around 40ms, would that cause a packet loss?

No, because incoming packets will be buffered by the operating system 
before they get read.

By default, the code ensures that the operating system buffer (for 
each socket) is at least 50 kBytes in size.  If you wish, you can 
increase that buffer size even larger, by calling 
"increaseReceiveBufferTo()".

>  I'm suspicious
>about this issue because the packets arrive with a faster rate. If
>there is only a single thread it will be too busy with image
>processing and it will not be able to read from network interface as
>frequently as it should. Would that cause packet loss?

No, provided that the (single) thread has enough CPU power to do both 
the "image processing" and the receiving/handling of network packets.

I.e., if *every* packet takes 40 ms to process, and packets arrive 
less than 40 ms apart *on average*, then you're in trouble (and 
multiple threads will not be able to help you).  However, if packets 
arrive more than 40 ms apart *on average*, then you should be OK.
-- 

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


More information about the live-devel mailing list