#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 ATTR_NAME_TYPE_INT 0 |
#define ATTR_NAME_TYPE_STR 1 |
#define SDP_MAX_SIZE 8192 |
static void get_word | ( | char * | buf, | |
int | buf_size, | |||
const char ** | pp | |||
) | [static] |
static void get_word_sep | ( | char * | buf, | |
int | buf_size, | |||
const char * | sep, | |||
const char ** | pp | |||
) | [static] |
Definition at line 73 of file rtsp.c.
Referenced by rtsp_next_attr_and_value(), rtsp_parse_line(), rtsp_parse_range_npt(), rtsp_parse_transport(), sdp_parse_line(), and sdp_parse_rtpmap().
static int hex_to_data | ( | uint8_t * | data, | |
const char * | p | |||
) | [static] |
static int make_setup_request | ( | AVFormatContext * | s, | |
const char * | host, | |||
int | port, | |||
int | lower_transport, | |||
const char * | real_challenge | |||
) | [static] |
Definition at line 885 of file rtsp.c.
Referenced by rtsp_read_header().
static int redir_isspace | ( | int | c | ) | [static] |
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] |
void rtsp_parse_line | ( | RTSPMessageHeader * | reply, | |
const char * | buf | |||
) |
static void rtsp_parse_range | ( | int * | min_ptr, | |
int * | max_ptr, | |||
const char ** | pp | |||
) | [static] |
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] |
static int rtsp_probe | ( | AVProbeData * | p | ) | [static] |
static int rtsp_read_close | ( | AVFormatContext * | s | ) | [static] |
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.
CompanyID | is a 16-byte ID in base64 | |
ClientChallenge | is a 16-byte ID in hex |
static int rtsp_read_packet | ( | AVFormatContext * | s, | |
AVPacket * | pkt | |||
) | [static] |
static int rtsp_read_pause | ( | AVFormatContext * | s | ) | [static] |
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] |
static void rtsp_send_cmd | ( | AVFormatContext * | s, | |
const char * | cmd, | |||
RTSPMessageHeader * | reply, | |||
unsigned char ** | content_ptr | |||
) | [static] |
Definition at line 740 of file rtsp.c.
Referenced by make_setup_request(), rtsp_read_close(), rtsp_read_header(), rtsp_read_packet(), rtsp_read_pause(), and rtsp_read_play().
static void rtsp_skip_packet | ( | AVFormatContext * | s | ) | [static] |
static int sdp_parse | ( | AVFormatContext * | s, | |
const char * | content | |||
) | [static] |
static void sdp_parse_fmtp | ( | AVStream * | st, | |
const char * | p | |||
) | [static] |
static void sdp_parse_fmtp_config | ( | AVCodecContext * | codec, | |
char * | attr, | |||
char * | value | |||
) | [static] |
static void sdp_parse_line | ( | AVFormatContext * | s, | |
SDPParseState * | s1, | |||
int | letter, | |||
const char * | buf | |||
) | [static] |
static int sdp_parse_rtpmap | ( | AVCodecContext * | codec, | |
RTSPStream * | rtsp_st, | |||
int | payload_type, | |||
const char * | p | |||
) | [static] |
static int sdp_probe | ( | AVProbeData * | p1 | ) | [static] |
static int sdp_read_close | ( | AVFormatContext * | s | ) | [static] |
static int sdp_read_header | ( | AVFormatContext * | s, | |
AVFormatParameters * | ap | |||
) | [static] |
static int sdp_read_packet | ( | AVFormatContext * | s, | |
AVPacket * | pkt | |||
) | [static] |
static int tcp_read_packet | ( | AVFormatContext * | s, | |
RTSPStream ** | prtsp_st, | |||
uint8_t * | buf, | |||
int | buf_size | |||
) | [static] |
static int udp_read_packet | ( | AVFormatContext * | s, | |
RTSPStream ** | prtsp_st, | |||
uint8_t * | buf, | |||
int | buf_size | |||
) | [static] |
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().
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}, }
int rtsp_default_protocols = (1 << RTSP_LOWER_TRANSPORT_UDP) |