Ignore:
Timestamp:
Jun 4, 2010 1:41:34 PM (14 years ago)
Author:
nanang
Message:

Re #668:

  • Fixed process_answer() of SDP negotiation, when no common format in a media, instead of returning error, it should just deactivate the media (offer & answer) and continue negotiating next media.
  • Generalized the way of deactivating media: set port to 0 and remove all attributes.
  • Added new API pjmedia_sdp_media_clone_deactivate() to clone media and deactivate the newly cloned media.
  • Updated PJMEDIA SDP negotiation test.
File:
1 edited

Legend:

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

    r3172 r3198  
    13021302            const pjmedia_sdp_media *rem_m = rem_sdp->media[i]; 
    13031303            pjmedia_sdp_media *m; 
    1304             const pjmedia_sdp_attr *a; 
    13051304 
    13061305            if ((int)i == call->audio_idx) 
    13071306                continue; 
    13081307 
    1309             m = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media); 
    1310             pj_strdup(pool, &m->desc.media, &rem_m->desc.media); 
    1311             pj_strdup(pool, &m->desc.transport, &rem_m->desc.transport); 
    1312             m->desc.port = 0; 
    1313  
    1314             /* Add one format, copy from the offer. And copy the corresponding 
    1315              * rtpmap and fmtp attributes too. 
    1316              */ 
    1317             m->desc.fmt_count = 1; 
    1318             pj_strdup(pool, &m->desc.fmt[0], &rem_m->desc.fmt[0]); 
    1319             if ((a=pjmedia_sdp_attr_find2(rem_m->attr_count, rem_m->attr, 
    1320                                           "rtpmap", &m->desc.fmt[0])) != NULL) 
    1321             { 
    1322                 m->attr[m->attr_count++] = pjmedia_sdp_attr_clone(pool, a); 
    1323             } 
    1324             if ((a=pjmedia_sdp_attr_find2(rem_m->attr_count, rem_m->attr, 
    1325                                           "fmtp", &m->desc.fmt[0])) != NULL) 
    1326             { 
    1327                 m->attr[m->attr_count++] = pjmedia_sdp_attr_clone(pool, a); 
    1328             } 
    1329  
     1308            m = pjmedia_sdp_media_clone_deactivate(pool, rem_m); 
    13301309            if (i==sdp->media_count) 
    13311310                sdp->media[sdp->media_count++] = m; 
Note: See TracChangeset for help on using the changeset viewer.