本文是部分代码解析,处理client的报文的函数调用handleRequests(),发送图像的函数调用broadcastCurrentFrame()。源码地址:git clone https://github.com/brainrecall/Micro-RTSP
1.在void rtsp_server(void)函数中,创建client_worker任务。
2. client_worker任务会在while循环中不停的处理client的报文(handleRequests),和发送frame给client (broadcastCurrentFrame).
下面是发送图像的函数调用。
broadcastCurrentFrame
inline ssize_t udpsocketsend()
下面是处理client请求的函数调用:handleRequests。
handleRequests->Handle_RtspRequest
分别处理4种方法,只是回复报文,没有传递图像。