[Live-devel] RTP padding feature

Victor Kozhuhov vkozhuhov at gmx.net
Mon Oct 16 14:52:26 PDT 2006


Hello, 

I found that RTP padding is required in some scenarios, so I added such feature into MultiFramedRTPSink. 
There are two new functions: 
void setPaddingBit(); - to set corresponding bit only (just in case), and 
void setFramePadding(unsigned numPaddingBytes); - to set padding bit and advance required number of bytes.
I expect the last function to be called from the doSpecialFrameHandling(...), so to make it working I slightly changed MultiFramedRTPSink::afterGettingFrame(...). 

Here is the sample code:
void SomeRTPSink::doSpecialFrameHandling(unsigned fragmentationOffset,
 unsigned char* frameStart,
 unsigned numBytesInFrame,
 struct timeval frameTimestamp,
 unsigned numRemainingBytes) 
{
 //align to some boundary
 unsigned neededPaddingBytes = X; //according to your need
 if (neededPaddingBytes && //requires alignment
  numRemainingBytes == 0 ) //can modify frame
 {
  setFramePadding(neededPaddingBytes);
  numBytesInFrame += neededPaddingBytes; //for future use within this function
  //...
 }
}


I also did a few more changes:
- made SimpleRTPSource constuctor protected to be able to inherit it
- made WAVAudioFileServerMediaSubsession methods and data members protected to be able to inherit it
- slightly improved WAVAudioFileServerMediaSubsession code to make it more robust

If you are interested in such changes, you may find all of them attached. I hope you find this usefull and correct.

Regards, 
Victor Kozhuhov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.live555.com/pipermail/live-devel/attachments/20061016/72b0bbe7/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.zip
Type: application/x-zip-compressed
Size: 12035 bytes
Desc: not available
Url : http://lists.live555.com/pipermail/live-devel/attachments/20061016/72b0bbe7/attachment-0001.bin 


More information about the live-devel mailing list