From e96406eda4f143f101bd44372f7b2d542183000a Mon Sep 17 00:00:00 2001 From: Martin Storsjö Date: Tue, 1 Jan 2013 23:41:29 +0200 Subject: rtsp: Add support for depacketizing RTP data via custom IO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To use this, set sdpflags=custom_io to the sdp demuxer. During the avformat_open_input call, the SDP is read from the AVFormatContext AVIOContext (ctx->pb) - after the avformat_open_input call, during the av_read_frame() calls, the same ctx->pb is used for reading packets (and sending back RTCP RR packets). Normally, one would use this with a read-only AVIOContext for the SDP during the avformat_open_input call, then close that one and replace it with a read-write one for the packets after the avformat_open_input call has returned. This allows using the RTP depacketizers as "pure" demuxers, without having them tied to the libavformat network IO. Signed-off-by: Martin Storsjö --- libavformat/rtpdec.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libavformat/rtpdec.h') diff --git a/libavformat/rtpdec.h b/libavformat/rtpdec.h index 2d962c82c7..7c51f5a8d2 100644 --- a/libavformat/rtpdec.h +++ b/libavformat/rtpdec.h @@ -68,10 +68,11 @@ void ff_rtp_send_punch_packets(URLContext* rtp_handle); /** * some rtp servers assume client is dead if they don't hear from them... - * so we send a Receiver Report to the provided URLContext + * so we send a Receiver Report to the provided URLContext or AVIOContext * (we don't have access to the rtcp handle from here) */ -int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd, int count); +int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd, + AVIOContext *avio, int count); // these statistics are used for rtcp receiver reports... typedef struct RTPStatistics { -- cgit v1.2.3