Go to the documentation of this file.
21 #ifndef AVFORMAT_RTSP_H
22 #define AVFORMAT_RTSP_H
75 #define RTSP_DEFAULT_PORT 554
76 #define RTSPS_DEFAULT_PORT 322
77 #define RTSP_MAX_TRANSPORTS 8
78 #define RTSP_DEFAULT_AUDIO_SAMPLERATE 44100
79 #define RTSP_RTP_PORT_MIN 5000
80 #define RTSP_RTP_PORT_MAX 65000
81 #define SDP_MAX_SIZE 16384
424 #define RTSP_FLAG_FILTER_SRC 0x1
427 #define RTSP_FLAG_LISTEN 0x2
428 #define RTSP_FLAG_CUSTOM_IO 0x4
429 #define RTSP_FLAG_RTCP_TO_SOURCE 0x8
431 #define RTSP_FLAG_PREFER_TCP 0x10
432 #define RTSP_FLAG_SATIP_RAW 0x20
498 const char *url,
const char *
headers);
517 const char *method,
const char *url,
520 unsigned char **content_ptr,
521 const unsigned char *send_content,
522 int send_content_length);
530 const char *url,
const char *
headers,
557 unsigned char **content_ptr,
558 int return_on_interleaved_data,
const char *method);
621 uint8_t *buf,
int buf_size);
640 int lower_transport,
const char *real_challenge);
int initial_timeout
Timeout to wait for incoming connections.
@ RTSP_STATE_PAUSED
initialized, but not receiving data
int initial_pause
Do not begin to play the stream immediately.
int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply, unsigned char **content_ptr, int return_on_interleaved_data, const char *method)
Read a RTSP message from the server, or prepare to read data packets if we're reading data interleave...
int64_t last_cmd_time
timestamp of the last RTSP command that we sent to the RTSP server.
void * transport_priv
RTP/RDT parse context if input, RTP AVFormatContext if output.
int ff_rtsp_send_cmd_with_content(AVFormatContext *s, const char *method, const char *url, const char *headers, RTSPMessageHeader *reply, unsigned char **content_ptr, const unsigned char *send_content, int send_content_length)
Send a command to the RTSP server and wait for the reply.
URLContext * rtp_handle
RTP stream handle (if UDP)
@ RTSP_SERVER_RTP
Standards-compliant RTP-server.
@ RTSP_STATE_SEEKING
initialized, requesting a seek
int ff_rtsp_send_cmd(AVFormatContext *s, const char *method, const char *url, const char *headers, RTSPMessageHeader *reply, unsigned char **content_ptr)
Send a command to the RTSP server and wait for the reply.
enum RTSPControlTransport control_transport
RTSP transport mode, such as plain or tunneled.
@ RTSP_MODE_PLAIN
Normal RTSP.
@ RTSP_TRANSPORT_RTP
Standards-compliant RTP.
char source[INET6_ADDRSTRLEN+1]
source IP address
int get_parameter_supported
Whether the server supports the GET_PARAMETER method.
int nb_include_source_addrs
Number of source-specific multicast include source IP addresses (from SDP content)
int server_port_min
UDP unicast server port range; the ports to which we should connect to receive unicast UDP RTP/RTCP d...
char auth[128]
plaintext authorization line (username:password)
int interleaved_min
interleave IDs; copies of RTSPTransportField->interleaved_min/max for the selected transport.
enum RTSPLowerTransport lower_transport
network layer transport protocol; e.g.
int rtp_port_min
Minimum and maximum local UDP ports.
@ RTSP_LOWER_TRANSPORT_CUSTOM
Custom IO - not a public option for lower_transport_mask, but set in the SDP demuxer based on a flag.
int interleaved_min
interleave ids, if TCP transport; each TCP/RTSP data packet starts with a '$', stream length and stre...
Describe a single stream, as identified by a single m= line block in the SDP content.
void ff_rtsp_undo_setup(AVFormatContext *s, int send_packets)
Undo the effect of ff_rtsp_make_setup_request, close the transport_priv and rtp_handle fields.
void ff_rtsp_close_streams(AVFormatContext *s)
Close and free all streams within the RTSP (de)muxer.
int ff_rtsp_send_cmd_async(AVFormatContext *s, const char *method, const char *url, const char *headers)
Send a command to the RTSP server without waiting for the reply.
char real_challenge[64]
the "RealChallenge1:" field from the server
@ RTSP_SERVER_REAL
Realmedia-style server.
int64_t seek_timestamp
the seek value requested when calling av_seek_frame().
int ff_sdp_parse(AVFormatContext *s, const char *content)
Parse an SDP description of streams by populating an RTSPState struct within the AVFormatContext; als...
int feedback
Enable sending RTCP feedback messages according to RFC 4585.
AVFormatContext * asf_ctx
The following are used for RTP/ASF streams.
int nb_rtsp_streams
number of items in the 'rtsp_streams' variable
@ RTSP_TRANSPORT_RDT
Realmedia Data Transport.
@ RTSP_STATE_STREAMING
initialized and sending/receiving data
int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
Get the description of the stream and set up the RTSPStream child objects.
int lower_transport_mask
A mask with all requested transport methods.
@ RTSP_MODE_TUNNEL
RTSP over HTTP (tunneling)
int stream_index
corresponding stream index, if any.
struct sockaddr_storage destination
destination IP address
@ RTSP_LOWER_TRANSPORT_HTTPS
HTTPS tunneled.
URLContext * rtsp_hd_out
Additional output handle, used when input and output are done separately, eg for HTTP tunneling.
RTSPControlTransport
Transport mode for the RTSP data.
int reordering_queue_size
Size of RTP packet reordering queue.
struct MpegTSContext * ts
The following are used for parsing raw mpegts in udp.
int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
Open RTSP transport context.
struct pollfd * p
Polling array for udp.
char control_uri[MAX_URL_SIZE]
some MS RTSP streams contain a URL in the SDP that we need to use for all subsequent RTSP requests,...
int ttl
time-to-live value (required for multicast); the amount of HOPs that packets will be allowed to make ...
int ff_rtsp_fetch_packet(AVFormatContext *s, AVPacket *pkt)
Receive one packet from the RTSPStreams set up in the AVFormatContext (which should contain a RTSPSta...
const RTPDynamicProtocolHandler * dynamic_handler
The following are used for dynamic protocols (rtpdec_*.c/rdt.c)
int rtp_muxer_flags
Option flags for the chained RTP muxer.
int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr)
Announce the stream to the server and set up the RTSPStream child objects for each media stream.
char session_id[512]
copy of RTSPMessageHeader->session_id, i.e.
Describe the class of an AVClass context structure.
uint64_t asf_pb_pos
cache for position of the asf demuxer, since we load a new data packet in the bytecontext for each in...
RTSPServerType
Identify particular servers that require special handling, such as standards-incompliant "Transport:"...
enum AVDiscard * real_setup
current stream setup.
#define RTSP_MAX_TRANSPORTS
enum RTSPClientState state
indicator of whether we are currently receiving data from the server.
uint8_t * recvbuf
Reusable buffer for receiving packets.
int sdp_port
The following are used only in SDP, not RTSP.
struct RTSPSource ** exclude_source_addrs
Source-specific multicast exclude source IP addresses (from SDP content)
const AVOption ff_rtsp_options[]
HTTP Authentication state structure.
PayloadContext * dynamic_protocol_context
private data associated with the dynamic protocol
int ff_rtsp_tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st, uint8_t *buf, int buf_size)
Receive one RTP packet from an TCP interleaved RTSP stream.
int rtsp_flags
Various option flags for the RTSP muxer/demuxer.
void ff_rtsp_close_connections(AVFormatContext *s)
Close all connection handles within the RTSP (de)muxer.
Private data for the RTSP demuxer.
struct RTSPSource ** include_source_addrs
Source-specific multicast include source IP addresses (from SDP content)
enum RTSPLowerTransport lower_transport
the negotiated network layer transport protocol; e.g.
char last_reply[2048]
The last reply of the server to a RTSP command.
enum RTSPTransport transport
data/packet transport protocol; e.g.
struct RTSPStream ** rtsp_streams
streams in this session
int ff_rtsp_skip_packet(AVFormatContext *s)
Skip a RTP/TCP interleaved packet.
int seq
RTSP command sequence number.
HTTPAuthState auth_state
authentication state
void ff_rtsp_parse_line(AVFormatContext *s, RTSPMessageHeader *reply, const char *buf, RTSPState *rt, const char *method)
char last_subscription[1024]
the last value of the "SET_PARAMETER Subscribe:" RTSP command.
int nb_exclude_source_addrs
Number of source-specific multicast exclude source IP addresses (from SDP content)
int timeout
copy of RTSPMessageHeader->timeout, i.e.
@ RTSP_SERVER_SATIP
SAT>IP server.
int media_type_mask
Mask of all requested media types.
char addr[128]
Source-specific multicast include source IP address (from SDP content)
int need_subscription
The following are used for Real stream selection.
int ff_rtsp_tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st)
Send buffered packets over TCP.
int ff_rtsp_parse_streaming_commands(AVFormatContext *s)
Parse RTSP commands (OPTIONS, PAUSE and TEARDOWN) during streaming in listen mode.
uint32_t ssrc
SSRC for this stream, to allow identifying RTCP packets before the first RTP packet.
@ RTSP_LOWER_TRANSPORT_TCP
TCP; interleaved in RTSP.
int sdp_ttl
IP Time-To-Live (from SDP content)
int client_port_min
UDP client ports; these should be the local ports of the UDP RTP (and RTCP) sockets over which we rec...
RTSPLowerTransport
Network layer over which RTP/etc packet data will be transported.
@ RTSP_LOWER_TRANSPORT_UDP_MULTICAST
UDP/multicast.
void * cur_transport_priv
RTSPStream->transport_priv of the last stream that we read a packet from.
int sdp_payload_type
payload type
struct sockaddr_storage sdp_ip
IP address (from SDP content)
@ RTSP_LOWER_TRANSPORT_HTTP
HTTP tunneled - not a proper transport mode as such, only for use via AVOptions.
This describes a single item in the "Transport:" line of one stream as negotiated by the SETUP RTSP c...
enum RTSPTransport transport
the negotiated data/packet transport protocol; e.g.
char control_url[MAX_URL_SIZE]
url for this stream (from SDP)
RTSPStatusCode
RTSP handling.
FFmpeg currently uses a custom build this text attempts to document some of its obscure features and options Makefile the full command issued by make and its output will be shown on the screen DBG Preprocess x86 external assembler files to a dbg asm file in the object which then gets compiled Helps in developing those assembler files DESTDIR Destination directory for the install useful to prepare packages or install FFmpeg in cross environments GEN Set to ‘1’ to generate the missing or mismatched references Makefile builds all the libraries and the executables fate Run the fate test note that you must have installed it fate list List all fate regression test targets install Install headers
@ RTSP_SERVER_WMS
Windows Media server.
@ RTSP_TRANSPORT_RAW
Raw data (over UDP)
int64_t stimeout
timeout of socket i/o operations.
enum AVDiscard * real_setup_cache
stream setup during the last frame read.
@ RTSP_STATE_IDLE
not initialized
RTSPClientState
Client state, i.e.
@ RTSP_LOWER_TRANSPORT_NB
This structure stores compressed data.
enum RTSPServerType server_type
brand of server that we're talking to; e.g.
RTSPTransport
Packet profile of the data that we will be receiving.
uint64_t packets
The number of returned packets.
int mode_record
transport set to record data
int accept_dynamic_rate
Whether the server accepts the x-Dynamic-Rate header.
int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port, int lower_transport, const char *real_challenge)
Do the SETUP requests for each stream for the chosen lower transport mode.
RTP/JPEG specific private data.
int ff_rtsp_connect(AVFormatContext *s)
Connect to the RTSP server and set up the individual media streams.
int port_min
UDP multicast port range; the ports to which we should connect to receive multicast UDP data.
@ RTSP_LOWER_TRANSPORT_UDP
UDP/unicast.
char * user_agent
User-Agent string.