Ignore:
Timestamp:
Sep 21, 2011 10:20:01 AM (13 years ago)
Author:
ming
Message:

Re #1266: Asynchronous media transport creation

  • Add feature that allows ICE media transport to be created asynchronously.
  • Add new callback, e.g. on_call_media_transport_state(call_id, state_struct) to report media transport status.
  • Handle outgoing calls while creating media transport asynchronously.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r3756 r3763  
    462462                                                 registration callback. */ 
    463463} pjsua_reg_info; 
     464 
     465 
     466/**  
     467 * Enumeration of media transport state types. 
     468 */ 
     469typedef enum pjsua_med_tp_st 
     470{ 
     471    /** Null, this is the state before media transport is created. */ 
     472    PJSUA_MED_TP_NULL, 
     473 
     474    /** 
     475     * Just before media transport is created, which can finish 
     476     * asynchronously later. 
     477     */ 
     478    PJSUA_MED_TP_CREATING, 
     479 
     480    /** Media transport creation is completed, but not initialized yet. */ 
     481    PJSUA_MED_TP_IDLE, 
     482 
     483    /** Initialized (media_create() has been called). */ 
     484    PJSUA_MED_TP_INIT, 
     485 
     486    /** Running (media_start() has been called). */ 
     487    PJSUA_MED_TP_RUNNING, 
     488 
     489    /** Disabled (transport is initialized, but media is being disabled). */ 
     490    PJSUA_MED_TP_DISABLED 
     491 
     492} pjsua_med_tp_st; 
     493 
     494 
     495/** 
     496 * Structure to be passed on media transport state callback. 
     497 */ 
     498typedef struct pjsua_med_tp_state_info 
     499{ 
     500    /** 
     501     * The media index. 
     502     */ 
     503    unsigned             med_idx; 
     504 
     505    /** 
     506     * The media transport state 
     507     */ 
     508    pjsua_med_tp_st      state; 
     509 
     510    /** 
     511     * The last error code related to the media transport state. 
     512     */ 
     513    pj_status_t          status; 
     514 
     515    /** 
     516     * Optional SIP error code. 
     517     */ 
     518    int                  sip_err_code; 
     519 
     520    /** 
     521     * Optional extended info, the content is specific for each transport type. 
     522     */ 
     523    void                *ext_info; 
     524 
     525} pjsua_med_tp_state_info; 
     526 
     527 
     528/** 
     529  * Type of callback to be called when media transport state is changed. 
     530  * 
     531  * @param call_id      The call ID. 
     532  * @param info         The media transport state info. 
     533  */ 
     534typedef void (*pjsua_med_tp_state_cb)(pjsua_call_id call_id, 
     535                                      const pjsua_med_tp_state_info *info); 
    464536 
    465537 
     
    9501022 
    9511023    /** 
     1024     * This callback is called when media transport state is changed. See 
     1025     * also #pjsua_med_tp_state_cb. 
     1026     */ 
     1027    pjsua_med_tp_state_cb on_call_media_transport_state; 
     1028 
     1029    /** 
    9521030     * This callback is called to report error in ICE media transport. 
    9531031     * Currently it is used to report TURN Refresh error. 
     
    13631441 */ 
    13641442PJ_DECL(void) pjsua_msg_data_init(pjsua_msg_data *msg_data); 
     1443 
     1444 
     1445/** 
     1446 * Clone message data. 
     1447 * 
     1448 * @param pool      Pool to allocate memory for the new message data. 
     1449 * @param rhs       Message data to be cloned. 
     1450 * 
     1451 * @return          The new message data. 
     1452 */ 
     1453PJ_DECL(pjsua_msg_data*) pjsua_msg_data_clone(pj_pool_t *pool, 
     1454                                              const pjsua_msg_data *rhs); 
    13651455 
    13661456 
Note: See TracChangeset for help on using the changeset viewer.