libavformat/rtsp.c File Reference

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

Go to the source code of this file.

Data Structures

struct  AttrNameMap
struct  SDPParseState

Defines

#define SELECT_TIMEOUT_MS   100
#define READ_PACKET_TIMEOUT_S   10
#define MAX_TIMEOUTS   READ_PACKET_TIMEOUT_S * 1000 / SELECT_TIMEOUT_MS
#define SPACE_CHARS   " \t\r\n"
#define redir_isspace(c)   memchr(SPACE_CHARS, c, 4)
#define ATTR_NAME_TYPE_INT   0
#define ATTR_NAME_TYPE_STR   1
#define SDP_MAX_SIZE   8192

Functions

static void skip_spaces (const char **pp)
static void get_word_until_chars (char *buf, int buf_size, const char *sep, 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 (AVFormatContext *s, 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, void *ctx, char *attr, char *value)
int ff_rtsp_next_attr_and_value (const char **p, char *attr, int attr_size, char *value, int value_size)
 from rtsp.c, but used by rtp dynamic protocol handlers.
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 p 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)
void ff_rtsp_close_streams (AVFormatContext *s)
 Close and free all streams within the RTSP (de)muxer.
static void * rtsp_rtp_mux_open (AVFormatContext *s, AVStream *st, URLContext *handle)
static int rtsp_open_transport_ctx (AVFormatContext *s, RTSPStream *rtsp_st)
static int sdp_probe (AVProbeData *p1)
static int sdp_read_header (AVFormatContext *s, AVFormatParameters *ap)
static int sdp_read_close (AVFormatContext *s)

Variables

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


Define Documentation

#define ATTR_NAME_TYPE_INT   0

Definition at line 232 of file rtsp.c.

Referenced by sdp_parse_fmtp().

#define ATTR_NAME_TYPE_STR   1

Definition at line 233 of file rtsp.c.

Referenced by sdp_parse_fmtp().

#define MAX_TIMEOUTS   READ_PACKET_TIMEOUT_S * 1000 / SELECT_TIMEOUT_MS

Definition at line 52 of file rtsp.c.

#define READ_PACKET_TIMEOUT_S   10

Definition at line 51 of file rtsp.c.

#define redir_isspace (  )     memchr(SPACE_CHARS, c, 4)

Definition at line 57 of file rtsp.c.

Referenced by skip_spaces().

#define SDP_MAX_SIZE   8192

Definition at line 2028 of file rtsp.c.

Referenced by sdp_read_header().

#define SELECT_TIMEOUT_MS   100

Definition at line 50 of file rtsp.c.

#define SPACE_CHARS   " \t\r\n"

Definition at line 54 of file rtsp.c.

Referenced by get_word().


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_next_attr_and_value ( const char **  p,
char *  attr,
int  attr_size,
char *  value,
int  value_size 
)

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

Definition at line 254 of file rtsp.c.

Referenced by amr_parse_sdp_line(), parse_h264_sdp_line(), sdp_parse_fmtp(), and xiph_parse_sdp_line().

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

Definition at line 93 of file rtsp.c.

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

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

Definition at line 67 of file rtsp.c.

Referenced by get_word(), and get_word_sep().

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

Definition at line 173 of file rtsp.c.

Referenced by sdp_parse_fmtp_config().

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

Definition at line 678 of file rtsp.c.

Referenced by sdp_read_header().

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

Parse a string p 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 307 of file rtsp.c.

Referenced by sdp_parse_line().

static void* rtsp_rtp_mux_open ( AVFormatContext s,
AVStream st,
URLContext handle 
) [static]

Definition at line 619 of file rtsp.c.

Referenced by rtsp_open_transport_ctx().

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

Definition at line 532 of file rtsp.c.

Referenced by 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,
void *  ctx,
char *  attr,
char *  value 
) [static]

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

Referenced by sdp_parse().

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

Definition at line 99 of file rtsp.c.

Referenced by sdp_parse_line().

static int sdp_probe ( AVProbeData p1  )  [static]

Definition at line 2009 of file rtsp.c.

static int sdp_read_close ( AVFormatContext s  )  [static]

Definition at line 2076 of file rtsp.c.

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

Definition at line 2030 of file rtsp.c.

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

Definition at line 58 of file rtsp.c.


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 234 of file rtsp.c.

int rtsp_default_protocols = (1 << RTSP_LOWER_TRANSPORT_UDP)

Definition at line 45 of file rtsp.c.

Initial value:

 {
    "sdp",
    NULL_IF_CONFIG_SMALL("SDP"),
    sizeof(RTSPState),
    sdp_probe,
    sdp_read_header,
    rtsp_fetch_packet,
    sdp_read_close,
}

Definition at line 2083 of file rtsp.c.


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