#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 ATTR_NAME_TYPE_INT 0 |
| #define ATTR_NAME_TYPE_STR 1 |
| #define MAX_TIMEOUTS READ_PACKET_TIMEOUT_S * 1000 / SELECT_TIMEOUT_MS |
| #define redir_isspace | ( | c | ) | memchr(SPACE_CHARS, c, 4) |
| #define SDP_MAX_SIZE 8192 |
| #define SPACE_CHARS " \t\r\n" |
| void ff_rtsp_close_streams | ( | AVFormatContext * | s | ) |
Close and free all streams within the RTSP (de)muxer.
| 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] |
| static void get_word_sep | ( | char * | buf, | |
| int | buf_size, | |||
| const char * | sep, | |||
| const char ** | pp | |||
| ) | [static] |
Definition at line 86 of file rtsp.c.
Referenced by ff_rtsp_next_attr_and_value(), rtsp_parse_range_npt(), sdp_parse_line(), and sdp_parse_rtpmap().
| static void get_word_until_chars | ( | char * | buf, | |
| int | buf_size, | |||
| const char * | sep, | |||
| const char ** | pp | |||
| ) | [static] |
| static int hex_to_data | ( | uint8_t * | data, | |
| const char * | p | |||
| ) | [static] |
| static int rtsp_open_transport_ctx | ( | AVFormatContext * | s, | |
| RTSPStream * | rtsp_st | |||
| ) | [static] |
| 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] |
| 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, | |
| void * | ctx, | |||
| 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 | ( | AVFormatContext * | s, | |
| 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] |
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) |
Initial value:
{
"sdp",
NULL_IF_CONFIG_SMALL("SDP"),
sizeof(RTSPState),
sdp_probe,
sdp_read_header,
rtsp_fetch_packet,
sdp_read_close,
}
1.5.8