21 #ifndef AVFORMAT_RTSP_H
22 #define AVFORMAT_RTSP_H
72 #define RTSP_DEFAULT_PORT 554
73 #define RTSPS_DEFAULT_PORT 322
74 #define RTSP_MAX_TRANSPORTS 8
75 #define RTSP_TCP_MAX_PACKET_SIZE 1472
76 #define RTSP_DEFAULT_NB_AUDIO_CHANNELS 1
77 #define RTSP_DEFAULT_AUDIO_SAMPLERATE 44100
78 #define RTSP_RTP_PORT_MIN 5000
79 #define RTSP_RTP_PORT_MAX 65000
414 #define RTSP_FLAG_FILTER_SRC 0x1
417 #define RTSP_FLAG_LISTEN 0x2
418 #define RTSP_FLAG_CUSTOM_IO 0x4
419 #define RTSP_FLAG_RTCP_TO_SOURCE 0x8
421 #define RTSP_FLAG_PREFER_TCP 0x10
487 const char *url,
const char *headers);
506 const char *method,
const char *url,
509 unsigned char **content_ptr,
510 const unsigned char *send_content,
511 int send_content_length);
519 const char *url,
const char *headers,
546 unsigned char **content_ptr,
547 int return_on_interleaved_data,
const char *method);
627 int lower_transport,
const char *real_challenge);
char auth[128]
plaintext authorization line (username:password)
int interleaved_min
interleave ids, if TCP transport; each TCP/RTSP data packet starts with a '$', stream length and stre...
void ff_rtsp_skip_packet(AVFormatContext *s)
Skip a RTP/TCP interleaved packet.
int rtp_port_min
Minimum and maximum local UDP ports.
Realmedia Data Transport.
RTSPLowerTransport
Network layer over which RTP/etc packet data will be transported.
int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
Open RTSP transport context.
char source[INET6_ADDRSTRLEN+1]
source IP address
char control_uri[1024]
some MS RTSP streams contain a URL in the SDP that we need to use for all subsequent RTSP requests...
struct pollfd * p
Polling array for udp.
RTP/JPEG specific private data.
enum AVDiscard * real_setup
current stream setup.
char * user_agent
User-Agent string.
enum AVDiscard * real_setup_cache
stream setup during the last frame read.
int mode_record
transport set to record data
initialized and sending/receiving data
char real_challenge[64]
the "RealChallenge1:" field from the server
int nb_include_source_addrs
Number of source-specific multicast include source IP addresses (from SDP content) ...
RTSPClientState
Client state, i.e.
HTTP Authentication state structure.
char session_id[512]
copy of RTSPMessageHeader->session_id, i.e.
int64_t seek_timestamp
the seek value requested when calling av_seek_frame().
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.
enum RTSPLowerTransport lower_transport
network layer transport protocol; e.g.
RTSPTransport
Packet profile of the data that we will be receiving.
int ff_rtsp_connect(AVFormatContext *s)
Connect to the RTSP server and set up the individual media streams.
Standards-compliant RTP-server.
int reordering_queue_size
Size of RTP packet reordering queue.
int get_parameter_supported
Whether the server supports the GET_PARAMETER method.
#define RTSP_MAX_TRANSPORTS
int ttl
time-to-live value (required for multicast); the amount of HOPs that packets will be allowed to make ...
int feedback
Enable sending RTCP feedback messages according to RFC 4585.
int initial_timeout
Timeout to wait for incoming connections.
int rtp_muxer_flags
Option flags for the chained RTP muxer.
int accept_dynamic_rate
Whether the server accepts the x-Dynamic-Rate header.
URLContext * rtsp_hd_out
Additional output handle, used when input and output are done separately, eg for HTTP tunneling...
Describe a single stream, as identified by a single m= line block in the SDP content.
Custom IO - not a public option for lower_transport_mask, but set in the SDP demuxer based on a flag...
RTSPServerType
Identify particular servers that require special handling, such as standards-incompliant "Transport:"...
int ff_rtsp_parse_streaming_commands(AVFormatContext *s)
Parse RTSP commands (OPTIONS, PAUSE and TEARDOWN) during streaming in listen mode.
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.
void ff_rtsp_parse_line(AVFormatContext *s, RTSPMessageHeader *reply, const char *buf, RTSPState *rt, const char *method)
int ff_sdp_parse(AVFormatContext *s, const char *content)
Parse an SDP description of streams by populating an RTSPState struct within the AVFormatContext; als...
struct RTSPSource ** exclude_source_addrs
Source-specific multicast exclude source IP addresses (from SDP content)
Private data for the RTSP demuxer.
int64_t last_cmd_time
timestamp of the last RTSP command that we sent to the RTSP server.
const AVOption ff_rtsp_options[]
int timeout
copy of RTSPMessageHeader->timeout, i.e.
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...
enum RTSPControlTransport control_transport
RTSP transport mode, such as plain or tunneled.
struct RTSPSource ** include_source_addrs
Source-specific multicast include source IP addresses (from SDP content)
struct RTSPStream ** rtsp_streams
streams in this session
int stream_index
corresponding stream index, if any.
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...
int seq
RTSP command sequence number.
uint8_t * recvbuf
Reusable buffer for receiving packets.
AVFormatContext * asf_ctx
The following are used for RTP/ASF streams.
int nb_rtsp_streams
number of items in the 'rtsp_streams' variable
void * cur_transport_priv
RTSPStream->transport_priv of the last stream that we read a packet from.
char last_subscription[1024]
the last value of the "SET_PARAMETER Subscribe:" RTSP command.
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...
RTSP over HTTP (tunneling)
int ff_rtsp_tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st)
Send buffered packets over TCP.
int sdp_port
The following are used only in SDP, not RTSP.
struct MpegTSContext * ts
The following are used for parsing raw mpegts in udp.
int sdp_payload_type
payload type
int nb_exclude_source_addrs
Number of source-specific multicast exclude source IP addresses (from SDP content) ...
enum RTSPLowerTransport lower_transport
the negotiated network layer transport protocol; e.g.
RTSPControlTransport
Transport mode for the RTSP data.
char addr[128]
Source-specific multicast include source IP address (from SDP content)
struct sockaddr_storage sdp_ip
IP address (from SDP content)
int media_type_mask
Mask of all requested media types.
uint32_t ssrc
SSRC for this stream, to allow identifying RTCP packets before the first RTP packet.
enum RTSPTransport transport
the negotiated data/packet transport protocol; e.g.
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...
int rtsp_flags
Various option flags for the RTSP muxer/demuxer.
Describe the class of an AVClass context structure.
PayloadContext * dynamic_protocol_context
private data associated with the dynamic protocol
char last_reply[2048]
The last reply of the server to a RTSP command.
enum RTSPTransport transport
data/packet transport protocol; e.g.
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.
enum RTSPServerType server_type
brand of server that we're talking to; e.g.
RTSPStatusCode
RTSP handling.
enum RTSPClientState state
indicator of whether we are currently receiving data from the server.
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...
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.
initialized, requesting a seek
int need_subscription
The following are used for Real stream selection.
RTPDynamicProtocolHandler * dynamic_handler
The following are used for dynamic protocols (rtpdec_*.c/rdt.c)
initialized, but not receiving data
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...
void ff_rtsp_close_streams(AVFormatContext *s)
Close and free all streams within the RTSP (de)muxer.
int stimeout
timeout of socket i/o operations.
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.
TCP; interleaved in RTSP.
HTTPAuthState auth_state
authentication state
char control_url[1024]
url for this stream (from SDP)
uint64_t packets
The number of returned packets.
int ff_rtsp_setup_input_streams(AVFormatContext *s, RTSPMessageHeader *reply)
Get the description of the stream and set up the RTSPStream child objects.
int sdp_ttl
IP Time-To-Live (from SDP content)
int lower_transport_mask
A mask with all requested transport methods.
struct sockaddr_storage destination
destination IP address
int interleaved_min
interleave IDs; copies of RTSPTransportField->interleaved_min/max for the selected transport...
This structure stores compressed data.
int server_port_min
UDP unicast server port range; the ports to which we should connect to receive unicast UDP RTP/RTCP d...
void ff_rtsp_close_connections(AVFormatContext *s)
Close all connection handles within the RTSP (de)muxer.
URLContext * rtp_handle
RTP stream handle (if UDP)
int port_min
UDP multicast port range; the ports to which we should connect to receive multicast UDP data...
void * transport_priv
RTP/RDT parse context if input, RTP AVFormatContext if output.
int client_port_min
UDP client ports; these should be the local ports of the UDP RTP (and RTCP) sockets over which we rec...
int initial_pause
Do not begin to play the stream immediately.