18
18
* License along with FFmpeg; if not, write to the Free Software
19
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26
#define DEF(n, c, s) c = n,
27
26
#include "rtspcodes.h"
31
28
enum RTSPProtocol {
32
29
RTSP_PROTOCOL_RTP_UDP = 0,
33
30
RTSP_PROTOCOL_RTP_TCP = 1,
34
31
RTSP_PROTOCOL_RTP_UDP_MULTICAST = 2,
33
* This is not part of public API and shouldn't be used outside of ffmpeg.
35
RTSP_PROTOCOL_RTP_LAST
37
38
#define RTSP_DEFAULT_PORT 554
43
44
#define RTSP_RTP_PORT_MAX 10000
45
46
typedef struct RTSPTransportField {
46
int interleaved_min, interleaved_max; /* interleave ids, if TCP transport */
47
int port_min, port_max; /* RTP ports */
48
int client_port_min, client_port_max; /* RTP ports */
49
int server_port_min, server_port_max; /* RTP ports */
50
int ttl; /* ttl value */
51
uint32_t destination; /* destination IP address */
47
int interleaved_min, interleaved_max; /**< interleave ids, if TCP transport */
48
int port_min, port_max; /**< RTP ports */
49
int client_port_min, client_port_max; /**< RTP ports */
50
int server_port_min, server_port_max; /**< RTP ports */
51
int ttl; /**< ttl value */
52
uint32_t destination; /**< destination IP address */
52
53
enum RTSPProtocol protocol;
53
54
} RTSPTransportField;
55
56
typedef struct RTSPHeader {
56
57
int content_length;
57
enum RTSPStatusCode status_code; /* response code from server */
58
enum RTSPStatusCode status_code; /**< response code from server */
59
/* in AV_TIME_BASE unit, AV_NOPTS_VALUE if not used */
60
/** in AV_TIME_BASE unit, AV_NOPTS_VALUE if not used */
60
61
int64_t range_start, range_end;
61
62
RTSPTransportField transports[RTSP_MAX_TRANSPORTS];
62
int seq; /* sequence number */
63
int seq; /**< sequence number */
63
64
char session_id[512];
66
/* the callback can be used to extend the connection setup/teardown step */
67
/** the callback can be used to extend the connection setup/teardown step */
67
68
enum RTSPCallbackAction {
68
69
RTSP_ACTION_SERVER_SETUP,
69
70
RTSP_ACTION_SERVER_TEARDOWN,
81
82
char *buf, int buf_size,
84
void rtsp_set_callback(FFRTSPCallback *rtsp_cb);
86
85
int rtsp_init(void);
87
86
void rtsp_parse_line(RTSPHeader *reply, const char *buf);
88
#if LIBAVFORMAT_VERSION_INT < (53 << 16)
89
89
extern int rtsp_default_protocols;
90
91
extern int rtsp_rtp_port_min;
91
92
extern int rtsp_rtp_port_max;
92
extern FFRTSPCallback *ff_rtsp_callback;
93
extern AVInputFormat rtsp_demuxer;
95
94
int rtsp_pause(AVFormatContext *s);
96
95
int rtsp_resume(AVFormatContext *s);
97
#endif /* FFMPEG_RTSP_H */