Ignore:
Timestamp:
Aug 26, 2008 4:51:28 PM (13 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/pjmedia/src/pjmedia/rtp.c

    r2039 r2241  
    8585} 
    8686 
     87PJ_DEF(pj_status_t) pjmedia_rtp_session_init2(  
     88                                    pjmedia_rtp_session *ses, 
     89                                    pjmedia_rtp_session_setting settings) 
     90{ 
     91    pj_status_t status; 
     92    int          pt = 0; 
     93    pj_uint32_t  sender_ssrc = 0; 
     94 
     95    if (settings.flags & 1) 
     96        pt = settings.default_pt; 
     97    if (settings.flags & 2) 
     98        sender_ssrc = settings.sender_ssrc; 
     99 
     100    status = pjmedia_rtp_session_init(ses, pt, sender_ssrc); 
     101    if (status != PJ_SUCCESS) 
     102        return status; 
     103 
     104    if (settings.flags & 4) { 
     105        ses->out_extseq = settings.seq; 
     106        ses->out_hdr.seq = pj_htons((pj_uint16_t)ses->out_extseq); 
     107    } 
     108    if (settings.flags & 8) 
     109        ses->out_hdr.ts = pj_htonl(settings.ts); 
     110 
     111    return PJ_SUCCESS; 
     112} 
     113 
    87114 
    88115PJ_DEF(pj_status_t) pjmedia_rtp_encode_rtp( pjmedia_rtp_session *ses,  
Note: See TracChangeset for help on using the changeset viewer.