- Timestamp:
- Mar 22, 2007 9:00:53 PM (17 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/include/pjnath/ice_stream_transport.h
r1094 r1096 17 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 18 */ 19 #ifndef __PJNATH_ICE_ MT_H__20 #define __PJNATH_ICE_ MT_H__19 #ifndef __PJNATH_ICE_STREAM_TRANSPORT_H__ 20 #define __PJNATH_ICE_STREAM_TRANSPORT_H__ 21 21 22 22 … … 26 26 */ 27 27 #include <pjnath/ice.h> 28 #include <pjlib-util/resolver.h> 28 29 #include <pj/ioqueue.h> 29 30 … … 33 34 34 35 /** 35 * @defgroup PJNATH_ICE_ MEDIA_TRANSPORT ICE MediaTransport36 * @brief ICE Media Transport36 * @defgroup PJNATH_ICE_STREAM_TRANSPORT ICE Stream Transport 37 * @brief Transport for media stream using ICE 37 38 * @ingroup PJNATH_ICE 38 39 * @{ 39 40 */ 40 41 41 typedef struct pj_ice mt pj_icemt;42 typedef struct pj_ice_st pj_ice_st; 42 43 43 typedef struct pj_ice mt_cb44 typedef struct pj_ice_st_cb 44 45 { 45 void (*on_ice_complete)(pj_icemt *icemt, 46 pj_status_t status); 47 void (*on_rx_rtp)(pj_icemt *icemt, 48 void *pkt, pj_size_t size, 49 const pj_sockaddr_t *src_addr, 50 unsigned src_addr_len); 51 void (*on_rx_rtcp)(pj_icemt *icemt, 52 void *pkt, pj_size_t size, 53 const pj_sockaddr_t *src_addr, 54 unsigned src_addr_len); 46 void (*on_rx_data)(pj_ice_st *ice_st, 47 unsigned comp_id, unsigned cand_id, 48 void *pkt, pj_size_t size, 49 const pj_sockaddr_t *src_addr, 50 unsigned src_addr_len); 55 51 56 } pj_icemt_cb; 52 void (*on_stun_srv_resolved)(pj_ice_st *ice_st, 53 pj_status_t status); 54 void (*on_interface_status)(pj_ice_st *ice_st, 55 void *notify_data, 56 pj_status_t status, 57 int itf_id); 58 void (*on_ice_complete)(pj_ice_st *ice_st, 59 pj_status_t status); 60 61 } pj_ice_st_cb; 57 62 58 63 59 typedef struct pj_ice mt_sock64 typedef struct pj_ice_st_comp 60 65 { 61 pj_icemt *icemt;62 66 unsigned comp_id; 67 } pj_ice_st_comp; 68 69 70 typedef struct pj_ice_st_interface 71 { 72 pj_ice_st *ice_st; 73 pj_ice_cand_type type; 74 unsigned comp_id; 75 int cand_id; 76 pj_str_t foundation; 77 pj_uint16_t local_pref; 63 78 pj_sock_t sock; 64 79 pj_sockaddr addr; … … 70 85 pj_sockaddr src_addr; 71 86 int src_addr_len; 72 } pj_ice mt_sock;87 } pj_ice_st_interface; 73 88 74 89 75 struct pj_ice mt90 struct pj_ice_st 76 91 { 77 pj_pool_t *pool; 78 pj_ice *ice; 79 void *user_data; 92 char obj_name[PJ_MAX_OBJ_NAME]; 93 pj_pool_t *pool; 94 void *user_data; 95 pj_stun_config stun_cfg; 96 pj_ice_st_cb cb; 80 97 81 pj_ice mt_cb cb;98 pj_ice *ice; 82 99 83 pj_icemt_sock rtp;84 pj_icemt_sock rtcp;100 unsigned comp_cnt; 101 unsigned comps[PJ_ICE_MAX_COMP]; 85 102 86 pj_bool_t has_turn; 87 pj_sockaddr stun_srv; 103 unsigned itf_cnt; 104 pj_ice_st_interface *itfs[PJ_ICE_MAX_CAND]; 105 106 pj_dns_resolver *resolver; 107 pj_bool_t relay_enabled; 108 pj_str_t stun_domain; 109 pj_sockaddr_in stun_srv; 88 110 }; 89 111 90 112 91 PJ_DECL(pj_status_t) pj_icemt_create(pj_stun_config *stun_cfg, 92 const char *name, 93 pj_ice_role role, 94 const pj_icemt_cb *cb, 95 unsigned rtp_port, 96 pj_bool_t has_rtcp, 97 pj_bool_t has_turn, 98 const pj_sockaddr *srv, 99 pj_icemt **p_icemt); 100 PJ_DECL(pj_status_t) pj_icemt_destroy(pj_icemt *icemt); 113 PJ_DECL(pj_status_t) pj_ice_st_create(pj_stun_config *stun_cfg, 114 const char *name, 115 void *user_data, 116 const pj_ice_st_cb *cb, 117 pj_ice_st **p_ice_st); 118 PJ_DECL(pj_status_t) pj_ice_st_destroy(pj_ice_st *ice_st); 101 119 120 PJ_DECL(pj_status_t) pj_ice_st_set_stun(pj_ice_st *ice_st, 121 pj_dns_resolver *resolver, 122 pj_bool_t enable_relay, 123 const pj_str_t *domain); 124 PJ_DECL(pj_status_t) pj_ice_st_set_stun_addr(pj_ice_st *ice_st, 125 pj_bool_t enable_relay, 126 const pj_sockaddr_in *srv_addr); 127 128 PJ_DECL(pj_status_t) pj_ice_st_add_comp(pj_ice_st *ice_st, 129 unsigned comp_id); 130 131 PJ_DECL(pj_status_t) pj_ice_st_add_host_interface(pj_ice_st *ice_st, 132 unsigned comp_id, 133 pj_uint16_t local_pref, 134 const pj_sockaddr_in *addr, 135 unsigned *p_itf_id, 136 pj_bool_t notify, 137 void *notify_data); 138 PJ_DECL(pj_status_t) pj_ice_st_add_all_host_interfaces(pj_ice_st *ice_st, 139 unsigned comp_id, 140 unsigned port, 141 pj_bool_t notify, 142 void *notify_data); 143 PJ_DECL(pj_status_t) pj_ice_st_add_stun_interface(pj_ice_st *ice_st, 144 unsigned comp_id, 145 unsigned local_port, 146 pj_bool_t notify, 147 void *notify_data); 148 PJ_DECL(pj_status_t) pj_ice_st_add_relay_interface(pj_ice_st *ice_st, 149 unsigned comp_id, 150 unsigned local_port, 151 pj_bool_t notify, 152 void *notify_data); 153 154 155 PJ_DECL(pj_status_t) pj_ice_st_init_ice(pj_ice_st *ice_st, 156 pj_ice_role role, 157 const pj_str_t *local_ufrag, 158 const pj_str_t *local_passwd); 159 PJ_DECL(pj_status_t) pj_ice_st_enum_cands(pj_ice_st *ice_st, 160 unsigned *count, 161 pj_ice_cand cand[]); 162 PJ_DECL(pj_status_t) pj_ice_st_start_ice(pj_ice_st *ice_st, 163 const pj_str_t *rem_ufrag, 164 const pj_str_t *rem_passwd, 165 unsigned rem_cand_cnt, 166 const pj_ice_cand rem_cand[]); 167 PJ_DECL(pj_status_t) pj_ice_st_stop_ice(pj_ice_st *ice_st); 168 169 PJ_DECL(pj_status_t) pj_ice_st_send_data(pj_ice_st *ice_st, 170 unsigned comp_id, 171 const void *data, 172 pj_size_t data_len); 102 173 103 174 … … 111 182 112 183 113 #endif /* __PJNATH_ICE_ MT_H__ */184 #endif /* __PJNATH_ICE_STREAM_TRANSPORT_H__ */ 114 185
Note: See TracChangeset
for help on using the changeset viewer.