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/include/pjsua2/endpoint.hpp

    r4638 r4639  
    598598 
    599599    /** 
     600     * Get library version. 
     601     */ 
     602    Version libVersion() const; 
     603 
     604    /** 
    600605     * Instantiate pjsua application. Application must call this function before 
    601606     * calling any other functions, to make sure that the underlying libraries 
     
    629634     */ 
    630635    void libStart() throw(Error); 
     636 
     637    /** 
     638     * Register a thread to poll for events. This function should be 
     639     * called by an external worker thread, and it will block polling 
     640     * for events until the library is destroyed. 
     641     */ 
     642    void libRegisterWorkerThread(const string &name) throw(Error); 
     643 
     644    /** 
     645     * Stop all worker threads. 
     646     */ 
     647    void libStopWorkerThreads(); 
     648 
     649    /** 
     650     * Poll pjsua for events, and if necessary block the caller thread for 
     651     * the specified maximum interval (in miliseconds). 
     652     * 
     653     * Application doesn't normally need to call this function if it has 
     654     * configured worker thread (\a thread_cnt field) in pjsua_config 
     655     * structure, because polling then will be done by these worker threads 
     656     * instead. 
     657     * 
     658     * @param msec_timeout Maximum time to wait, in miliseconds. 
     659     * 
     660     * @return          The number of events that have been handled during the 
     661     *                  poll. Negative value indicates error, and application 
     662     *                  can retrieve the error as (status = -return_value). 
     663     */ 
     664    int libHandleEvents(unsigned msec_timeout); 
    631665 
    632666    /** 
     
    641675     * keep track of it's state. 
    642676     * 
    643      * @param prmFlags          Combination of pjsua_destroy_flag enumeration. 
     677     * @param prmFlags  Combination of pjsua_destroy_flag enumeration. 
    644678     */ 
    645679    void libDestroy(unsigned prmFlags=0) throw(Error); 
Note: See TracChangeset for help on using the changeset viewer.