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/pjsua-lib/pjsua.h

    r4592 r4639  
    252252 
    253253/** Constant to identify invalid ID for all sorts of IDs. */ 
    254 #define PJSUA_INVALID_ID            (-1) 
     254enum pjsua_invalid_id_const_ 
     255{ 
     256    PJSUA_INVALID_ID = -1 
     257}; 
    255258 
    256259/** Disabled features temporarily for media reorganization */ 
     
    18811884 
    18821885/** 
     1886 * Register a thread to poll for events. This function should be 
     1887 * called by an external worker thread, and it will block polling 
     1888 * for events until the library is destroyed. 
     1889 * 
     1890 * @return              PJ_SUCCESS if things are working correctly 
     1891 *                      or an error polling cannot be done for some 
     1892 *                      reason. 
     1893 */ 
     1894PJ_DECL(pj_status_t) pjsua_register_worker_thread(const char *name); 
     1895 
     1896 
     1897/** 
     1898 * Signal all worker threads to quit. This will only wait until internal 
     1899 * threads are done. For external threads, application must perform 
     1900 * its own waiting for the external threads to quit from 
     1901 * pjsua_register_worker_thread() function. 
     1902 */ 
     1903PJ_DECL(void) pjsua_stop_worker_threads(void); 
     1904 
     1905/** 
    18831906 * Create memory pool to be used by the application. Once application 
    18841907 * finished using the pool, it must be released with pj_pool_release(). 
Note: See TracChangeset for help on using the changeset viewer.