comparison rtsp.h @ 4168:0ebf63d12ea4 libavformat

Export RTSPState and RTSPStream from rtsp.c into rtsp.h. This allows future access to these structures in functions that will be located in rtp_asf.c. See "[PATCH] RTSP-MS 2/15: export RTSPState and RTSPStream" mailinglist thread.
author rbultje
date Wed, 07 Jan 2009 14:53:04 +0000
parents 13e9b0d3a314
children 619845a9bab3
comparison
equal deleted inserted replaced
4167:81f64d590675 4168:0ebf63d12ea4
22 #define FFMPEG_RTSP_H 22 #define FFMPEG_RTSP_H
23 23
24 #include <stdint.h> 24 #include <stdint.h>
25 #include "avformat.h" 25 #include "avformat.h"
26 #include "rtspcodes.h" 26 #include "rtspcodes.h"
27 #include "rtp.h"
28 #include "network.h"
27 29
28 enum RTSPLowerTransport { 30 enum RTSPLowerTransport {
29 RTSP_LOWER_TRANSPORT_UDP = 0, 31 RTSP_LOWER_TRANSPORT_UDP = 0,
30 RTSP_LOWER_TRANSPORT_TCP = 1, 32 RTSP_LOWER_TRANSPORT_TCP = 1,
31 RTSP_LOWER_TRANSPORT_UDP_MULTICAST = 2, 33 RTSP_LOWER_TRANSPORT_UDP_MULTICAST = 2,
64 int seq; /**< sequence number */ 66 int seq; /**< sequence number */
65 char session_id[512]; 67 char session_id[512];
66 char real_challenge[64]; /**< the RealChallenge1 field from the server */ 68 char real_challenge[64]; /**< the RealChallenge1 field from the server */
67 } RTSPHeader; 69 } RTSPHeader;
68 70
71 enum RTSPClientState {
72 RTSP_STATE_IDLE,
73 RTSP_STATE_PLAYING,
74 RTSP_STATE_PAUSED,
75 };
76
77 enum RTSPServerType {
78 RTSP_SERVER_RTP, /*< Standard-compliant RTP-server */
79 RTSP_SERVER_REAL, /*< Realmedia-style server */
80 RTSP_SERVER_LAST
81 };
82
83 enum RTSPTransport {
84 RTSP_TRANSPORT_RTP,
85 RTSP_TRANSPORT_RDT,
86 RTSP_TRANSPORT_LAST
87 };
88
89 typedef struct RTSPState {
90 URLContext *rtsp_hd; /* RTSP TCP connexion handle */
91 int nb_rtsp_streams;
92 struct RTSPStream **rtsp_streams;
93
94 enum RTSPClientState state;
95 int64_t seek_timestamp;
96
97 /* XXX: currently we use unbuffered input */
98 // ByteIOContext rtsp_gb;
99 int seq; /* RTSP command sequence number */
100 char session_id[512];
101 enum RTSPTransport transport;
102 enum RTSPLowerTransport lower_transport;
103 enum RTSPServerType server_type;
104 char last_reply[2048]; /* XXX: allocate ? */
105 void *cur_tx;
106 int need_subscription;
107 enum AVDiscard real_setup_cache[MAX_STREAMS];
108 char last_subscription[1024];
109 } RTSPState;
110
111 typedef struct RTSPStream {
112 URLContext *rtp_handle; /* RTP stream handle */
113 void *tx_ctx; /* RTP/RDT parse context */
114
115 int stream_index; /* corresponding stream index, if any. -1 if none (MPEG2TS case) */
116 int interleaved_min, interleaved_max; /* interleave ids, if TCP transport */
117 char control_url[1024]; /* url for this stream (from SDP) */
118
119 int sdp_port; /* port (from SDP content - not used in RTSP) */
120 struct in_addr sdp_ip; /* IP address (from SDP content - not used in RTSP) */
121 int sdp_ttl; /* IP TTL (from SDP content - not used in RTSP) */
122 int sdp_payload_type; /* payload type - only used in SDP */
123 RTPPayloadData rtp_payload_data; /* rtp payload parsing infos from SDP */
124
125 RTPDynamicProtocolHandler *dynamic_handler; ///< Only valid if it's a dynamic protocol. (This is the handler structure)
126 PayloadContext *dynamic_protocol_context; ///< Only valid if it's a dynamic protocol. (This is any private data associated with the dynamic protocol)
127 } RTSPStream;
128
69 /** the callback can be used to extend the connection setup/teardown step */ 129 /** the callback can be used to extend the connection setup/teardown step */
70 enum RTSPCallbackAction { 130 enum RTSPCallbackAction {
71 RTSP_ACTION_SERVER_SETUP, 131 RTSP_ACTION_SERVER_SETUP,
72 RTSP_ACTION_SERVER_TEARDOWN, 132 RTSP_ACTION_SERVER_TEARDOWN,
73 RTSP_ACTION_CLIENT_SETUP, 133 RTSP_ACTION_CLIENT_SETUP,