Changeset 1810 for pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
- Timestamp:
- Feb 21, 2008 10:08:27 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
r1794 r1810 36 36 #define MAX_PENDING 4 37 37 38 static const pj_str_t ID_RTP_AVP = { "RTP/AVP", 7 }; 39 38 40 /* Pending write buffer */ 39 41 typedef struct pending_write … … 50 52 pj_pool_t *pool; /**< Memory pool */ 51 53 unsigned options; /**< Transport options. */ 54 unsigned media_options; /**< Transport media options. */ 52 55 void *user_data; /**< Only valid when attached */ 53 56 pj_bool_t attached; /**< Has attachment? */ … … 121 124 static pj_status_t transport_media_create(pjmedia_transport *tp, 122 125 pj_pool_t *pool, 126 unsigned options, 123 127 pjmedia_sdp_session *sdp_local, 124 128 const pjmedia_sdp_session *sdp_remote, … … 765 769 static pj_status_t transport_media_create(pjmedia_transport *tp, 766 770 pj_pool_t *pool, 771 unsigned options, 767 772 pjmedia_sdp_session *sdp_local, 768 773 const pjmedia_sdp_session *sdp_remote, 769 774 unsigned media_index) 770 775 { 771 PJ_UNUSED_ARG(tp); 772 PJ_UNUSED_ARG(pool); 773 PJ_UNUSED_ARG(sdp_local); 774 PJ_UNUSED_ARG(sdp_remote); 775 PJ_UNUSED_ARG(media_index); 776 struct transport_udp *udp = (struct transport_udp*)tp; 777 778 PJ_ASSERT_RETURN(tp && pool && sdp_local, PJ_EINVAL); 779 udp->media_options = options; 780 781 /* Validate media transport */ 782 /* By now, this transport only support RTP/AVP transport */ 783 if ((udp->media_options & PJMEDIA_TPMED_NO_TRANSPORT_CHECKING) == 0) { 784 pjmedia_sdp_media *m_rem, *m_loc; 785 786 m_rem = sdp_remote? sdp_remote->media[media_index] : NULL; 787 m_loc = sdp_local->media[media_index]; 788 789 if (pj_stricmp(&m_loc->desc.transport, &ID_RTP_AVP) || 790 (m_rem && pj_stricmp(&m_rem->desc.transport, &ID_RTP_AVP))) 791 { 792 pjmedia_sdp_media_deactivate(pool, m_loc); 793 return PJMEDIA_SDP_EINPROTO; 794 } 795 } 776 796 777 797 return PJ_SUCCESS; … … 784 804 unsigned media_index) 785 805 { 786 PJ_UNUSED_ARG(tp); 787 PJ_UNUSED_ARG(pool); 788 PJ_UNUSED_ARG(sdp_local); 789 PJ_UNUSED_ARG(sdp_remote); 790 PJ_UNUSED_ARG(media_index); 806 struct transport_udp *udp = (struct transport_udp*)tp; 807 808 PJ_ASSERT_RETURN(tp && pool && sdp_local, PJ_EINVAL); 809 810 /* Validate media transport */ 811 /* By now, this transport only support RTP/AVP transport */ 812 if ((udp->media_options & PJMEDIA_TPMED_NO_TRANSPORT_CHECKING) == 0) { 813 pjmedia_sdp_media *m_rem, *m_loc; 814 815 m_rem = sdp_remote->media[media_index]; 816 m_loc = sdp_local->media[media_index]; 817 818 if (pj_stricmp(&m_loc->desc.transport, &ID_RTP_AVP) || 819 pj_stricmp(&m_rem->desc.transport, &ID_RTP_AVP)) 820 { 821 pjmedia_sdp_media_deactivate(pool, m_loc); 822 return PJMEDIA_SDP_EINPROTO; 823 } 824 } 791 825 792 826 return PJ_SUCCESS;
Note: See TracChangeset
for help on using the changeset viewer.