Tutorial :RTP sequence extract



Question:

A RTP packet consists of a 12-byte RTP header and subsequent RTP payload The 3rd and 4th byte of the header contain the Most-Significant-Byte and Least-Significant-Byte of the sequence number of the RTP packet Seq Num= (MSB<<8)+LSB

char pszPacket[12];

...

long lSeq = ???? - How to get the sequence number from a packet?


Solution:1

unsigned short seq = (packet[2] << 8) | packet[3];  


Solution:2

Surely thats just "long lSeq = (unsigned char)(pszPacket[2] << 8) | (unsigned char)pszPacket[3];"?


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »