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

Merge branch '3.0release' of https://github.com/ossrs/srs into 3.0release

# Conflicts:
#	trunk/src/kernel/srs_kernel_utility.hpp
This commit is contained in:
Harlan 2018-08-15 07:37:12 +08:00
commit 22c5af62cf
49 changed files with 4667 additions and 4248 deletions

View file

@ -203,7 +203,7 @@ bool SrsFlvAudio::aac(char* data, int size)
// 1 = 11 kHz = 11025 Hz
// 2 = 22 kHz = 22050 Hz
// 3 = 44 kHz = 44100 Hz
int srs_flv_srates[] = {5512, 11025, 22050, 44100};
int srs_flv_srates[] = {5512, 11025, 22050, 44100, 0};
// the sample rates in the codec,
// in the sequence header.

View file

@ -112,6 +112,8 @@
#define ERROR_ASPROCESS_PPID 1073
#define ERROR_EXCEED_CONNECTIONS 1074
#define ERROR_SOCKET_SETKEEPALIVE 1075
#define ERROR_SOCKET_NO_NODELAY 1076
#define ERROR_SOCKET_SNDBUF 1077
///////////////////////////////////////////////////////
// RTMP protocol error.
@ -318,6 +320,7 @@
#define ERROR_KAFKA_CODEC_MESSAGE 4036
#define ERROR_KAFKA_CODEC_PRODUCER 4037
#define ERROR_HTTP_302_INVALID 4038
#define ERROR_BASE64_DECODE 4039
///////////////////////////////////////////////////////
// HTTP API error.

View file

@ -182,8 +182,11 @@ SrsTsMessage* SrsTsMessage::detach()
cp->sid = sid;
cp->PES_packet_length = PES_packet_length;
cp->continuity_counter = continuity_counter;
srs_freep(cp->payload);
cp->payload = payload;
payload = NULL;
return cp;
}

File diff suppressed because it is too large Load diff

View file

@ -147,27 +147,8 @@ extern uint32_t srs_crc32_ieee(const void* buf, int size, uint32_t previous = 0)
/**
* 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(uint8_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 uint8_t* in, int in_size);
extern srs_error_t srs_av_base64_decode(std::string cipher, std::string& plaintext);
/**
* Calculate the output size needed to base64-encode x bytes to a
@ -180,11 +161,12 @@ extern char* srs_av_base64_encode(char* out, int out_size, const uint8_t* in, in
* for example, p=config='139056E5A0'
* output hex to data={0x13, 0x90, 0x56, 0xe5, 0xa0}
*/
extern int ff_hex_to_data(uint8_t* data, const char* p);
extern int srs_hex_to_data(uint8_t* data, const char* p, int size);
/**
* convert data string to hex.
*/
extern char *srs_data_to_hex(char *buff, const uint8_t *src, int s);
extern char *srs_data_to_hex(char *des, const uint8_t *src, int len);
/**
* generate the c0 chunk header for msg.