Skip to content

Instantly share code, notes, and snippets.

@verma
Created June 27, 2012 18:43
Show Gist options
  • Save verma/3005945 to your computer and use it in GitHub Desktop.
Save verma/3005945 to your computer and use it in GitHub Desktop.
Write variable length rtp data to a file
void write_rtp(std::ostream& os, const char *rtp_data, int length) {
unsigned short len = htons((unsigned short)length);
os.write((char*)&len, sizeof(len));
os.write(rtp_data, length);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment