Ignore:
Timestamp:
Mar 8, 2018 2:01:26 AM (2 years ago)
Author:
ming
Message:

Fixed #865: More clever RTP transport remote address switch

The summary of changes:

  • To solve no 2:

Add callback rtp_cb2(pjmedia_tp_cb_param *param) which allows application to get more info from the media transport, such as the packet's source address.

  • To solve no 3:

Add compile time option PJMEDIA_TRANSPORT_SWITCH_REMOTE_ADDR (by default enabled). Currently, there are already runtime options PJMEDIA_UDP_NO_SRC_ADDR_CHECKING and PJMEDIA_ICE_NO_SRC_ADDR_CHECKING, but there are a few drawbacks:

  • the options are not exported to the higher level, such as stream, or pjsua.
  • the options are separate for each transport, UDP and ICE, there's no single option to do this.
  • To solve no 1:

Using the new rtp_cb2() callback, move the functionality to check the packet's source address to the stream/video stream.
By checking the RTP pt and SSRC, there are a few advantages:

  • When receiving packets from multiple sources, stream can choose the packet with the correct SSRC as advertised from the SDP, and discard the others (see also ticket #1366).
  • If remote address switch is enabled, a faster switch can be achieved as soon as packet with correct ssrc is received, instead of waiting for several consecutive packets (according to setting PJMEDIA_RTP_NAT_PROBATION_CNT).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/config.h

    r5702 r5752  
    11081108 
    11091109 
     1110/* Setting to determine if media transport should switch RTP and RTCP 
     1111 * remote address to the source address of the packets it receives. 
     1112 * 
     1113 * By default it is enabled. 
     1114 */ 
     1115#ifndef PJMEDIA_TRANSPORT_SWITCH_REMOTE_ADDR 
     1116#   define PJMEDIA_TRANSPORT_SWITCH_REMOTE_ADDR     1 
     1117#endif 
     1118 
     1119 
    11101120/** 
    11111121 * Transport info (pjmedia_transport_info) contains a socket info and list 
Note: See TracChangeset for help on using the changeset viewer.