ireader / media-server

RTSP/RTP/RTMP/FLV/HLS/MPEG-TS/MPEG-PS/MPEG-DASH/MP4/fMP4/MKV/WebM
MIT License
2.98k stars 1.06k forks source link

你好,请问RTSP服务器,多个客户端rtp over tcp连接下,如何区分不同的RTCP的包,提供给rtsp_muxer #311

Open Pluto-kk opened 9 months ago

Pluto-kk commented 9 months ago

code 如上面代码中,在onrtp回调中,有用户传入参数param和channel,请问如何区分是来自于哪个连接的RTCP包,麻烦有时间看一下,谢谢 if(rtp->onrtp) rtp->onrtp(rtp->param, rtp->channel, rtp->data, rtp->length);

ireader commented 9 months ago

这里的rtp_over_rtsp是每个连接独立的,每个rtsp对应一个连接, 多个用户有多个不同rtsp对象。

同样多个用户对应不同的rtp对象。

Pluto-kk commented 9 months ago

image image 明白。有个地方,通过rtsp_server_listen创建连接的多个rtsp对象,都是公用的rtsp_server_listen中传入的同个aio_rtsp_handler_t,使用相同的onrtp回调函数,在这个函数中只有区分通道号,区分不了是哪一个rtsp session

ireader commented 9 months ago

感谢反馈, onrtp回调确实少了关联信息,我考虑下怎么建立关联关系。

ireader commented 9 months ago

设计时只考虑了rtsp拉流模式, 没有充分考虑到推流模式,漏掉了rtp over rtsp推流场景。

Pluto-kk commented 9 months ago

image image 你好,发现在rtp over tcp场景下,推流发送使用的是rtsp_server_send_interleaved_data,调用的send阻塞接口,在客户端断网情况下会一直阻塞住