- Timestamp:
- Dec 28, 2016 3:40:07 AM (8 years ago)
- Location:
- pjproject/branches/projects/uwp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/uwp
- Property svn:mergeinfo changed
/pjproject/trunk (added) merged: 5209,5212-5234,5237-5253,5255,5257-5292,5294-5297,5299-5332,5334-5394,5396-5438,5440-5469,5471-5496,5498-5510
- Property svn:mergeinfo changed
-
pjproject/branches/projects/uwp/pjmedia/src/pjmedia/transport_adapter_sample.c
r3841 r5513 27 27 static pj_status_t transport_get_info (pjmedia_transport *tp, 28 28 pjmedia_transport_info *info); 29 static pj_status_t transport_attach (pjmedia_transport *tp, 30 void *user_data, 31 const pj_sockaddr_t *rem_addr, 32 const pj_sockaddr_t *rem_rtcp, 33 unsigned addr_len, 34 void (*rtp_cb)(void*, 35 void*, 36 pj_ssize_t), 37 void (*rtcp_cb)(void*, 38 void*, 39 pj_ssize_t)); 29 static pj_status_t transport_attach2 (pjmedia_transport *tp, 30 pjmedia_transport_attach_param *att_prm); 40 31 static void transport_detach (pjmedia_transport *tp, 41 32 void *strm); … … 77 68 { 78 69 &transport_get_info, 79 &transport_attach,70 NULL, 80 71 &transport_detach, 81 72 &transport_send_rtp, … … 87 78 &transport_media_stop, 88 79 &transport_simulate_lost, 89 &transport_destroy 80 &transport_destroy, 81 &transport_attach2, 90 82 }; 91 83 … … 101 93 /* Stream information. */ 102 94 void *stream_user_data; 95 void *stream_ref; 103 96 void (*stream_rtp_cb)(void *user_data, 104 97 void *pkt, … … 191 184 } 192 185 193 194 /* 195 * attach() is called by stream to register callbacks that we should 186 /* 187 * attach2() is called by stream to register callbacks that we should 196 188 * call on receipt of RTP and RTCP packets. 197 189 */ 198 static pj_status_t transport_attach(pjmedia_transport *tp, 199 void *user_data, 200 const pj_sockaddr_t *rem_addr, 201 const pj_sockaddr_t *rem_rtcp, 202 unsigned addr_len, 203 void (*rtp_cb)(void*, 204 void*, 205 pj_ssize_t), 206 void (*rtcp_cb)(void*, 207 void*, 208 pj_ssize_t)) 190 static pj_status_t transport_attach2(pjmedia_transport *tp, 191 pjmedia_transport_attach_param *att_param) 209 192 { 210 193 struct tp_adapter *adapter = (struct tp_adapter*)tp; … … 216 199 */ 217 200 pj_assert(adapter->stream_user_data == NULL); 218 adapter->stream_user_data = user_data; 219 adapter->stream_rtp_cb = rtp_cb; 220 adapter->stream_rtcp_cb = rtcp_cb; 221 222 status = pjmedia_transport_attach(adapter->slave_tp, adapter, rem_addr, 223 rem_rtcp, addr_len, &transport_rtp_cb, 224 &transport_rtcp_cb); 201 adapter->stream_user_data = att_param->user_data; 202 adapter->stream_rtp_cb = att_param->rtp_cb; 203 adapter->stream_rtcp_cb = att_param->rtcp_cb; 204 adapter->stream_ref = att_param->stream; 205 206 att_param->rtp_cb = &transport_rtp_cb; 207 att_param->rtcp_cb = &transport_rtcp_cb; 208 att_param->user_data = adapter; 209 210 status = pjmedia_transport_attach2(adapter->slave_tp, att_param); 225 211 if (status != PJ_SUCCESS) { 226 212 adapter->stream_user_data = NULL; 227 213 adapter->stream_rtp_cb = NULL; 228 214 adapter->stream_rtcp_cb = NULL; 215 adapter->stream_ref = NULL; 229 216 return status; 230 217 } … … 248 235 adapter->stream_rtp_cb = NULL; 249 236 adapter->stream_rtcp_cb = NULL; 237 adapter->stream_ref = NULL; 250 238 } 251 239 }
Note: See TracChangeset
for help on using the changeset viewer.