libavformat下有rtsp.c和rtsp.h文件。函数
但rtsp.h并无被导出到API使用,rtsp/rtp和其余格式同样被封装为fetch
AVInputFormat。以下,orm
AVInputFormat ff_rtp_demuxer = {
.name = "rtp",
.long_name = NULL_IF_CONFIG_SMALL("RTP input"),
.priv_data_size = sizeof(RTSPState),
.read_probe = rtp_probe,
.read_header = rtp_read_header,
.read_packet = ff_rtsp_fetch_packet,
.read_close = sdp_read_close,
.flags = AVFMT_NOFILE,
.priv_class = &rtp_demuxer_class,
};input
ffmpeg封装了一个av_read_frame函数。这是一种应用程序主动的方式,但底层rtp是用udp传输,必然会有某种缓冲的机制在。form