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-apps/src/swig/python/Makefile

    r4619 r4639  
    11PYTHON_SO=_pjsua2.so 
    22 
    3 PYTHON_SETUP_FLAGS = --inplace  
     3#PYTHON_SETUP_FLAGS = --inplace  
    44ifeq ($(OS),Windows_NT) 
    55  PYTHON_SETUP_FLAGS += --compiler=mingw32 
    66endif 
    77 
    8 .PHONY: all 
     8SWIG_FLAGS += -w312 
     9 
     10.PHONY: all install uninstall 
    911 
    1012all: $(PYTHON_SO) 
    1113 
    1214$(PYTHON_SO): pjsua2_wrap.cpp setup.py 
    13         python setup.py build_ext $(PYTHON_SETUP_FLAGS) 
     15        python setup.py build $(PYTHON_SETUP_FLAGS) 
    1416 
    15 pjsua2_wrap.cpp: ../pjsua2.i $(SRCS) 
     17pjsua2_wrap.cpp: ../pjsua2.i ../symbols.i Makefile $(SRCS) 
    1618        swig $(SWIG_FLAGS) -python  -o pjsua2_wrap.cpp ../pjsua2.i 
    1719 
    1820clean distclean realclean: 
    1921        rm -rf $(PYTHON_SO) pjsua2_wrap.cpp pjsua2_wrap.h pjsua2.py build *.pyc 
     22 
     23install: 
     24        python setup.py install --user 
     25 
     26uninstall: 
     27        rm -f $(HOME)/.local/lib/python2.7/site-packages/pjsua2* 
     28        rm -f $(HOME)/.local/lib/python2.7/site-packages/_pjsua2* 
     29 
Note: See TracChangeset for help on using the changeset viewer.