Ignore:
Timestamp:
Nov 1, 2013 7:11:48 AM (10 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/src/pjsua2/endpoint.cpp

    r4638 r4639  
    545545 * Endpoint library operations 
    546546 */ 
     547Version Endpoint::libVersion() const 
     548{ 
     549    Version ver; 
     550    ver.major = PJ_VERSION_NUM_MAJOR; 
     551    ver.minor = PJ_VERSION_NUM_MINOR; 
     552    ver.rev = PJ_VERSION_NUM_REV; 
     553    ver.suffix = PJ_VERSION_NUM_EXTRA; 
     554    ver.full = pj_get_version(); 
     555    ver.numeric = PJ_VERSION_NUM; 
     556    return ver; 
     557} 
     558 
    547559void Endpoint::libCreate() throw(Error) 
    548560{ 
     
    594606} 
    595607 
     608void Endpoint::libRegisterWorkerThread(const string &name) throw(Error) 
     609{ 
     610    PJSUA2_CHECK_EXPR(pjsua_register_worker_thread(name.c_str())); 
     611} 
     612 
     613void Endpoint::libStopWorkerThreads() 
     614{ 
     615    pjsua_stop_worker_threads(); 
     616} 
     617 
     618int Endpoint::libHandleEvents(unsigned msec_timeout) 
     619{ 
     620    return pjsua_handle_events(msec_timeout); 
     621} 
     622 
    596623void Endpoint::libDestroy(unsigned flags) throw(Error) 
    597624{ 
Note: See TracChangeset for help on using the changeset viewer.