libavformat/rtsp.c File Reference

#include "avformat.h"
#include <sys/time.h>
#include <unistd.h>
#include "network.h"
#include "avstring.h"
#include "rtsp.h"
#include "rtp_internal.h"

Go to the source code of this file.

Data Structures

struct  RTSPState
struct  RTSPStream
struct  attrname_map
struct  SDPParseState

Defines

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

Typedefs

typedef struct attrname_map attrname_map_t

Enumerations

enum  RTSPClientState { RTSP_STATE_IDLE, RTSP_STATE_PLAYING, RTSP_STATE_PAUSED }

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 (RTSPHeader *reply, const char *p)
void rtsp_parse_line (RTSPHeader *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, RTSPHeader *reply, unsigned char **content_ptr)
static void rtsp_close_streams (RTSPState *rt)
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_PROTOCOL_RTP_UDP)
static attrname_map_t attr_names []


Define Documentation

#define ATTR_NAME_TYPE_INT   0

Definition at line 271 of file rtsp.c.

Referenced by sdp_parse_fmtp().

#define ATTR_NAME_TYPE_STR   1

Definition at line 272 of file rtsp.c.

Referenced by sdp_parse_fmtp().

#define SDP_MAX_SIZE   8192

Definition at line 1348 of file rtsp.c.

Referenced by sdp_read_header().


Typedef Documentation

typedef struct attrname_map attrname_map_t


Enumeration Type Documentation

Enumerator:
RTSP_STATE_IDLE 
RTSP_STATE_PLAYING 
RTSP_STATE_PAUSED 

Definition at line 34 of file rtsp.c.


Function Documentation

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

Definition at line 126 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 214 of file rtsp.c.

Referenced by sdp_parse_fmtp_config().

static int redir_isspace ( int  c  )  [static]

Definition at line 91 of file rtsp.c.

Referenced by get_word(), and skip_spaces().

static void rtsp_close_streams ( RTSPState rt  )  [static]

Definition at line 829 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 287 of file rtsp.c.

Referenced by parse_h264_sdp_line(), and sdp_parse_fmtp().

void rtsp_parse_line ( RTSPHeader reply,
const char *  buf 
)

Definition at line 686 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 566 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 335 of file rtsp.c.

Referenced by rtsp_parse_line(), and sdp_parse_line().

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

Definition at line 587 of file rtsp.c.

Referenced by rtsp_parse_line().

static int rtsp_probe ( AVProbeData p  )  [static]

Definition at line 84 of file rtsp.c.

static int rtsp_read_close ( AVFormatContext s  )  [static]

Definition at line 1292 of file rtsp.c.

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

Definition at line 849 of file rtsp.c.

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

Definition at line 1172 of file rtsp.c.

Referenced by sdp_read_packet().

static int rtsp_read_pause ( AVFormatContext s  )  [static]

Definition at line 1248 of file rtsp.c.

static int rtsp_read_play ( AVFormatContext s  )  [static]

Definition at line 1219 of file rtsp.c.

Referenced by rtsp_read_header(), and rtsp_read_seek().

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

Definition at line 1271 of file rtsp.c.

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

Definition at line 745 of file rtsp.c.

Referenced by rtsp_read_close(), rtsp_read_header(), rtsp_read_pause(), and rtsp_read_play().

static void rtsp_skip_packet ( AVFormatContext s  )  [static]

Definition at line 720 of file rtsp.c.

Referenced by rtsp_send_cmd().

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

Definition at line 530 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 304 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 242 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 363 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 146 of file rtsp.c.

Referenced by sdp_parse_line().

static int sdp_probe ( AVProbeData p1  )  [static]

Definition at line 1330 of file rtsp.c.

static int sdp_read_close ( AVFormatContext s  )  [static]

Definition at line 1414 of file rtsp.c.

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

Definition at line 1350 of file rtsp.c.

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

Definition at line 1408 of file rtsp.c.

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

Definition at line 96 of file rtsp.c.

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

Definition at line 1082 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 1131 of file rtsp.c.

Referenced by rtsp_read_packet().

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

Definition at line 705 of file rtsp.c.

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


Variable Documentation

Initial value:

{
    {"SizeLength",       ATTR_NAME_TYPE_INT, offsetof(rtp_payload_data_t, sizelength)},
    {"IndexLength",      ATTR_NAME_TYPE_INT, offsetof(rtp_payload_data_t, indexlength)},
    {"IndexDeltaLength", ATTR_NAME_TYPE_INT, offsetof(rtp_payload_data_t, indexdeltalength)},
    {"profile-level-id", ATTR_NAME_TYPE_INT, offsetof(rtp_payload_data_t, profile_level_id)},
    {"StreamType",       ATTR_NAME_TYPE_INT, offsetof(rtp_payload_data_t, streamtype)},
    {"mode",             ATTR_NAME_TYPE_STR, offsetof(rtp_payload_data_t, mode)},
    {NULL, -1, -1},
}

Definition at line 273 of file rtsp.c.

int rtsp_default_protocols = (1 << RTSP_PROTOCOL_RTP_UDP)

Definition at line 81 of file rtsp.c.

Referenced by rtsp_read_header().


Generated on Fri Oct 3 22:47:00 2008 for ffmpeg by  doxygen 1.5.6