[Live-devel] preferred and maxPAcketSize in MultiFramedRTPSink

Christian Gerstner gerstner at graphics.cs.uni-sb.de
Thu Jan 27 14:30:00 PST 2005


Hi,

I'm currently developing an internet telephone and I'd like to use 
liveMedia for the audiostreaming. In my application I use a SimpleRTPSink.
The problem is, that with the value of 1000bytes for the 
preferredPacketSize in the parent class MultiFramedRTPSink and pcmu as 
audio codec, it takes 1/8 second until the soundcard records these 
1000bytes and liveMedia sends the first packet. As result of this 
effect, I've got an additional delay of 1/8 second in my telephony 
application, which is quiete disturbing.

A solution to this problem would be to change preferredPacketSize to a 
lower value.
For other kinds of streams like e.g. video a higher value would be better.
So it would be good to have a public method, to change 
preferredPacketSize from external applications.
To make it possible, to have independant preferredPacketSize in 
different instances of subclasses, I would suggest to set 
prefferedPacketSize non-static.

The patch files are attached.



-------------- next part --------------
--- MultiFramedRTPSink.hh	Mon Jan 24 10:31:13 2005
+++ /home/gerstner/live/liveMedia/include/MultiFramedRTPSink.hh	Thu Jan 27 12:58:21 2005
@@ -27,6 +27,10 @@
 #endif
 
 class MultiFramedRTPSink: public RTPSink {
+
+public:
+void setPacketSizes(unsigned _preferredPacketSize, unsigned  _maxPacketSize);
+
 protected:
   MultiFramedRTPSink(UsageEnvironment& env,
 		     Groupsock* rtpgs, unsigned char rtpPayloadType,
-------------- next part --------------
--- MultiFramedRTPSink.cpp	Thu Jan 27 12:49:29 2005
+++ /home/gerstner/live/liveMedia/MultiFramedRTPSink.cpp	Thu Jan 27 13:14:41 2005
@@ -24,10 +24,10 @@
 
 ////////// MultiFramedRTPSink //////////
 
-static unsigned const maxPacketSize = 1448;
+unsigned maxPacketSize = 1448;
 	// bytes (1500, minus some allowance for IP, UDP, UMTP headers)
         // (Also, make it a multiple of 4 bytes, just in case that matters.)
-static unsigned const preferredPacketSize = 1000; // bytes
+unsigned preferredPacketSize = 1000; // bytes
 
 MultiFramedRTPSink::MultiFramedRTPSink(UsageEnvironment& env,
 				       Groupsock* rtpGS,
@@ -56,6 +56,11 @@
   if (isFirstFrameInPacket()) {
     setTimestamp(frameTimestamp);
   }
+}
+
+void MultiFramedRTPSink::setPacketSizes(unsigned _preferredPacketSize, unsigned  _maxPacketSize){
+  preferredPacketSize = _preferredPacketSize;
+  maxPacketSize = _maxPacketSize;
 }
 
 Boolean MultiFramedRTPSink::allowFragmentationAfterStart() const {


More information about the live-devel mailing list