Ignore:
Timestamp:
Aug 26, 2008 4:51:28 PM (16 years ago)
Author:
nanang
Message:

Ticket #602:

  • Introduced new API pjmedia_rtp_session_init2() to enable intializing RTP session with non-default initial settings
  • Updated stream so it can be created with non-default initial RTP settings.
  • Updated pjsua-lib to make sure RTP timestamp and sequence contigue when stream session is restarted.
File:
1 edited

Legend:

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

    r2235 r2241  
    11591159 
    11601160    if (call->session) { 
     1161        pjmedia_rtcp_stat stat; 
     1162 
     1163        if (pjmedia_session_get_stream_stat(call->session,  
     1164                                            call->audio_idx,  
     1165                                            &stat) == PJ_SUCCESS) 
     1166        { 
     1167            /* Save RTP timestamp & sequence, so when media session is  
     1168             * restarted, those values will be restored as the initial  
     1169             * RTP timestamp & sequence of the new media session. So in  
     1170             * the same call session, RTP timestamp and sequence are  
     1171             * guaranteed to be contigue. 
     1172             */ 
     1173            call->rtp_tx_seq_ts_set = 1 | (1 << 1); 
     1174            call->rtp_tx_seq = stat.rtp_tx_last_seq; 
     1175            call->rtp_tx_ts = stat.rtp_tx_last_ts; 
     1176        } 
     1177 
    11611178        if (pjsua_var.ua_cfg.cb.on_stream_destroyed) { 
    11621179            pjsua_var.ua_cfg.cb.on_stream_destroyed(call_id, call->session, 0); 
     
    13221339        /* Set SSRC */ 
    13231340        si->ssrc = call->ssrc; 
     1341 
     1342        /* Set RTP timestamp & sequence, normally these value are intialized 
     1343         * automatically when stream session created, but for some cases (e.g: 
     1344         * call reinvite, call update) timestamp and sequence need to be kept 
     1345         * contigue. 
     1346         */ 
     1347        si->rtp_ts = call->rtp_tx_ts; 
     1348        si->rtp_seq = call->rtp_tx_seq; 
     1349        si->rtp_seq_ts_set = call->rtp_tx_seq_ts_set; 
    13241350 
    13251351        /* Create session based on session info. */ 
Note: See TracChangeset for help on using the changeset viewer.