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