Changeset 5852
- Timestamp:
- Aug 3, 2018 2:33:28 AM (6 years ago)
- Location:
- pjproject/trunk/pjmedia/src/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
r5850 r5852 80 80 pj_bool_t use_ice; 81 81 pj_sockaddr rtp_src_addr; /**< Actual source RTP address. */ 82 unsigned rtp_src_cnt; /**< How many pkt from this addr. */ 82 83 pj_sockaddr rtcp_src_addr; /**< Actual source RTCP address. */ 83 84 unsigned rtcp_src_cnt; /**< How many pkt from this addr. */ … … 1764 1765 * ICE activated or received any packets. 1765 1766 */ 1766 if (tp_ice->use_ice) { 1767 info->src_rtp_name = tp_ice->rtp_src_addr; 1768 } 1769 if (tp_ice->use_ice || tp_ice->rtcp_src_cnt) { 1770 info->src_rtcp_name = tp_ice->rtcp_src_addr; 1767 if (tp_ice->use_ice || tp_ice->rtp_src_cnt) { 1768 pj_sockaddr_cp(&info->src_rtp_name, &tp_ice->rtp_src_addr); 1769 if (tp_ice->use_rtcp_mux) 1770 pj_sockaddr_cp(&info->src_rtcp_name, &tp_ice->rtp_src_addr); 1771 } 1772 if ((!tp_ice->use_rtcp_mux) && 1773 (tp_ice->use_ice || tp_ice->rtcp_src_cnt)) 1774 { 1775 pj_sockaddr_cp(&info->src_rtcp_name, &tp_ice->rtcp_src_addr); 1771 1776 } 1772 1777 … … 1861 1866 tp_ice->rtp_src_addr = tp_ice->remote_rtp; 1862 1867 pj_bzero(&tp_ice->rtcp_src_addr, sizeof(tp_ice->rtcp_src_addr)); 1863 tp_ice->rt cp_src_cnt = 0;1868 tp_ice->rtp_src_cnt = tp_ice->rtcp_src_cnt = 0; 1864 1869 1865 1870 return PJ_SUCCESS; … … 1946 1951 /* Destroy on progress */ 1947 1952 return; 1953 } 1954 1955 if (comp_id == 1) { 1956 ++tp_ice->rtp_src_cnt; 1957 pj_sockaddr_cp(&tp_ice->rtp_src_addr, src_addr); 1958 } else if (comp_id == 2) { 1959 pj_sockaddr_cp(&tp_ice->rtcp_src_addr, src_addr); 1948 1960 } 1949 1961 -
pjproject/trunk/pjmedia/src/pjmedia/transport_srtp_dtls.c
r5847 r5852 1330 1330 dtls_srtp *ds = (dtls_srtp *)tp; 1331 1331 pj_ice_strans_state ice_state; 1332 pj_bool_t use_rtcp_mux = PJ_FALSE; 1332 1333 pj_status_t status = PJ_SUCCESS; 1333 1334 … … 1369 1370 } 1370 1371 1371 /* Check and update ICE status */1372 /* Check and update ICE and rtcp-mux status */ 1372 1373 { 1373 1374 pjmedia_transport_info info; … … 1376 1377 pjmedia_transport_info_init(&info); 1377 1378 pjmedia_transport_get_info(ds->srtp->member_tp, &info); 1379 if (pj_sockaddr_cmp(&info.sock_info.rtp_addr_name, 1380 &info.sock_info.rtcp_addr_name) == 0) 1381 { 1382 use_rtcp_mux = PJ_TRUE; 1383 } 1378 1384 ice_info = (pjmedia_ice_transport_info*) 1379 1385 pjmedia_transport_info_get_spc_info( … … 1435 1441 pj_sockaddr_init(pj_AF_INET(), &ap.rem_addr, 0, 0); 1436 1442 1437 if (pj_sockaddr_has_addr(&ds->rem_rtcp)) 1443 if (use_rtcp_mux) { 1444 /* Using RTP & RTCP multiplexing */ 1445 pj_sockaddr_cp(&ap.rem_rtcp, &ds->rem_addr); 1446 } else if (pj_sockaddr_has_addr(&ds->rem_rtcp)) { 1438 1447 pj_sockaddr_cp(&ap.rem_rtcp, &ds->rem_rtcp); 1439 else 1448 } else if (pj_sockaddr_has_addr(&ds->rem_addr)) { 1449 pj_sockaddr_cp(&ap.rem_rtcp, &ds->rem_addr); 1450 pj_sockaddr_set_port(&ap.rem_rtcp, 1451 pj_sockaddr_get_port(&ap.rem_rtcp) + 1); 1452 } else { 1440 1453 pj_sockaddr_init(pj_AF_INET(), &ap.rem_rtcp, 0, 0); 1454 } 1441 1455 1442 1456 ap.addr_len = pj_sockaddr_get_len(&ap.rem_addr);
Note: See TracChangeset
for help on using the changeset viewer.