Ignore:
Timestamp:
Jun 19, 2008 2:10:28 PM (16 years ago)
Author:
bennylp
Message:

Ticket #549: major modification in media transport API to support more offer/answer scenarios

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c

    r1944 r2032  
    130130                                       pj_pool_t *pool, 
    131131                                       unsigned options, 
    132                                        pjmedia_sdp_session *sdp_local, 
    133132                                       const pjmedia_sdp_session *sdp_remote, 
    134133                                       unsigned media_index); 
     134static pj_status_t transport_encode_sdp(pjmedia_transport *tp, 
     135                                        pj_pool_t *pool, 
     136                                        pjmedia_sdp_session *sdp_local, 
     137                                        const pjmedia_sdp_session *rem_sdp, 
     138                                        unsigned media_index); 
    135139static pj_status_t transport_media_start (pjmedia_transport *tp, 
    136140                                       pj_pool_t *pool, 
    137                                        pjmedia_sdp_session *sdp_local, 
     141                                       const pjmedia_sdp_session *sdp_local, 
    138142                                       const pjmedia_sdp_session *sdp_remote, 
    139143                                       unsigned media_index); 
     
    154158    &transport_send_rtcp2, 
    155159    &transport_media_create, 
     160    &transport_encode_sdp, 
    156161    &transport_media_start, 
    157162    &transport_media_stop, 
     
    791796                                  pj_pool_t *pool, 
    792797                                  unsigned options, 
    793                                   pjmedia_sdp_session *sdp_local, 
    794798                                  const pjmedia_sdp_session *sdp_remote, 
    795799                                  unsigned media_index) 
     
    797801    struct transport_udp *udp = (struct transport_udp*)tp; 
    798802 
    799     PJ_ASSERT_RETURN(tp && pool && sdp_local, PJ_EINVAL); 
     803    PJ_ASSERT_RETURN(tp && pool, PJ_EINVAL); 
    800804    udp->media_options = options; 
     805 
     806    PJ_UNUSED_ARG(sdp_remote); 
     807    PJ_UNUSED_ARG(media_index); 
     808 
     809    return PJ_SUCCESS; 
     810} 
     811 
     812static pj_status_t transport_encode_sdp(pjmedia_transport *tp, 
     813                                        pj_pool_t *pool, 
     814                                        pjmedia_sdp_session *sdp_local, 
     815                                        const pjmedia_sdp_session *rem_sdp, 
     816                                        unsigned media_index) 
     817{ 
     818    struct transport_udp *udp = (struct transport_udp*)tp; 
    801819 
    802820    /* Validate media transport */ 
     
    805823        pjmedia_sdp_media *m_rem, *m_loc; 
    806824 
    807         m_rem = sdp_remote? sdp_remote->media[media_index] : NULL; 
     825        m_rem = rem_sdp? rem_sdp->media[media_index] : NULL; 
    808826        m_loc = sdp_local->media[media_index]; 
    809827 
     
    821839static pj_status_t transport_media_start(pjmedia_transport *tp, 
    822840                                  pj_pool_t *pool, 
    823                                   pjmedia_sdp_session *sdp_local, 
     841                                  const pjmedia_sdp_session *sdp_local, 
    824842                                  const pjmedia_sdp_session *sdp_remote, 
    825843                                  unsigned media_index) 
    826844{ 
    827     struct transport_udp *udp = (struct transport_udp*)tp; 
    828  
    829845    PJ_ASSERT_RETURN(tp && pool && sdp_local, PJ_EINVAL); 
    830846 
    831     /* Validate media transport */ 
    832     /* By now, this transport only support RTP/AVP transport */ 
    833     if ((udp->media_options & PJMEDIA_TPMED_NO_TRANSPORT_CHECKING) == 0) { 
    834         pjmedia_sdp_media *m_rem, *m_loc; 
    835  
    836         m_rem = sdp_remote->media[media_index]; 
    837         m_loc = sdp_local->media[media_index]; 
    838  
    839         if (pj_stricmp(&m_loc->desc.transport, &ID_RTP_AVP) || 
    840             pj_stricmp(&m_rem->desc.transport, &ID_RTP_AVP)) 
    841         { 
    842             pjmedia_sdp_media_deactivate(pool, m_loc); 
    843             return PJMEDIA_SDP_EINPROTO; 
    844         } 
    845     } 
     847    PJ_UNUSED_ARG(tp); 
     848    PJ_UNUSED_ARG(pool); 
     849    PJ_UNUSED_ARG(sdp_local); 
     850    PJ_UNUSED_ARG(sdp_remote); 
     851    PJ_UNUSED_ARG(media_index); 
    846852 
    847853    return PJ_SUCCESS; 
Note: See TracChangeset for help on using the changeset viewer.