1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

for #133, rtsp parse the announce packet, parse the sps/pps and audio sequence header by base64.

This commit is contained in:
winlin 2015-02-17 14:16:02 +08:00
parent 604f4cc57b
commit 4807f7850d
5 changed files with 729 additions and 13 deletions

View file

@ -85,5 +85,35 @@ extern bool srs_aac_startswith_adts(SrsStream* stream);
*/
extern u_int32_t srs_crc32(const void* buf, int size);
/**
* Decode a base64-encoded string.
*
* @param out buffer for decoded data
* @param in null-terminated input string
* @param out_size size in bytes of the out buffer, must be at
* least 3/4 of the length of in
* @return number of bytes written, or a negative value in case of
* invalid input
*/
extern int srs_av_base64_decode(u_int8_t* out, const char* in, int out_size);
/**
* Encode data to base64 and null-terminate.
*
* @param out buffer for encoded data
* @param out_size size in bytes of the out buffer (including the
* null terminator), must be at least AV_BASE64_SIZE(in_size)
* @param in input buffer containing the data to encode
* @param in_size size in bytes of the in buffer
* @return out or NULL in case of error
*/
extern char* srs_av_base64_encode(char* out, int out_size, const u_int8_t* in, int in_size);
/**
* Calculate the output size needed to base64-encode x bytes to a
* null-terminated string.
*/
#define SRS_AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
#endif