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/rtsp.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'libavformat/rtsp.h') diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h index 043b67aa6f..3260f6c92d 100644 --- a/libavformat/rtsp.h +++ b/libavformat/rtsp.h @@ -42,6 +42,10 @@ enum RTSPLowerTransport { RTSP_LOWER_TRANSPORT_HTTP = 8, /**< HTTP tunneled - not a proper transport mode as such, only for use via AVOptions */ + RTSP_LOWER_TRANSPORT_CUSTOM = 16, /**< Custom IO - not a public + option for lower_transport_mask, + but set in the SDP demuxer based + on a flag. */ }; /** @@ -396,6 +400,7 @@ typedef struct RTSPState { receive packets only from the right source address and port. */ #define RTSP_FLAG_LISTEN 0x2 /**< Wait for incoming connections. */ +#define RTSP_FLAG_CUSTOM_IO 0x4 /**< Do all IO via the AVIOContext. */ /** * Describe a single stream, as identified by a single m= line block in the -- cgit v1.2.3