Ignore:
Timestamp:
May 15, 2019 12:09:57 AM (5 years ago)
Author:
ming
Message:

Fixed #2107: Add option to use loopback media transport in pjsua

File:
1 edited

Legend:

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

    r3553 r5989  
    5151 
    5252/** 
     53 * Settings to be given when creating loopback media transport. Application 
     54 * should call #pjmedia_loop_tp_setting_default() to initialize this 
     55 * structure with its default values. 
     56 */ 
     57typedef struct pjmedia_loop_tp_setting 
     58{ 
     59    /* Address family, which can be pj_AF_INET() for IPv4 or 
     60     * pj_AF_INET6() for IPv6. Default is IPv4 (pj_AF_INET()). 
     61     */ 
     62    int         af; 
     63 
     64    /* Optional local address which will be returned in the transport info. 
     65     * If the string is empty, the address will be the default loopback 
     66     * address (127.0.0.1 or ::1). 
     67     * 
     68     * Note that the address is used for info purpose only and no actual 
     69     * resource will be allocated. 
     70     * 
     71     * Default is empty string. 
     72     */ 
     73    pj_str_t    addr; 
     74 
     75    /* The port number for the RTP socket. The RTCP port number will be 
     76     * set to one above RTP port. If zero, it will use the default port 
     77     * number (4000). 
     78     * 
     79     * Note that no actual port will be allocated. Default is 4000. 
     80     */ 
     81    int         port; 
     82     
     83    /* Setting whether attached streams will receive incoming packets. 
     84     * Application can further customize the setting of a particular setting 
     85     * using the API pjmedia_transport_loop_disable_rx(). 
     86     * 
     87     * Default: PJ_FALSE; 
     88     */ 
     89    pj_bool_t   disable_rx; 
     90 
     91} pjmedia_loop_tp_setting; 
     92 
     93 
     94/** 
     95 * Initialize loopback media transport setting with its default values. 
     96 * 
     97 * @param opt   SRTP setting to be initialized. 
     98 */ 
     99PJ_DECL(void) pjmedia_loop_tp_setting_default(pjmedia_loop_tp_setting *opt); 
     100 
     101 
     102/** 
    53103 * Create the loopback transport. 
    54104 * 
     
    63113 
    64114/** 
    65  * Set this stream as the receiver of incoming packets. 
     115 * Create the loopback transport. 
     116 * 
     117 * @param endpt     The media endpoint instance. 
     118 * @param opt       Optional settings. If NULL is given, default 
     119 *                  settings will be used. 
     120 * @param p_tp      Pointer to receive the transport instance. 
     121 * 
     122 * @return          PJ_SUCCESS on success. 
     123 */ 
     124PJ_DECL(pj_status_t) 
     125pjmedia_transport_loop_create2(pjmedia_endpt *endpt, 
     126                               const pjmedia_loop_tp_setting *opt, 
     127                               pjmedia_transport **p_tp); 
     128 
     129 
     130/** 
     131 * Set the configuration of whether a stream will become the receiver of 
     132 * incoming packets. 
     133 * 
     134 * @param tp        The transport. 
     135 * @param user      The stream. 
     136 * @param disabled  PJ_TRUE to disable the receiving of packets, or 
     137 *                  PJ_FALSE to enable it. 
    66138 */ 
    67139PJ_DECL(pj_status_t) pjmedia_transport_loop_disable_rx(pjmedia_transport *tp, 
Note: See TracChangeset for help on using the changeset viewer.