Changeset 4918


Ignore:
Timestamp:
Sep 9, 2014 4:10:59 AM (10 years ago)
Author:
ming
Message:

Fixed #1784: Remove the usage of nested structs/unions in PJSUA2 (unsupported by SWIG C++)

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua2/call.hpp

    r4780 r4918  
    102102    MathStat        lossPeriodUsec; /**< Loss period statistics             */ 
    103103 
    104     struct { 
    105         unsigned    burst;      /**< Burst/sequential packet lost detected  */ 
    106         unsigned    random;     /**< Random packet lost detected.           */ 
    107     } lossType;                 /**< Types of loss detected.                */ 
     104                                /**< Types of loss detected.                */ 
     105    unsigned        burst;      /**< Burst/sequential packet lost detected  */ 
     106    unsigned        random;     /**< Random packet lost detected.           */ 
    108107     
    109108    MathStat        jitterUsec; /**< Jitter statistics                      */ 
     
    238237 
    239238/** 
     239 * Media event data. 
     240 */ 
     241typedef union MediaEventData { 
     242    /** 
     243     * Media format changed event data. 
     244     */ 
     245    MediaFmtChangedEvent    fmtChanged; 
     246     
     247    /** 
     248     * Pointer to storage to user event data, if it's outside 
     249     * this struct 
     250     */ 
     251    GenericData         ptr; 
     252 
     253} MediaEventData; 
     254 
     255/** 
    240256 * This structure describes a media event. It corresponds to the 
    241257 * pjmedia_event structure. 
     
    252268     * will be specific to the event type being reported. 
    253269     */ 
    254     union { 
    255         /** 
    256          * Media format changed event data. 
    257          */ 
    258         MediaFmtChangedEvent    fmtChanged; 
    259          
    260         /** 
    261          * Pointer to storage to user event data, if it's outside 
    262          * this struct 
    263          */ 
    264         GenericData             ptr; 
    265     } data; 
     270    MediaEventData              data; 
    266271     
    267272    /** 
  • pjproject/trunk/pjsip/include/pjsua2/siptypes.hpp

    r4704 r4918  
    525525 
    526526/** 
     527 * This structure describes transaction state event source. 
     528 */ 
     529struct TsxStateEventSrc 
     530{ 
     531    SipRxData       rdata;          /**< The incoming message.      */ 
     532    SipTxData       tdata;          /**< The outgoing message.      */ 
     533    TimerEntry      timer;          /**< The timer.                 */ 
     534    pj_status_t     status;         /**< Transport error status.    */ 
     535    GenericData     data;           /**< Generic data.              */ 
     536}; 
     537 
     538/** 
    527539 * This structure describes transaction state changed event. 
    528540 */ 
    529541struct TsxStateEvent 
    530542{ 
    531     struct 
    532     { 
    533         SipRxData       rdata;          /**< The incoming message.      */ 
    534         SipTxData       tdata;          /**< The outgoing message.      */ 
    535         TimerEntry      timer;          /**< The timer.                 */ 
    536         pj_status_t     status;         /**< Transport error status.    */ 
    537         GenericData     data;           /**< Generic data.              */ 
    538     } src;                              /**< Event source.              */ 
     543    TsxStateEventSrc    src;            /**< Event source.              */ 
    539544    SipTransaction      tsx;            /**< The transaction.           */ 
    540545    pjsip_tsx_state_e   prevState;      /**< Previous state.            */ 
     
    585590 
    586591/** 
     592 * The event body. 
     593 */ 
     594struct SipEventBody 
     595{ 
     596    /** 
     597     * Timer event. 
     598     */ 
     599    TimerEvent      timer; 
     600     
     601    /** 
     602     * Transaction state has changed event. 
     603     */ 
     604    TsxStateEvent   tsxState; 
     605     
     606    /** 
     607     * Message transmission event. 
     608     */ 
     609    TxMsgEvent      txMsg; 
     610     
     611    /** 
     612     * Transmission error event. 
     613     */ 
     614    TxErrorEvent    txError; 
     615     
     616    /** 
     617     * Message arrival event. 
     618     */ 
     619    RxMsgEvent      rxMsg; 
     620     
     621    /** 
     622     * User event. 
     623     */ 
     624    UserEvent       user; 
     625     
     626}; 
     627 
     628/** 
    587629 * This structure describe event descriptor to fully identify a SIP event. It 
    588630 * corresponds to the pjsip_event structure in PJSIP library. 
     
    598640     * The event body, which fields depends on the event type. 
    599641     */ 
    600     struct 
    601     { 
    602         /** 
    603          * Timer event. 
    604          */ 
    605         TimerEvent      timer; 
    606          
    607         /** 
    608          * Transaction state has changed event. 
    609          */ 
    610         TsxStateEvent   tsxState; 
    611          
    612         /** 
    613          * Message transmission event. 
    614          */ 
    615         TxMsgEvent      txMsg; 
    616          
    617         /** 
    618          * Transmission error event. 
    619          */ 
    620         TxErrorEvent    txError; 
    621          
    622         /** 
    623          * Message arrival event. 
    624          */ 
    625         RxMsgEvent      rxMsg; 
    626          
    627         /** 
    628          * User event. 
    629          */ 
    630         UserEvent       user; 
    631          
    632     } body; 
     642    SipEventBody        body; 
    633643     
    634644    /** 
  • pjproject/trunk/pjsip/src/pjsua2/call.cpp

    r4885 r4918  
    5757    this->dup             = prm.dup; 
    5858    this->lossPeriodUsec.fromPj(prm.loss_period); 
    59     this->lossType.burst  = prm.loss_type.burst; 
    60     this->lossType.random = prm.loss_type.random; 
     59    this->burst           = prm.loss_type.burst; 
     60    this->random          = prm.loss_type.random; 
    6161    this->jitterUsec.fromPj(prm.jitter); 
    6262} 
Note: See TracChangeset for help on using the changeset viewer.