In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Scene
After the RTSP connection is established, the video data is received through rtp over tcp. The data stream obtained in the following example still has the problem of 2 RTP payloads apart, but from a byte point of view, the RTP load is very small and should not have any impact on the data.
Description
Masks RecvBuffer-> RecvBuffer (pszOneBytes, nRealReadLen, 1); the second parameter is the actual number of bytes read, and the third parameter specifies how many bytes are currently read
Code
Struct RTPHeader
{
Unsigned char szHeader [4]
}
Unsigned short sRTPPayLoadLen = 0 RTP / the length of the entire RTP message is determined by the two bytes after $0x00 | 0x01
Unsigned char cOneBytes = 0 Byte / save the first byte to determine whether it is $to determine whether it is a RTP payload packet or a RTSP instruction package
Char* pszOneBytes = (char*) & cOneBytes;// can only receive data through symbolic characters, so forced conversion is used.
Int nRealReadLen = 0 position / saved the number of bytes read each time
Int nRet = mSecretsock-> RecvBuffer (pszOneBytes, nRealReadLen, 1); / / after establishing the rtsp link, start reading the first byte
If (nRet RecvBuffer (pszOneBytes, nRealReadLen, 1)
If ((nRet RecvBuffer (pszOneBytes, nRealReadLen, 1); / / try to read the high load length
If ((nRet RecvBuffer (pszOneBytes, nRealReadLen, 1); / / attempt to read the low load length
If ((nRet 1500) continue;// data cannot exceed 1500, LAN transmission bandwidth requirements
Char szRTPPayLoadContent [1500] = {0}
NRealReadLen = 0
NRet = masked socks-> RecvBuffer (szRTPPayLoadContent, nRealReadLen, sRTPPayLoadLen)
RTPHeader* pHeader = (RTPHeader*) szRTPPayLoadContent
Unsigned short sRTPSeq = (pHeader- > szHeader [2] szHeader [3])
/ / std::cout
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.