libavformat/rtsp.h File Reference

#include <stdint.h>
#include "avformat.h"
#include "rtspcodes.h"
#include "rtpdec.h"
#include "network.h"
#include "httpauth.h"

Go to the source code of this file.

Data Structures

struct  RTSPTransportField
 This describes a single item in the "Transport:" line of one stream as negotiated by the SETUP RTSP command. More...
struct  RTSPMessageHeader
 This describes the server response to each RTSP command. More...
struct  RTSPState
 Private data for the RTSP demuxer. More...
struct  RTSPStream
 Describes a single stream, as identified by a single m= line block in the SDP content. More...

Defines

#define RTSP_DEFAULT_PORT   554
#define RTSP_MAX_TRANSPORTS   8
#define RTSP_TCP_MAX_PACKET_SIZE   1472
#define RTSP_DEFAULT_NB_AUDIO_CHANNELS   2
#define RTSP_DEFAULT_AUDIO_SAMPLERATE   44100
#define RTSP_RTP_PORT_MIN   5000
#define RTSP_RTP_PORT_MAX   10000

Enumerations

enum  RTSPLowerTransport { RTSP_LOWER_TRANSPORT_UDP = 0, RTSP_LOWER_TRANSPORT_TCP = 1, RTSP_LOWER_TRANSPORT_UDP_MULTICAST = 2, RTSP_LOWER_TRANSPORT_NB }
 Network layer over which RTP/etc packet data will be transported. More...
enum  RTSPTransport { RTSP_TRANSPORT_RTP, RTSP_TRANSPORT_RDT, RTSP_TRANSPORT_NB }
 Packet profile of the data that we will be receiving. More...
enum  RTSPClientState { RTSP_STATE_IDLE, RTSP_STATE_STREAMING, RTSP_STATE_PAUSED, RTSP_STATE_SEEKING }
 Client state, i.e. More...
enum  RTSPServerType { RTSP_SERVER_RTP, RTSP_SERVER_REAL, RTSP_SERVER_WMS, RTSP_SERVER_NB }
 Identifies particular servers that require special handling, such as standards-incompliant "Transport:" lines in the SETUP request. More...

Functions

void ff_rtsp_parse_line (RTSPMessageHeader *reply, const char *buf, HTTPAuthState *auth_state)
void ff_rtsp_send_cmd_with_content_async (AVFormatContext *s, const char *method, const char *url, const char *headers, const unsigned char *send_content, int send_content_length)
 Send a command to the RTSP server without waiting for the reply.
void 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.
void 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.
void 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.
int ff_rtsp_read_reply (AVFormatContext *s, RTSPMessageHeader *reply, unsigned char **content_ptr, int return_on_interleaved_data)
 Read a RTSP message from the server, or prepare to read data packets if we're reading data interleaved over the TCP/RTSP connection as well.
void ff_rtsp_skip_packet (AVFormatContext *s)
 Skip a RTP/TCP interleaved packet.
int ff_rtsp_connect (AVFormatContext *s)
 Connect to the RTSP server and set up the individual media streams.
void ff_rtsp_close_streams (AVFormatContext *s)
 Close and free all streams within the RTSP (de)muxer.

Variables

int rtsp_default_protocols
int rtsp_rtp_port_min
int rtsp_rtp_port_max


Define Documentation

#define RTSP_DEFAULT_AUDIO_SAMPLERATE   44100

Definition at line 56 of file rtsp.h.

Referenced by sdp_parse_rtpmap().

#define RTSP_DEFAULT_NB_AUDIO_CHANNELS   2

Definition at line 55 of file rtsp.h.

Referenced by sdp_parse_rtpmap().

#define RTSP_DEFAULT_PORT   554

Definition at line 52 of file rtsp.h.

#define RTSP_MAX_TRANSPORTS   8

Definition at line 53 of file rtsp.h.

#define RTSP_RTP_PORT_MAX   10000

Definition at line 58 of file rtsp.h.

#define RTSP_RTP_PORT_MIN   5000

Definition at line 57 of file rtsp.h.

#define RTSP_TCP_MAX_PACKET_SIZE   1472

Definition at line 54 of file rtsp.h.

Referenced by http_prepare_data(), rtp_new_av_stream(), rtsp_rtp_mux_open(), and tcp_write_packet().


Enumeration Type Documentation

Client state, i.e.

whether we are currently receiving data (PLAYING) or setup-but-not-receiving (PAUSED). State can be changed in applications by calling av_read_play/pause().

Enumerator:
RTSP_STATE_IDLE  not initialized
RTSP_STATE_STREAMING  initialized and sending/receiving data
RTSP_STATE_PAUSED  initialized, but not receiving data
RTSP_STATE_SEEKING  initialized, requesting a seek

Definition at line 160 of file rtsp.h.

Network layer over which RTP/etc packet data will be transported.

Enumerator:
RTSP_LOWER_TRANSPORT_UDP  UDP/unicast.
RTSP_LOWER_TRANSPORT_TCP  TCP; interleaved in RTSP.
RTSP_LOWER_TRANSPORT_UDP_MULTICAST  UDP/multicast.
RTSP_LOWER_TRANSPORT_NB 

Definition at line 34 of file rtsp.h.

Identifies particular servers that require special handling, such as standards-incompliant "Transport:" lines in the SETUP request.

Enumerator:
RTSP_SERVER_RTP  Standards-compliant RTP-server.
RTSP_SERVER_REAL  Realmedia-style server.
RTSP_SERVER_WMS  Windows Media server.
RTSP_SERVER_NB 

Definition at line 171 of file rtsp.h.

Packet profile of the data that we will be receiving.

Real servers commonly send RDT (although they can sometimes send RTP as well), whereas most others will send RTP.

Enumerator:
RTSP_TRANSPORT_RTP  Standards-compliant RTP.
RTSP_TRANSPORT_RDT  Realmedia Data Transport.
RTSP_TRANSPORT_NB 

Definition at line 46 of file rtsp.h.


Function Documentation

void ff_rtsp_close_streams ( AVFormatContext s  ) 

Close and free all streams within the RTSP (de)muxer.

Parameters:
s RTSP (de)muxer context

Definition at line 576 of file rtsp.c.

Referenced by rtsp_write_close(), rtsp_write_header(), sdp_read_close(), and sdp_read_header().

int ff_rtsp_connect ( AVFormatContext s  ) 

Connect to the RTSP server and set up the individual media streams.

This can be used for both muxers and demuxers.

Parameters:
s RTSP (de)muxer context
Returns:
0 on success, < 0 on error. Cleans up all allocations done within the function on error.

Referenced by rtsp_write_header().

void ff_rtsp_parse_line ( RTSPMessageHeader reply,
const char *  buf,
HTTPAuthState auth_state 
)

Referenced by rtsp_parse_request().

int ff_rtsp_read_reply ( AVFormatContext s,
RTSPMessageHeader reply,
unsigned char **  content_ptr,
int  return_on_interleaved_data 
)

Read a RTSP message from the server, or prepare to read data packets if we're reading data interleaved over the TCP/RTSP connection as well.

Parameters:
s RTSP (de)muxer context
reply pointer where the RTSP message header will be stored
content_ptr pointer where the RTSP message body, if any, will be stored (length is in reply)
return_on_interleaved_data whether the function may return if we encounter a data marker ('$'), which precedes data packets over interleaved TCP/RTSP connections. If this is set, this function will return 1 after encountering a '$'. If it is not set, the function will skip any data packets (if they are encountered), until a reply has been fully parsed. If no more data is available without parsing a reply, it will return an error.
Returns:
1 if a data packets is ready to be received, -1 on error, and 0 on success.

Referenced by rtsp_write_packet().

void 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.

See also:
rtsp_send_cmd_with_content

Referenced by rtsp_write_record().

void 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.

See also:
rtsp_send_cmd_with_content_async

Referenced by rtsp_write_close().

void 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.

Parameters:
s RTSP (de)muxer context
method the method for the request
url the target url for the request
headers extra header lines to include in the request
reply pointer where the RTSP message header will be stored
content_ptr pointer where the RTSP message body, if any, will be stored (length is in reply)
send_content if non-null, the data to send as request body content
send_content_length the length of the send_content data, or 0 if send_content is null

void ff_rtsp_send_cmd_with_content_async ( AVFormatContext s,
const char *  method,
const char *  url,
const char *  headers,
const unsigned char *  send_content,
int  send_content_length 
)

Send a command to the RTSP server without waiting for the reply.

Parameters:
s RTSP (de)muxer context
method the method for the request
url the target url for the request
headers extra header lines to include in the request
send_content if non-null, the data to send as request body content
send_content_length the length of the send_content data, or 0 if send_content is null

void ff_rtsp_skip_packet ( AVFormatContext s  ) 

Skip a RTP/TCP interleaved packet.

Referenced by rtsp_write_packet().


Variable Documentation

Definition at line 45 of file rtsp.c.


Generated on Fri Oct 26 02:36:55 2012 for FFmpeg by  doxygen 1.5.8