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 148 char session_id[512];
155 char real_challenge[64];
187 char content_type[64];
245 char session_id[512];
270 char real_challenge[64];
279 char last_reply[2048];
301 char last_subscription[1024];
317 char control_uri[1024];
410 char default_lang[4];
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 435 void *transport_priv;
444 char control_url[1024];
450 int nb_include_source_addrs;
452 int nb_exclude_source_addrs;
455 int sdp_payload_type;
473 char crypto_suite[40];
474 char crypto_params[100];
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);
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
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
RTSPClientState
Client state, i.e.
HTTP Authentication state structure.
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 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...
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...
struct RTSPStream ** rtsp_streams
streams in this session
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.
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.
struct MpegTSContext * ts
The following are used for parsing raw mpegts in udp.
RTSPControlTransport
Transport mode for the RTSP data.
char addr[128]
Source-specific multicast include source IP address (from SDP content)
int media_type_mask
Mask of all requested media types.
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.
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.
RTSPStatusCode
RTSP handling.
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.
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
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 lower_transport_mask
A mask with all requested transport methods.
struct sockaddr_storage destination
destination IP address
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.
int port_min
UDP multicast port range; the ports to which we should connect to receive multicast UDP data...
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.