mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Fix misspelling error in app config. v6.0.133 (#4077)
1. misspelling fix; 2. remove finished TODO; --------- Co-authored-by: Haibo Chen <495810242@qq.com>
This commit is contained in:
parent
7ab012c60f
commit
75ddd8f5b6
14 changed files with 156 additions and 155 deletions
|
@ -37,7 +37,7 @@ SrsMessageHeader::SrsMessageHeader()
|
|||
|
||||
timestamp = 0;
|
||||
// we always use the connection chunk-id
|
||||
perfer_cid = RTMP_CID_OverConnection;
|
||||
prefer_cid = RTMP_CID_OverConnection;
|
||||
}
|
||||
|
||||
SrsMessageHeader::~SrsMessageHeader()
|
||||
|
@ -113,7 +113,7 @@ void SrsMessageHeader::initialize_amf0_script(int size, int stream)
|
|||
stream_id = (int32_t)stream;
|
||||
|
||||
// amf0 script use connection2 chunk-id
|
||||
perfer_cid = RTMP_CID_OverConnection2;
|
||||
prefer_cid = RTMP_CID_OverConnection2;
|
||||
}
|
||||
|
||||
void SrsMessageHeader::initialize_audio(int size, uint32_t time, int stream)
|
||||
|
@ -125,7 +125,7 @@ void SrsMessageHeader::initialize_audio(int size, uint32_t time, int stream)
|
|||
stream_id = (int32_t)stream;
|
||||
|
||||
// audio chunk-id
|
||||
perfer_cid = RTMP_CID_Audio;
|
||||
prefer_cid = RTMP_CID_Audio;
|
||||
}
|
||||
|
||||
void SrsMessageHeader::initialize_video(int size, uint32_t time, int stream)
|
||||
|
@ -137,7 +137,7 @@ void SrsMessageHeader::initialize_video(int size, uint32_t time, int stream)
|
|||
stream_id = (int32_t)stream;
|
||||
|
||||
// video chunk-id
|
||||
perfer_cid = RTMP_CID_Video;
|
||||
prefer_cid = RTMP_CID_Video;
|
||||
}
|
||||
|
||||
SrsCommonMessage::SrsCommonMessage()
|
||||
|
@ -175,7 +175,7 @@ SrsSharedMessageHeader::SrsSharedMessageHeader()
|
|||
{
|
||||
payload_length = 0;
|
||||
message_type = 0;
|
||||
perfer_cid = 0;
|
||||
prefer_cid = 0;
|
||||
}
|
||||
|
||||
SrsSharedMessageHeader::~SrsSharedMessageHeader()
|
||||
|
@ -244,7 +244,7 @@ srs_error_t SrsSharedPtrMessage::create(SrsMessageHeader* pheader, char* payload
|
|||
if (pheader) {
|
||||
ptr->header.message_type = pheader->message_type;
|
||||
ptr->header.payload_length = size;
|
||||
ptr->header.perfer_cid = pheader->perfer_cid;
|
||||
ptr->header.prefer_cid = pheader->prefer_cid;
|
||||
this->timestamp = pheader->timestamp;
|
||||
this->stream_id = pheader->stream_id;
|
||||
}
|
||||
|
@ -284,9 +284,9 @@ bool SrsSharedPtrMessage::check(int stream_id)
|
|||
|
||||
// we donot use the complex basic header,
|
||||
// ensure the basic header is 1bytes.
|
||||
if (ptr->header.perfer_cid < 2 || ptr->header.perfer_cid > 63) {
|
||||
srs_info("change the chunk_id=%d to default=%d", ptr->header.perfer_cid, RTMP_CID_ProtocolControl);
|
||||
ptr->header.perfer_cid = RTMP_CID_ProtocolControl;
|
||||
if (ptr->header.prefer_cid < 2 || ptr->header.prefer_cid > 63) {
|
||||
srs_info("change the chunk_id=%d to default=%d", ptr->header.prefer_cid, RTMP_CID_ProtocolControl);
|
||||
ptr->header.prefer_cid = RTMP_CID_ProtocolControl;
|
||||
}
|
||||
|
||||
// we assume that the stream_id in a group must be the same.
|
||||
|
@ -317,10 +317,10 @@ bool SrsSharedPtrMessage::is_video()
|
|||
int SrsSharedPtrMessage::chunk_header(char* cache, int nb_cache, bool c0)
|
||||
{
|
||||
if (c0) {
|
||||
return srs_chunk_header_c0(ptr->header.perfer_cid, (uint32_t)timestamp,
|
||||
return srs_chunk_header_c0(ptr->header.prefer_cid, (uint32_t)timestamp,
|
||||
ptr->header.payload_length, ptr->header.message_type, stream_id, cache, nb_cache);
|
||||
} else {
|
||||
return srs_chunk_header_c3(ptr->header.perfer_cid, (uint32_t)timestamp,
|
||||
return srs_chunk_header_c3(ptr->header.prefer_cid, (uint32_t)timestamp,
|
||||
cache, nb_cache);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -153,10 +153,10 @@ public:
|
|||
// @remark, we use 64bits for large time for jitter detect and hls.
|
||||
int64_t timestamp;
|
||||
public:
|
||||
// Get the perfered cid(chunk stream id) which sendout over.
|
||||
// Get the prefered cid(chunk stream id) which sendout over.
|
||||
// set at decoding, and canbe used for directly send message,
|
||||
// For example, dispatch to all connections.
|
||||
int perfer_cid;
|
||||
int prefer_cid;
|
||||
public:
|
||||
SrsMessageHeader();
|
||||
virtual ~SrsMessageHeader();
|
||||
|
@ -230,10 +230,10 @@ public:
|
|||
// (1-7) are reserved for protocol control messages.
|
||||
// For example, RTMP_MSG_AudioMessage or RTMP_MSG_VideoMessage.
|
||||
int8_t message_type;
|
||||
// Get the perfered cid(chunk stream id) which sendout over.
|
||||
// Get the prefered cid(chunk stream id) which sendout over.
|
||||
// set at decoding, and canbe used for directly send message,
|
||||
// For example, dispatch to all connections.
|
||||
int perfer_cid;
|
||||
int prefer_cid;
|
||||
public:
|
||||
SrsSharedMessageHeader();
|
||||
virtual ~SrsSharedMessageHeader();
|
||||
|
@ -313,7 +313,7 @@ public:
|
|||
// if this or copy deleted, free payload when count is 0, or count--.
|
||||
// @remark, assert object is created.
|
||||
virtual int count();
|
||||
// check perfer cid and stream id.
|
||||
// check prefer cid and stream id.
|
||||
// @return whether stream id already set.
|
||||
virtual bool check(int stream_id);
|
||||
public:
|
||||
|
|
|
@ -1180,7 +1180,7 @@ int srs_hex_to_data(uint8_t* data, const char* p, int size)
|
|||
return size / 2;
|
||||
}
|
||||
|
||||
int srs_chunk_header_c0(int perfer_cid, uint32_t timestamp, int32_t payload_length, int8_t message_type, int32_t stream_id, char* cache, int nb_cache)
|
||||
int srs_chunk_header_c0(int prefer_cid, uint32_t timestamp, int32_t payload_length, int8_t message_type, int32_t stream_id, char* cache, int nb_cache)
|
||||
{
|
||||
// to directly set the field.
|
||||
char* pp = NULL;
|
||||
|
@ -1194,7 +1194,7 @@ int srs_chunk_header_c0(int perfer_cid, uint32_t timestamp, int32_t payload_leng
|
|||
}
|
||||
|
||||
// write new chunk stream header, fmt is 0
|
||||
*p++ = 0x00 | (perfer_cid & 0x3F);
|
||||
*p++ = 0x00 | (prefer_cid & 0x3F);
|
||||
|
||||
// chunk message header, 11 bytes
|
||||
// timestamp, 3bytes, big-endian
|
||||
|
@ -1255,7 +1255,7 @@ int srs_chunk_header_c0(int perfer_cid, uint32_t timestamp, int32_t payload_leng
|
|||
return (int)(p - cache);
|
||||
}
|
||||
|
||||
int srs_chunk_header_c3(int perfer_cid, uint32_t timestamp, char* cache, int nb_cache)
|
||||
int srs_chunk_header_c3(int prefer_cid, uint32_t timestamp, char* cache, int nb_cache)
|
||||
{
|
||||
// to directly set the field.
|
||||
char* pp = NULL;
|
||||
|
@ -1269,9 +1269,9 @@ int srs_chunk_header_c3(int perfer_cid, uint32_t timestamp, char* cache, int nb_
|
|||
}
|
||||
|
||||
// write no message header chunk stream, fmt is 3
|
||||
// @remark, if perfer_cid > 0x3F, that is, use 2B/3B chunk header,
|
||||
// @remark, if prefer_cid > 0x3F, that is, use 2B/3B chunk header,
|
||||
// SRS will rollback to 1B chunk header.
|
||||
*p++ = 0xC0 | (perfer_cid & 0x3F);
|
||||
*p++ = 0xC0 | (prefer_cid & 0x3F);
|
||||
|
||||
// for c0
|
||||
// chunk extended timestamp header, 0 or 4 bytes, big-endian
|
||||
|
|
|
@ -151,13 +151,13 @@ extern char* srs_data_to_hex_lowercase(char* des, const uint8_t* src, int len);
|
|||
// @param cache, the cache to write header.
|
||||
// @param nb_cache, the size of cache.
|
||||
// @return The size of header. 0 if cache not enough.
|
||||
extern int srs_chunk_header_c0(int perfer_cid, uint32_t timestamp, int32_t payload_length, int8_t message_type, int32_t stream_id, char* cache, int nb_cache);
|
||||
extern int srs_chunk_header_c0(int prefer_cid, uint32_t timestamp, int32_t payload_length, int8_t message_type, int32_t stream_id, char* cache, int nb_cache);
|
||||
|
||||
// Generate the c3 chunk header for msg.
|
||||
// @param cache, the cache to write header.
|
||||
// @param nb_cache, the size of cache.
|
||||
// @return the size of header. 0 if cache not enough.
|
||||
extern int srs_chunk_header_c3(int perfer_cid, uint32_t timestamp, char* cache, int nb_cache);
|
||||
extern int srs_chunk_header_c3(int prefer_cid, uint32_t timestamp, char* cache, int nb_cache);
|
||||
|
||||
// For utest to mock it.
|
||||
#include <sys/time.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue