From a8ad6ffafe89e3a83f343f69249338e8245816f7 Mon Sep 17 00:00:00 2001 From: Jordi Ortiz Date: Tue, 10 Jul 2012 19:36:11 +0200 Subject: rtsp: Add listen mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the RTSP demuxer act as a server, listening for an incoming connection. Signed-off-by: Martin Storsjö --- libavformat/rtsp.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libavformat/rtsp.h') diff --git a/libavformat/rtsp.h b/libavformat/rtsp.h index 41bf8bbb8a..a738a3d434 100644 --- a/libavformat/rtsp.h +++ b/libavformat/rtsp.h @@ -372,11 +372,17 @@ typedef struct RTSPState { * Minimum and maximum local UDP ports. */ int rtp_port_min, rtp_port_max; + + /** + * Timeout to wait for incoming connections. + */ + int initial_timeout; } RTSPState; #define RTSP_FLAG_FILTER_SRC 0x1 /**< Filter incoming UDP packets - receive packets only from the right source address and port. */ +#define RTSP_FLAG_LISTEN 0x2 /**< Wait for incoming connections. */ /** * Describe a single stream, as identified by a single m= line block in the @@ -528,6 +534,12 @@ int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply); */ int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr); +/** + * Parse RTSP commands (OPTIONS, PAUSE and TEARDOWN) during streaming in + * listen mode. + */ +int ff_rtsp_parse_streaming_commands(AVFormatContext *s); + /** * Parse an SDP description of streams by populating an RTSPState struct * within the AVFormatContext; also allocate the RTP streams and the -- cgit v1.2.3