mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
GB28181: Remove chinese comments.
This commit is contained in:
parent
977e027d86
commit
c779d95246
2 changed files with 52 additions and 60 deletions
|
@ -551,7 +551,6 @@ srs_error_t SrsGb28181TcpPsRtpProcessor::on_rtp_packet(char* buf, int nb_buf, st
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
//itoa(port, port_string, 10);
|
//itoa(port, port_string, 10);
|
||||||
|
|
||||||
int peer_port = port;// atoi(port_string);
|
int peer_port = port;// atoi(port_string);
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
|
@ -776,7 +775,6 @@ srs_error_t SrsGb28181TcpPsRtpProcessor::on_rtp_packet_jitter(char* buf, int nb_
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
//itoa(port, port_string, 10);
|
//itoa(port, port_string, 10);
|
||||||
|
|
||||||
int peer_port = port;// atoi(port_string);
|
int peer_port = port;// atoi(port_string);
|
||||||
|
|
||||||
if (true) {
|
if (true) {
|
||||||
|
@ -2422,9 +2420,9 @@ void SrsGb28181Manger::destroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
//destory gb28181 muxer
|
//destory gb28181 muxer
|
||||||
std::map<std::string, SrsGb28181RtmpMuxer*>::iterator it2;
|
std::map<std::string, SrsGb28181RtmpMuxer*>::iterator it;
|
||||||
for (it2 = rtmpmuxers.begin(); it2 != rtmpmuxers.end(); ++it2) {
|
for (it = rtmpmuxers.begin(); it != rtmpmuxers.end(); ++it) {
|
||||||
SrsGb28181RtmpMuxer* muxer = it2->second;
|
SrsGb28181RtmpMuxer* muxer = it->second;
|
||||||
SrsGb28181StreamChannel sess = muxer->get_channel();
|
SrsGb28181StreamChannel sess = muxer->get_channel();
|
||||||
rtmpmuxer_unmap_by_ssrc(sess.get_ssrc());
|
rtmpmuxer_unmap_by_ssrc(sess.get_ssrc());
|
||||||
manager->remove(muxer);
|
manager->remove(muxer);
|
||||||
|
|
|
@ -68,37 +68,36 @@ public:
|
||||||
}
|
}
|
||||||
static bool IsUTF8(const char *pInBuf, int InLen)
|
static bool IsUTF8(const char *pInBuf, int InLen)
|
||||||
{
|
{
|
||||||
if (InLen < 0)
|
if (InLen < 0) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int nBytes = 0; //UTF8可用1-6个字节编码
|
int nBytes = 0;
|
||||||
unsigned char chr = 0;
|
unsigned char chr = 0;
|
||||||
|
|
||||||
while (i < InLen)
|
while (i < InLen) {
|
||||||
{
|
|
||||||
chr = *(pInBuf + i);
|
chr = *(pInBuf + i);
|
||||||
if (nBytes == 0) //计算字节数
|
if (nBytes == 0) {
|
||||||
{
|
if ((chr & 0x80) != 0) {
|
||||||
if ((chr & 0x80) != 0)
|
while ((chr & 0x80) != 0) {
|
||||||
{
|
|
||||||
while ((chr & 0x80) != 0)
|
|
||||||
{
|
|
||||||
chr <<= 1;
|
chr <<= 1;
|
||||||
nBytes++;
|
nBytes++;
|
||||||
}
|
}
|
||||||
if (nBytes < 2 || nBytes > 6)
|
if (nBytes < 2 || nBytes > 6) {
|
||||||
return false; //第一个字节最少为110x xxxx
|
return false;
|
||||||
nBytes--; //减去自身占的一个字节
|
|
||||||
}
|
}
|
||||||
|
nBytes--;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ((chr & 0xc0) != 0x80) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else //多字节除了第一个字节外剩下的字节
|
|
||||||
{
|
|
||||||
if ((chr & 0xc0) != 0x80)
|
|
||||||
return false; //剩下的字节都是10xx xxxx的形式
|
|
||||||
nBytes--;
|
nBytes--;
|
||||||
}
|
}
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nBytes == 0;
|
return nBytes == 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -491,11 +490,6 @@ srs_error_t SrsSipStack::parse_xml(std::string xml_msg, std::map<std::string, st
|
||||||
xml_layer--;
|
xml_layer--;
|
||||||
|
|
||||||
if (json_key[xml_layer] == "Item") {
|
if (json_key[xml_layer] == "Item") {
|
||||||
// std::map<string, string>::iterator it2;
|
|
||||||
// for (it2 = one_item.begin(); it2 != one_item.end(); ++it2) {
|
|
||||||
// srs_trace("========one_item========%s:%s", it2->first.c_str(), it2->second.c_str());
|
|
||||||
// }
|
|
||||||
// srs_trace("========one_item end========");
|
|
||||||
in_item_tag = 0;
|
in_item_tag = 0;
|
||||||
// all items (DeviceList, Alarmstatus, RecordList) have "DeviceID"
|
// all items (DeviceList, Alarmstatus, RecordList) have "DeviceID"
|
||||||
if (one_item.find("DeviceID") != one_item.end())
|
if (one_item.find("DeviceID") != one_item.end())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue