libavformat/rtsp.c File Reference

#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include <sys/time.h>
#include <strings.h>
#include "network.h"
#include "rtsp.h"
#include "rtpdec.h"
#include "rdt.h"

Go to the source code of this file.

Data Structures

struct  AttrNameMap
struct  SDPParseState

Defines

#define _SVID_SOURCE
#define ATTR_NAME_TYPE_INT   0
#define ATTR_NAME_TYPE_STR   1
#define SDP_MAX_SIZE   8192

Functions

static int rtsp_read_play (AVFormatContext *s)
static int rtsp_probe (AVProbeData *p)
static int redir_isspace (int c)
static void skip_spaces (const char **pp)
static void get_word_sep (char *buf, int buf_size, const char *sep, const char **pp)
static void get_word (char *buf, int buf_size, const char **pp)
static int sdp_parse_rtpmap (AVCodecContext *codec, RTSPStream *rtsp_st, int payload_type, const char *p)
static int hex_to_data (uint8_t *data, const char *p)
static void sdp_parse_fmtp_config (AVCodecContext *codec, char *attr, char *value)
int rtsp_next_attr_and_value (const char **p, char *attr, int attr_size, char *value, int value_size)
 parse the attribute line from the fmtp a line of an sdp resonse.
static void sdp_parse_fmtp (AVStream *st, const char *p)
static void rtsp_parse_range_npt (const char *p, int64_t *start, int64_t *end)
 Parse a string in the form of Range:npt=xx-xx, and determine the start and end time.
static void sdp_parse_line (AVFormatContext *s, SDPParseState *s1, int letter, const char *buf)
static int sdp_parse (AVFormatContext *s, const char *content)
static void rtsp_parse_range (int *min_ptr, int *max_ptr, const char **pp)
static void rtsp_parse_transport (RTSPMessageHeader *reply, const char *p)
void rtsp_parse_line (RTSPMessageHeader *reply, const char *buf)
static int url_readbuf (URLContext *h, unsigned char *buf, int size)
static void rtsp_skip_packet (AVFormatContext *s)
static void rtsp_send_cmd (AVFormatContext *s, const char *cmd, RTSPMessageHeader *reply, unsigned char **content_ptr)
static void rtsp_close_streams (RTSPState *rt)
static int rtsp_open_transport_ctx (AVFormatContext *s, RTSPStream *rtsp_st)
static int make_setup_request (AVFormatContext *s, const char *host, int port, int lower_transport, const char *real_challenge)
static int rtsp_read_header (AVFormatContext *s, AVFormatParameters *ap)
static int tcp_read_packet (AVFormatContext *s, RTSPStream **prtsp_st, uint8_t *buf, int buf_size)
static int udp_read_packet (AVFormatContext *s, RTSPStream **prtsp_st, uint8_t *buf, int buf_size)
static int rtsp_read_packet (AVFormatContext *s, AVPacket *pkt)
static int rtsp_read_pause (AVFormatContext *s)
static int rtsp_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
static int rtsp_read_close (AVFormatContext *s)
static int sdp_probe (AVProbeData *p1)
static int sdp_read_header (AVFormatContext *s, AVFormatParameters *ap)
static int sdp_read_packet (AVFormatContext *s, AVPacket *pkt)
static int sdp_read_close (AVFormatContext *s)

Variables

int rtsp_default_protocols = (1 << RTSP_LOWER_TRANSPORT_UDP)
static const AttrNameMap attr_names []


Define Documentation

#define _SVID_SOURCE

Definition at line 23 of file rtsp.c.

#define ATTR_NAME_TYPE_INT   0

Definition at line 238 of file rtsp.c.

Referenced by sdp_parse_fmtp().

#define ATTR_NAME_TYPE_STR   1

Definition at line 239 of file rtsp.c.

Referenced by sdp_parse_fmtp().

#define SDP_MAX_SIZE   8192

Definition at line 1551 of file rtsp.c.

Referenced by sdp_read_header().


Function Documentation

static void get_word ( char *  buf,
int  buf_size,
const char **  pp 
) [static]

Definition at line 94 of file rtsp.c.

static void get_word_sep ( char *  buf,
int  buf_size,
const char *  sep,
const char **  pp 
) [static]

static int hex_to_data ( uint8_t *  data,
const char *  p 
) [static]

Definition at line 182 of file rtsp.c.

Referenced by sdp_parse_fmtp_config().

static int make_setup_request ( AVFormatContext s,
const char *  host,
int  port,
int  lower_transport,
const char *  real_challenge 
) [static]

Returns:
0 on success, <0 on error, 1 if protocol is unavailable.

Definition at line 885 of file rtsp.c.

Referenced by rtsp_read_header().

static int redir_isspace ( int  c  )  [static]

Definition at line 59 of file rtsp.c.

Referenced by get_word(), and skip_spaces().

static void rtsp_close_streams ( RTSPState rt  )  [static]

Definition at line 824 of file rtsp.c.

Referenced by rtsp_read_close(), rtsp_read_header(), sdp_read_close(), and sdp_read_header().

int rtsp_next_attr_and_value ( const char **  p,
char *  attr,
int  attr_size,
char *  value,
int  value_size 
)

parse the attribute line from the fmtp a line of an sdp resonse.

from rtsp.c, but used by rtp dynamic protocol handlers.

This is broken out as a function because it is used in rtp_h264.c, which is forthcoming.

Definition at line 254 of file rtsp.c.

Referenced by parse_h264_sdp_line(), and sdp_parse_fmtp().

static int rtsp_open_transport_ctx ( AVFormatContext s,
RTSPStream rtsp_st 
) [static]

Definition at line 848 of file rtsp.c.

Referenced by make_setup_request(), and sdp_read_header().

void rtsp_parse_line ( RTSPMessageHeader reply,
const char *  buf 
)

Definition at line 675 of file rtsp.c.

Referenced by rtsp_parse_request(), and rtsp_send_cmd().

static void rtsp_parse_range ( int *  min_ptr,
int *  max_ptr,
const char **  pp 
) [static]

Definition at line 552 of file rtsp.c.

Referenced by rtsp_parse_transport().

static void rtsp_parse_range_npt ( const char *  p,
int64_t *  start,
int64_t *  end 
) [static]

Parse a string in the form of Range:npt=xx-xx, and determine the start and end time.

Used for seeking in the rtp stream.

Definition at line 302 of file rtsp.c.

Referenced by rtsp_parse_line(), and sdp_parse_line().

static void rtsp_parse_transport ( RTSPMessageHeader reply,
const char *  p 
) [static]

Definition at line 573 of file rtsp.c.

Referenced by rtsp_parse_line().

static int rtsp_probe ( AVProbeData p  )  [static]

Definition at line 52 of file rtsp.c.

static int rtsp_read_close ( AVFormatContext s  )  [static]

Definition at line 1495 of file rtsp.c.

static int rtsp_read_header ( AVFormatContext s,
AVFormatParameters ap 
) [static]

The following entries are required for proper streaming from a Realmedia server. They are interdependent in some way although we currently don't quite understand how. Values were copied from mplayer SVN r23589.

Parameters:
CompanyID is a 16-byte ID in base64
ClientChallenge is a 16-byte ID in hex
The Require: attribute is needed for proper streaming from Realmedia servers.

Definition at line 1060 of file rtsp.c.

static int rtsp_read_packet ( AVFormatContext s,
AVPacket pkt 
) [static]

Definition at line 1306 of file rtsp.c.

Referenced by sdp_read_packet().

static int rtsp_read_pause ( AVFormatContext s  )  [static]

Definition at line 1451 of file rtsp.c.

static int rtsp_read_play ( AVFormatContext s  )  [static]

Definition at line 1421 of file rtsp.c.

Referenced by rtsp_read_header(), rtsp_read_packet(), and rtsp_read_seek().

static int rtsp_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  timestamp,
int  flags 
) [static]

Definition at line 1474 of file rtsp.c.

static void rtsp_send_cmd ( AVFormatContext s,
const char *  cmd,
RTSPMessageHeader reply,
unsigned char **  content_ptr 
) [static]

static void rtsp_skip_packet ( AVFormatContext s  )  [static]

Definition at line 715 of file rtsp.c.

Referenced by rtsp_send_cmd().

static int sdp_parse ( AVFormatContext s,
const char *  content 
) [static]

Definition at line 511 of file rtsp.c.

Referenced by rtsp_read_header(), and sdp_read_header().

static void sdp_parse_fmtp ( AVStream st,
const char *  p 
) [static]

Definition at line 271 of file rtsp.c.

Referenced by sdp_parse_line().

static void sdp_parse_fmtp_config ( AVCodecContext codec,
char *  attr,
char *  value 
) [static]

Definition at line 210 of file rtsp.c.

Referenced by sdp_parse_fmtp().

static void sdp_parse_line ( AVFormatContext s,
SDPParseState s1,
int  letter,
const char *  buf 
) [static]

Definition at line 331 of file rtsp.c.

Referenced by sdp_parse().

static int sdp_parse_rtpmap ( AVCodecContext codec,
RTSPStream rtsp_st,
int  payload_type,
const char *  p 
) [static]

Definition at line 114 of file rtsp.c.

Referenced by sdp_parse_line().

static int sdp_probe ( AVProbeData p1  )  [static]

Definition at line 1533 of file rtsp.c.

static int sdp_read_close ( AVFormatContext s  )  [static]

Definition at line 1603 of file rtsp.c.

static int sdp_read_header ( AVFormatContext s,
AVFormatParameters ap 
) [static]

Definition at line 1553 of file rtsp.c.

static int sdp_read_packet ( AVFormatContext s,
AVPacket pkt 
) [static]

Definition at line 1597 of file rtsp.c.

static void skip_spaces ( const char **  pp  )  [static]

Definition at line 64 of file rtsp.c.

static int tcp_read_packet ( AVFormatContext s,
RTSPStream **  prtsp_st,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 1213 of file rtsp.c.

Referenced by rtsp_read_packet().

static int udp_read_packet ( AVFormatContext s,
RTSPStream **  prtsp_st,
uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 1265 of file rtsp.c.

Referenced by rtsp_read_packet().

static int url_readbuf ( URLContext h,
unsigned char *  buf,
int  size 
) [static]

Definition at line 700 of file rtsp.c.

Referenced by rtsp_send_cmd(), rtsp_skip_packet(), and tcp_read_packet().


Variable Documentation

const AttrNameMap attr_names[] [static]

Initial value:

{
    {"SizeLength",       ATTR_NAME_TYPE_INT, 0x42},
    {"IndexLength",      ATTR_NAME_TYPE_INT, 0x42},
    {"IndexDeltaLength", ATTR_NAME_TYPE_INT, 0x42},
    {"profile-level-id", ATTR_NAME_TYPE_INT, 0x42},
    {"StreamType",       ATTR_NAME_TYPE_INT, 0x42},
    {"mode",             ATTR_NAME_TYPE_STR, 0x42},
    {NULL, -1, -1},
}

Definition at line 240 of file rtsp.c.

int rtsp_default_protocols = (1 << RTSP_LOWER_TRANSPORT_UDP)

Definition at line 49 of file rtsp.c.


Generated on Fri Oct 26 02:35:46 2012 for FFmpeg by  doxygen 1.5.8