Ignore:
Timestamp:
Nov 1, 2013 7:11:48 AM (11 years ago)
Author:
bennylp
Message:

Re #1519: Major change in pjsua2.i and etc after actual test in Python:

  • Major changes in SWIG interface file (pjsua2.i).
    • The "ignore" and "unignore" approach caused link error with vector (duplicate symbols because SWIG generates two identical vector functions in the wrapper) so it cannot be used (tried with many combinations and still doesn't work).
    • So scrap that, and now we use "importing" approach, where needed symbols must be listed in symbols.lst file, then use importsym.py to import the symbol declarations to symbols.i. Then include symbols.i in pjsua.i
    • Due to the way importsym.py work, some macros and naked constants need to be placed into a named enumeration, for example:
      • #define PJ_SUCCESS 0 ==> enum pj_constants_ { PJ_SUCCESS=0 }; [types.h]
      • enum { PJMEDIA_VID_DEFAULT_CAPTURE_DEV = -1 } ==> enum pjmedia_vid_dev_std_index { PJMEDIA_VID_DEFAULT_CAPTURE_DEV = -1 }; [videodev.h]
    • Makefile was changed so that symbols.i would be generated if symbols.lst has changed
  • Added "make install" and "make uninstall" targets for swig. Only implemented on Python. This will install to user's lib dir so doesn't need sudo.
  • Deleted approachX.hpp files
  • Added libVersion() method to Endpoint along with Version struct.
  • Fix pjsua2.i to make exception (or redirection?) works in Python
  • Add polling and worker thread related API:
    • PJSUA-LIB: pjsua_register_worker_thread(), pjsua_stop_worker_threads()
    • Endpoint: libRegisterWorkerThread(), libStopWorkerThreads(), libHandleEvents();
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/pjsua2/pjsip/include/pjsua2/types.hpp

    r4638 r4639  
    7171 
    7272/* 
    73  * Forward declaration of Account, AccountConfig, to be used 
     73 * Forward declaration of Account to be used 
    7474 * by Endpoint. 
    7575 */ 
    7676class Account; 
    77 class AccountConfig; 
    7877 
    7978 
     
    143142 
    144143#   define PJSUA2_RAISE_ERROR3(status,op,txt)   \ 
    145         throw Error(status, op, txt, __FILE__, __LINE__) 
     144        do { \ 
     145            Error err_ = Error(status, op, txt, __FILE__, __LINE__); \ 
     146            PJ_LOG(1,(THIS_FILE, "%s", err_.info().c_str())); \ 
     147            throw err_; \ 
     148        } while (0) 
    146149 
    147150#else 
     
    153156 
    154157#   define PJSUA2_RAISE_ERROR3(status,op,txt)   \ 
    155         throw Error(status, op, txt, string(), 0) 
     158        do { \ 
     159            Error err_ = Error(status, op, txt, string(), 0); \ 
     160            PJ_LOG(1,(THIS_FILE, "%s", err_.info().c_str())); \ 
     161            throw err_; \ 
     162        } while (0) 
    156163 
    157164#endif 
     
    159166#define PJSUA2_CHECK_RAISE_ERROR2(status, op)   \ 
    160167        do { \ 
    161             if (status != PJ_SUCCESS) \ 
     168            if (status != PJ_SUCCESS) { \ 
    162169                PJSUA2_RAISE_ERROR2(status, op); \ 
     170            } \ 
    163171        } while (0) 
    164172 
     
    171179            PJSUA2_CHECK_RAISE_ERROR2(the_status, #expr); \ 
    172180        } while (0) 
     181 
     182////////////////////////////////////////////////////////////////////////////// 
     183 
     184struct Version 
     185{ 
     186    /** Major number */ 
     187    int         major; 
     188 
     189    /** Minor number */ 
     190    int         minor; 
     191 
     192    /** Additional revision number */ 
     193    int         rev; 
     194 
     195    /** Version suffix (e.g. "-svn") */ 
     196    string      suffix; 
     197 
     198    /** The full version info (e.g. "2.1.0-svn") */ 
     199    string      full; 
     200 
     201    /** 
     202     * PJLIB version number as three bytes with the following format: 
     203     * 0xMMIIRR00, where MM: major number, II: minor number, RR: revision 
     204     * number, 00: always zero for now. 
     205     */ 
     206    unsigned    numeric; 
     207}; 
    173208 
    174209////////////////////////////////////////////////////////////////////////////// 
     
    232267                 const int data_type, 
    233268                 const string data); 
    234 }; 
    235  
    236 /** Array of SIP credentials */ 
    237 typedef std::vector<AuthCredInfo> AuthCredInfoVector; 
     269 
     270}; 
     271 
    238272 
    239273////////////////////////////////////////////////////////////////////////////// 
Note: See TracChangeset for help on using the changeset viewer.