Ignore:
Timestamp:
May 9, 2018 6:58:48 AM (6 years ago)
Author:
ming
Message:

Fixed #2087: Support for RTP and RTCP multiplexing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r5774 r5788  
    579579    pj_sockaddr_cp(&skinfo->rtcp_addr_name, &mapped_addr[1]); 
    580580 
    581     PJ_LOG(4,(THIS_FILE, "RTP socket reachable at %s", 
     581    PJ_LOG(4,(THIS_FILE, "RTP%s socket reachable at %s", 
     582              (call_med->enable_rtcp_mux? " & RTCP": ""), 
    582583              pj_sockaddr_print(&skinfo->rtp_addr_name, addr_buf, 
    583584                                sizeof(addr_buf), 3))); 
     
    18321833 
    18331834            if (call_med->tp) { 
     1835                unsigned options = (call_med->enable_rtcp_mux? 
     1836                                    PJMEDIA_TPMED_RTCP_MUX: 0); 
    18341837                status = pjmedia_transport_media_create( 
    18351838                             call_med->tp, tmp_pool, 
    1836                              0, call->async_call.rem_sdp, mi); 
     1839                             options, call->async_call.rem_sdp, mi); 
    18371840            } 
    18381841            if (status != PJ_SUCCESS) { 
     
    21542157 
    21552158        if (enabled) { 
     2159            call_med->enable_rtcp_mux = acc->cfg.enable_rtcp_mux; 
     2160 
    21562161            status = pjsua_call_media_init(call_med, media_type, 
    21572162                                           &acc->cfg.rtp_cfg, 
     
    27902795         * internally by ICE and does not need to cause media restart. 
    27912796         */ 
     2797        if (old_si->rtcp_mux != new_si->rtcp_mux) 
     2798            return PJ_TRUE; 
    27922799        if (!is_ice_running(call_med->tp) && 
    27932800            pj_sockaddr_cmp(&old_si->rem_addr, &new_si->rem_addr)) 
     
    28522859         * internally by ICE and does not need to cause media restart. 
    28532860         */ 
     2861        if (old_si->rtcp_mux != new_si->rtcp_mux) 
     2862            return PJ_TRUE; 
    28542863        if (!is_ice_running(call_med->tp) && 
    28552864            pj_sockaddr_cmp(&old_si->rem_addr, &new_si->rem_addr)) 
     
    30273036                             call_id, mi)); 
    30283037                goto on_check_med_status; 
     3038            } 
     3039 
     3040            /* Check if remote wants RTP and RTCP multiplexing, 
     3041             * but we don't enable it. 
     3042             */ 
     3043            if (si->rtcp_mux && !call_med->enable_rtcp_mux) { 
     3044                si->rtcp_mux = PJ_FALSE; 
    30293045            } 
    30303046 
     
    30713087 
    30723088                if (call->inv->following_fork) { 
     3089                    unsigned options = (call_med->enable_rtcp_mux? 
     3090                                        PJMEDIA_TPMED_RTCP_MUX: 0); 
    30733091                    /* Normally media transport will automatically restart 
    30743092                     * itself (if needed, based on info from the SDP) in 
     
    30883106                    status = pjmedia_transport_media_create(call_med->tp, 
    30893107                                                            tmp_pool, 
    3090                                                             0, NULL, mi); 
     3108                                                            options, NULL, mi); 
    30913109                    if (status != PJ_SUCCESS) { 
    30923110                        PJ_PERROR(1,(THIS_FILE, status, 
     
    32053223            } 
    32063224 
     3225            /* Check if remote wants RTP and RTCP multiplexing, 
     3226             * but we don't enable it. 
     3227             */ 
     3228            if (si->rtcp_mux && !call_med->enable_rtcp_mux) { 
     3229                si->rtcp_mux = PJ_FALSE; 
     3230            } 
     3231 
    32073232            /* Check if this media is changed */ 
    32083233            stream_info.type = PJMEDIA_TYPE_VIDEO; 
Note: See TracChangeset for help on using the changeset viewer.