Skip to content

Instantly share code, notes, and snippets.

@verma
Created June 27, 2012 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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