Changeset 1798
- Timestamp:
- Feb 14, 2008 7:45:47 PM (17 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/rtp.h
r1114 r1798 302 302 303 303 304 /** 305 * Call this function everytime an RTP packet is received to check whether 306 * the packet can be received and to let the RTP session performs its internal 307 * calculations. 308 * 309 * @param ses The session. 310 * @param hdr The RTP header of the incoming packet. The header must 311 * be given with fields in network byte order. 312 * @param seq_st Optional structure to receive the status of the RTP packet 313 * processing. 314 * @param check_pt Flag to indicate whether payload type needs to be validate. 315 * 316 * @see pjmedia_rtp_session_update() 317 */ 318 PJ_DECL(void) pjmedia_rtp_session_update2(pjmedia_rtp_session *ses, 319 const pjmedia_rtp_hdr *hdr, 320 pjmedia_rtp_status *seq_st, 321 pj_bool_t check_pt); 322 323 304 324 /* 305 325 * INTERNAL: -
pjproject/trunk/pjmedia/src/pjmedia/rtp.c
r1481 r1798 162 162 pjmedia_rtp_status *p_seq_st) 163 163 { 164 pjmedia_rtp_session_update2(ses, hdr, p_seq_st, PJ_TRUE); 165 } 166 167 PJ_DEF(void) pjmedia_rtp_session_update2( pjmedia_rtp_session *ses, 168 const pjmedia_rtp_hdr *hdr, 169 pjmedia_rtp_status *p_seq_st, 170 pj_bool_t check_pt) 171 { 164 172 pjmedia_rtp_status seq_st; 173 174 /* for now check_pt MUST be either PJ_TRUE or PJ_FALSE. 175 * In the future we might change check_pt from boolean to 176 * unsigned integer to accommodate more flags. 177 */ 178 pj_assert(check_pt==PJ_TRUE || check_pt==PJ_FALSE); 165 179 166 180 /* Init status */ … … 177 191 178 192 /* Check payload type. */ 179 if ( hdr->pt != ses->out_pt) {193 if (check_pt && hdr->pt != ses->out_pt) { 180 194 if (p_seq_st) { 181 195 p_seq_st->status.value = seq_st.status.value; … … 204 218 } 205 219 } 220 206 221 207 222 -
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r1790 r1798 961 961 return; 962 962 963 /* Handle incoming DTMF. */964 if (hdr->pt == stream->rx_event_pt) {965 handle_incoming_dtmf(stream, payload, payloadlen);966 return;967 }968 969 963 /* Update RTP session (also checks if RTP session can accept 970 964 * the incoming packet. 971 965 */ 972 pjmedia_rtp_session_update(&channel->rtp, hdr, &seq_st); 966 pjmedia_rtp_session_update2(&channel->rtp, hdr, &seq_st, 967 hdr->pt != stream->rx_event_pt); 973 968 if (seq_st.status.value) { 974 969 TRC_ ((stream->port.info.name.ptr, … … 996 991 if (payloadlen == 0) 997 992 return; 993 994 /* Handle incoming DTMF. */ 995 if (hdr->pt == stream->rx_event_pt) { 996 /* Ignore out-of-order packet as it will be detected as new 997 * digit. Also ignore duplicate packet as it serves no use. 998 */ 999 if (seq_st.status.flag.outorder || seq_st.status.flag.dup) { 1000 return; 1001 } 1002 1003 handle_incoming_dtmf(stream, payload, payloadlen); 1004 return; 1005 } 998 1006 999 1007 /* Put "good" packet to jitter buffer, or reset the jitter buffer
Note: See TracChangeset
for help on using the changeset viewer.