Changeset 2506 for pjproject/trunk
- Timestamp:
- Mar 12, 2009 6:11:37 PM (16 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 9 deleted
- 68 edited
- 27 copied
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk
-
Property
svn:mergeinfo
set to
False
/pjproject/branches/projects/aps-direct merged eligible
-
Property
svn:mergeinfo
set to
False
-
pjproject/trunk/Makefile
r2037 r2506 34 34 pjnath/lib/libpjnath-$(TARGET_NAME).a \ 35 35 pjmedia/lib/libpjmedia-$(TARGET_NAME).a \ 36 pjmedia/lib/libpjmedia-audiodev-$(TARGET_NAME).a \ 36 37 pjmedia/lib/libpjmedia-codec-$(TARGET_NAME).a \ 37 38 pjsip/lib/libpjsip-$(TARGET_NAME).a \ -
pjproject/trunk/build.mak.in
r2232 r2506 61 61 -lpjmedia-codec-$(TARGET_NAME)\ 62 62 -lpjmedia-$(TARGET_NAME)\ 63 -lpjmedia-audiodev-$(TARGET_NAME)\ 63 64 -lpjnath-$(TARGET_NAME)\ 64 65 -lpjlib-util-$(TARGET_NAME)\ -
pjproject/trunk/build.symbian/bld.inf
r2174 r2506 1 #define SND_USE_NULL 02 #define SND_USE_APS 03 4 1 prj_platforms 5 2 winscw … … 24 21 libgsmcodec.mmp 25 22 libspeexcodec.mmp 23 libpassthroughcodec.mmp 26 24 27 /* Sound device impl */ 28 #if SND_USE_NULL 29 null_audio.mmp 30 #elif SND_USE_APS 31 symbian_audio_aps.mmp 32 #else 33 symbian_audio.mmp 34 #endif 25 /* Audio device. */ 26 pjmedia_audiodev.mmp 35 27 36 28 /* Applications */ -
pjproject/trunk/build.symbian/pjlib.mmp
r1962 r2506 19 19 20 20 SOURCEPATH ..\pjlib\src\pj 21 22 OPTION CW -lang c++23 OPTION ARMCC --cpp24 OPTION GCC -x c++25 21 26 22 MACRO PJ_M_I386=1 -
pjproject/trunk/build.symbian/pjlib_test.mmp
r2139 r2506 15 15 STATICLIBRARY pjlib.lib 16 16 #endif 17 18 OPTION CW -lang c++19 OPTION ARMCC --cpp20 OPTION GCC -x c++21 17 22 18 // Test files -
pjproject/trunk/build.symbian/pjlib_util.mmp
r1987 r2506 22 22 MACRO PJ_M_I386=1 23 23 MACRO PJ_SYMBIAN=1 24 25 OPTION CW -lang c++26 OPTION ARMCC --cpp27 OPTION GCC -x c++28 24 29 25 // -
pjproject/trunk/build.symbian/pjmedia.mmp
r2262 r2506 41 41 SOURCE codec.c 42 42 SOURCE conference.c 43 SOURCE conf_switch.c 43 44 SOURCE echo_common.c 44 45 SOURCE echo_port.c -
pjproject/trunk/build.symbian/pjnath.mmp
r1988 r2506 22 22 MACRO PJ_M_I386=1 23 23 MACRO PJ_SYMBIAN=1 24 25 OPTION CW -lang c++26 OPTION ARMCC --cpp27 OPTION GCC -x c++28 24 29 25 // -
pjproject/trunk/build.symbian/pjsdp.mmp
r1640 r2506 20 20 SOURCEPATH ..\pjmedia\src\pjmedia 21 21 22 OPTION CW -lang c++23 OPTION ARMCC --cpp24 OPTION GCC -x c++25 26 22 MACRO PJ_M_I386=1 27 23 MACRO PJ_SYMBIAN=1 -
pjproject/trunk/build.symbian/pjsip.mmp
r1818 r2506 25 25 MACRO PJ_M_I386=1 26 26 MACRO PJ_SYMBIAN=1 27 28 OPTION CW -lang c++29 OPTION ARMCC --cpp30 OPTION GCC -x c++31 27 32 28 // PJSIP-CORE files -
pjproject/trunk/build.symbian/pjsip_simple.mmp
r1640 r2506 26 26 MACRO PJ_SYMBIAN=1 27 27 28 OPTION CW -lang c++29 OPTION ARMCC --cpp30 OPTION GCC -x c++31 32 33 28 // PJSIP-SIMPLE files 34 29 -
pjproject/trunk/build.symbian/pjstun_client.mmp
r1640 r2506 7 7 MACRO PJ_M_I386=1 8 8 MACRO PJ_SYMBIAN=1 9 10 OPTION CW -lang c++11 OPTION ARMCC --cpp12 OPTION GCC -x c++13 9 14 10 // PJSTUN-CLIENT files -
pjproject/trunk/build.symbian/symbian_audio.mmp
r1965 r2506 25 25 26 26 OPTION CW -lang c++ 27 28 //29 // GCCE optimization setting30 //31 27 OPTION GCCE -O2 -fno-unit-at-a-time 32 28 … … 34 30 MACRO PJ_SYMBIAN=1 35 31 32 SOURCE nullsound.c 36 33 SOURCE symbian_sound.cpp 34 SOURCE symbian_sound_aps.cpp 37 35 38 36 SYSTEMINCLUDE ..\pjlib\include … … 41 39 SYSTEMINCLUDE \epoc32\include 42 40 SYSTEMINCLUDE \epoc32\include\libc 41 SYSTEMINCLUDE \epoc32\include\mmf\server 42 SYSTEMINCLUDE \epoc32\include\mmf\common 43 SYSTEMINCLUDE \epoc32\include\mda\common 43 44 44 45 SYSTEMINCLUDE \epoc32\include\mmf\plugin -
pjproject/trunk/build.symbian/symbian_ua.mmp
r2384 r2506 1 #define SND_USE_NULL 0 2 #define SND_USE_APS 0 1 #define SND_HAS_APS 0 2 #define SND_HAS_VAS 0 3 #define SND_HAS_MDA 1 3 4 4 TARGET symbian_ua.exe5 TARGETTYPE exe6 UID 0x0 0xA000000D5 TARGET symbian_ua.exe 6 TARGETTYPE exe 7 UID 0x0 0x200235D3 7 8 8 SOURCEPATH ..\pjsip-apps\src\symbian_ua9 SOURCEPATH ..\pjsip-apps\src\symbian_ua 9 10 10 MACRO PJ_M_I386=111 MACRO PJ_SYMBIAN=111 MACRO PJ_M_I386=1 12 MACRO PJ_SYMBIAN=1 12 13 13 14 // Source files 14 15 15 SOURCE ua.cpp16 SOURCE main_symbian.cpp16 SOURCE ua.cpp 17 SOURCE main_symbian.cpp 17 18 18 DOCUMENT ua.h19 DOCUMENT ua.h 19 20 20 START RESOURCE symbian_ua_reg.rss21 START RESOURCE symbian_ua_reg.rss 21 22 TARGETPATH \private\10003a3f\apps 22 23 END 23 24 24 SYSTEMINCLUDE ..\pjlib\include25 SYSTEMINCLUDE ..\pjlib-util\include26 SYSTEMINCLUDE ..\pjnath\include27 SYSTEMINCLUDE ..\pjmedia\include28 SYSTEMINCLUDE ..\pjsip\include25 SYSTEMINCLUDE ..\pjlib\include 26 SYSTEMINCLUDE ..\pjlib-util\include 27 SYSTEMINCLUDE ..\pjnath\include 28 SYSTEMINCLUDE ..\pjmedia\include 29 SYSTEMINCLUDE ..\pjsip\include 29 30 30 SYSTEMINCLUDE \epoc32\include31 SYSTEMINCLUDE \epoc32\include\libc31 SYSTEMINCLUDE \epoc32\include 32 SYSTEMINCLUDE \epoc32\include\libc 32 33 33 STATICLIBRARY pjsua_lib.lib pjsip_ua.lib 34 STATICLIBRARY pjsip_simple.lib pjsip.lib pjsdp.lib pjmedia.lib 35 STATICLIBRARY pjnath.lib pjlib_util.lib pjlib.lib 36 STATICLIBRARY libsrtp.lib 37 STATICLIBRARY libgsmcodec.lib libspeexcodec.lib 34 STATICLIBRARY pjsua_lib.lib pjsip_ua.lib 35 STATICLIBRARY pjsip_simple.lib pjsip.lib pjsdp.lib pjmedia.lib 36 STATICLIBRARY pjnath.lib pjlib_util.lib pjlib.lib 37 STATICLIBRARY libsrtp.lib 38 STATICLIBRARY libgsmcodec.lib libspeexcodec.lib 39 STATICLIBRARY libpassthroughcodec.lib 40 STATICLIBRARY pjmedia_audiodev.lib 38 41 39 #if SND_USE_NULL 40 STATICLIBRARY null_audio.lib 41 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment 42 #elif SND_USE_APS 43 STATICLIBRARY symbian_audio_aps.lib 44 LIBRARY APSSession2.lib 45 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment MultimediaDD 46 MACRO PJMEDIA_SYM_SND_USE_APS=1 47 #else 48 STATICLIBRARY symbian_audio.lib 49 LIBRARY mediaclientaudiostream.lib 50 LIBRARY mediaclientaudioinputstream.lib 51 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment 42 #if SND_HAS_APS 43 LIBRARY APSSession2.lib 52 44 #endif 53 45 46 #if SND_HAS_VAS 47 // LIBRARY 48 #endif 49 50 #if SND_HAS_MDA 51 LIBRARY mediaclientaudiostream.lib 52 LIBRARY mediaclientaudioinputstream.lib 53 #endif 54 55 #if SND_HAS_APS || SND_HAS_VAS 56 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment MultimediaDD 57 #else 58 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment 59 #endif 60 54 61 #ifdef WINSCW 55 62 STATICLIBRARY eexe.lib ecrt0.lib 56 63 #endif 57 64 58 LIBRARY esock.lib insock.lib charconv.lib euser.lib estlib.lib commdb.lib apengine.lib65 LIBRARY esock.lib insock.lib charconv.lib euser.lib estlib.lib commdb.lib apengine.lib 59 66 60 67 // The default 8KB seems to be insufficient with all bells and 61 68 // whistles turned on 62 EPOCSTACKSIZE 1228869 EPOCSTACKSIZE 12288 63 70 -
pjproject/trunk/build.symbian/symbian_ua_udeb.pkg
r1687 r2506 1 ; symbian_ua.pkg 1 ; symbian_ua_udeb.pkg 2 3 ; for Carbide development, please use symbian_ua.pkg for comfortness 4 ; (epoc32 path, platform, and target are set automatically using env vars) 2 5 3 6 ; Languages … … 5 8 6 9 ; Header 7 #{"symbian_ua"},(0x A000000D), 0, 1, 110 #{"symbian_ua"},(0x200235D3), 0, 1, 1 8 11 9 12 ; Platform compatibility … … 15 18 16 19 ; Target 17 "C:\Symbian\9. 1\S60_3rd_MR\epoc32\release\gcce\UDEB\symbian_ua.exe"-"!:\sys\bin\symbian_ua.exe"18 "C:\Symbian\9. 1\S60_3rd_MR\epoc32\data\z\private\10003a3f\apps\symbian_ua_reg.rSC"-"!:\private\10003a3f\import\apps\symbian_ua_reg.rSC"20 "C:\Symbian\9.2\S60_3rd_FP1\epoc32\release\gcce\UDEB\symbian_ua.exe"-"!:\sys\bin\symbian_ua.exe" 21 "C:\Symbian\9.2\S60_3rd_FP1\epoc32\data\z\private\10003a3f\apps\symbian_ua_reg.rSC"-"!:\private\10003a3f\import\apps\symbian_ua_reg.rSC" -
pjproject/trunk/build.symbian/symbian_ua_urel.pkg
r1687 r2506 1 1 ; symbian_ua.pkg 2 3 ; for Carbide development, please use symbian_ua.pkg for comfortness 4 ; (epoc32 path, platform, and target are set automatically using env vars) 2 5 3 6 ; Languages … … 5 8 6 9 ; Header 7 #{"symbian_ua"},(0x A000000D), 0, 1, 110 #{"symbian_ua"},(0x200235D3), 0, 1, 1 8 11 9 12 ; Platform compatibility -
pjproject/trunk/build.symbian/symsndtest.mmp
r2257 r2506 1 #define SND_USE_ NULL 02 #define SND_USE_ APS 01 #define SND_USE_APS 1 2 #define SND_USE_VAS 0 3 3 4 TARGET symsndtest.exe5 TARGETTYPE exe6 UID 0x0 0xA000000E4 TARGET symsndtest.exe 5 TARGETTYPE exe 6 UID 0x0 0xA000000E 7 7 8 SOURCEPATH ..\pjsip-apps\src\symsndtest8 SOURCEPATH ..\pjsip-apps\src\symsndtest 9 9 10 MACRO PJ_M_I386=111 MACRO PJ_SYMBIAN=110 MACRO PJ_M_I386=1 11 MACRO PJ_SYMBIAN=1 12 12 13 13 // Test files 14 14 15 SOURCE app_main.cpp16 SOURCE main_symbian.cpp15 SOURCE app_main.cpp 16 SOURCE main_symbian.cpp 17 17 18 START RESOURCE symsndtest_reg.rss18 START RESOURCE symsndtest_reg.rss 19 19 TARGETPATH \private\10003a3f\apps 20 20 END 21 21 22 SYSTEMINCLUDE ..\pjlib\include23 SYSTEMINCLUDE ..\pjmedia\include22 SYSTEMINCLUDE ..\pjlib\include 23 SYSTEMINCLUDE ..\pjmedia\include 24 24 25 SYSTEMINCLUDE \epoc32\include26 SYSTEMINCLUDE \epoc32\include\libc25 SYSTEMINCLUDE \epoc32\include 26 SYSTEMINCLUDE \epoc32\include\libc 27 27 28 LIBRARY charconv.lib euser.lib estlib.lib 29 LIBRARY esock.lib insock.lib 30 STATICLIBRARY pjlib.lib pjmedia.lib 28 LIBRARY charconv.lib euser.lib estlib.lib 29 LIBRARY esock.lib insock.lib 30 STATICLIBRARY pjlib.lib pjmedia.lib 31 STATICLIBRARY symbian_audio.lib 31 32 32 #if SND_USE_NULL 33 STATICLIBRARY null_audio.lib 34 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment 35 #elif SND_USE_APS 36 SOURCEPATH ..\pjmedia\src\pjmedia 37 SOURCE symbian_sound_aps.cpp 38 39 SYSTEMINCLUDE \epoc32\include\mmf\server 40 SYSTEMINCLUDE \epoc32\include\mmf\common 41 SYSTEMINCLUDE \epoc32\include\mda\common 42 43 //STATICLIBRARY symbian_audio_aps.lib 44 LIBRARY APSSession2.lib 45 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment MultimediaDD 33 #if SND_USE_APS 34 LIBRARY APSSession2.lib 35 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment MultimediaDD 36 #elif SND_USE_VAS 37 // LIBRARY 38 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment MultimediaDD 46 39 #else 47 STATICLIBRARY symbian_audio.lib 48 LIBRARY mediaclientaudiostream.lib 49 LIBRARY mediaclientaudioinputstream.lib 50 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment 40 LIBRARY mediaclientaudiostream.lib 41 LIBRARY mediaclientaudioinputstream.lib 42 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment 51 43 #endif 52 44 -
pjproject/trunk/pjlib/include/pj/compat/os_symbian.h
r2394 r2506 115 115 * Override features. 116 116 */ 117 #define PJ_HAS_FLOATING_POINT 1117 #define PJ_HAS_FLOATING_POINT 0 118 118 #define PJ_HAS_MALLOC 0 119 119 #define PJ_HAS_SEMAPHORE 1 -
pjproject/trunk/pjlib/include/pj/config_site_sample.h
r2381 r2506 1 2 3 //#define PJ_CONFIG_MINIMAL_SIZE 4 //#define PJ_CONFIG_MAXIMUM_SPEED 5 6 7 /* 8 * This file (config_site_sample.h) contains various configuration 9 * settings that I use for certain settings. 1 /* 2 * This file contains several sample settings especially for Windows 3 * Mobile and Symbian targets. You can include this file in your 4 * <pj/config_site.h> file. 5 * 6 * The Windows Mobile and Symbian settings will be activated 7 * automatically if you include this file. 8 * 9 * In addition, you may specify one of these macros (before including 10 * this file) to activate additional settings: 11 * 12 * #define PJ_CONFIG_NOKIA_APS_DIRECT 13 * Use this macro to activate the APS-Direct feature. Please see 14 * http://trac.pjsip.org/repos/wiki/Nokia_APS_VAS_Direct for more 15 * info. 16 * 17 * #define PJ_CONFIG_WIN32_WMME_DIRECT 18 * Configuration to activate "APS-Direct" media mode on Windows or 19 * Windows Mobile, useful for testing purposes only. 10 20 */ 11 21 … … 15 25 */ 16 26 #if defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0 17 # define PJ_HAS_FLOATING_POINT 0 18 19 # define PJMEDIA_HAS_G711_PLC 0 20 //# define PJMEDIA_HAS_SMALL_FILTER 1 21 //# define PJMEDIA_HAS_LARGE_FILTER 0 22 # define PJMEDIA_HAS_L16_CODEC 0 23 /*# define PJMEDIA_HAS_GSM_CODEC 0*/ 24 /*# define PJMEDIA_HAS_ILBC_CODEC 0*/ 25 /*# define PJMEDIA_HAS_SPEEX_CODEC 0*/ 26 # define PJMEDIA_HAS_SPEEX_AEC 0 27 # undef PJMEDIA_RESAMPLE_IMP 28 # define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_LIBRESAMPLE 29 # define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE 30 31 /* Speex default quality settings */ 32 # define PJSUA_DEFAULT_CODEC_QUALITY 5 33 # define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5 34 35 # define PJMEDIA_SDP_NEG_PREFER_REMOTE_CODEC_ORDER 0 36 #endif 27 28 /* 29 * PJLIB settings. 30 */ 31 32 /* Disable floating point support */ 33 #define PJ_HAS_FLOATING_POINT 0 34 35 /* 36 * PJMEDIA settings 37 */ 38 39 /* Select codecs to disable */ 40 #define PJMEDIA_HAS_L16_CODEC 0 41 #define PJMEDIA_HAS_ILBC_CODEC 0 42 43 /* We probably need more buffers on WM, so increase the limit */ 44 #define PJMEDIA_SOUND_BUFFER_COUNT 32 45 46 /* Fine tune Speex's default settings for best performance/quality */ 47 #define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5 48 49 /* For CPU reason, disable speex AEC and use the echo suppressor. */ 50 #define PJMEDIA_HAS_SPEEX_AEC 0 51 52 /* Shouldn't use resampling for performance reason too. */ 53 #define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE 54 55 /* Use the lighter WSOLA implementation */ 56 #define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE 57 58 /* 59 * PJSIP settings. 60 */ 61 62 /* Set maximum number of dialog/transaction/calls to minimum to reduce 63 * memory usage 64 */ 65 #define PJSIP_MAX_TSX_COUNT 31 66 #define PJSIP_MAX_DIALOG_COUNT 31 67 #define PJSUA_MAX_CALLS 4 68 69 /* 70 * PJSUA settings 71 */ 72 73 /* Default codec (Speex) quality */ 74 #define PJSUA_DEFAULT_CODEC_QUALITY 5 75 76 /* Set maximum number of objects to minimum to reduce memory usage */ 77 #define PJSUA_MAX_ACC 4 78 #define PJSUA_MAX_PLAYERS 4 79 #define PJSUA_MAX_RECORDERS 4 80 #define PJSUA_MAX_CONF_PORTS (PJSUA_MAX_CALLS+2*PJSUA_MAX_PLAYERS) 81 #define PJSUA_MAX_BUDDIES 32 82 83 #endif /* PJ_WIN32_WINCE */ 37 84 38 85 … … 42 89 #if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0 43 90 44 /* We don't want to use float, for now */ 45 # undef PJ_HAS_FLOATING_POINT 46 # define PJ_HAS_FLOATING_POINT 0 47 48 # define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_NULL_SOUND 91 /* 92 * PJLIB settings. 93 */ 94 95 /* Disable floating point support */ 96 #define PJ_HAS_FLOATING_POINT 0 49 97 50 98 /* Misc PJLIB setting */ 51 # define PJ_MAXPATH 80 52 53 /* SRTP has not been ported to Symbian yet */ 54 # define PJMEDIA_HAS_SRTP 1 55 56 /* Disable these */ 57 # define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE 58 # define PJMEDIA_HAS_SPEEX_AEC 0 59 # define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE 60 61 /* Disable all codecs but G.711 and GSM, for now */ 62 # define PJMEDIA_HAS_GSM_CODEC 1 63 # define PJMEDIA_HAS_L16_CODEC 0 64 # define PJMEDIA_HAS_ILBC_CODEC 0 65 # define PJMEDIA_HAS_SPEEX_CODEC 1 66 # define PJMEDIA_HAS_G722_CODEC 0 67 68 /* Need larger sound buffers */ 69 # define PJMEDIA_SOUND_BUFFER_COUNT 16 70 71 /* Disable safe module access */ 72 # define PJSIP_SAFE_MODULE 0 73 74 # define PJSIP_MAX_PKT_LEN 2000 99 #define PJ_MAXPATH 80 75 100 76 101 /* This is important for Symbian. Symbian lacks vsnprintf(), so … … 79 104 * to log the packet. 80 105 */ 81 # define PJ_LOG_MAX_SIZE (PJSIP_MAX_PKT_LEN+500) 82 83 /* Since we don't have threads, log buffer can use static buffer */ 84 # define PJ_LOG_USE_STACK_BUFFER 0 85 86 /* Disable check stack since it increases footprint */ 87 # undef PJ_OS_HAS_CHECK_STACK 88 # define PJ_OS_HAS_CHECK_STACK 0 106 #define PJ_LOG_MAX_SIZE (PJSIP_MAX_PKT_LEN+500) 107 108 /* Since we don't have threads, log buffer can use static buffer 109 * rather than stack 110 */ 111 #define PJ_LOG_USE_STACK_BUFFER 0 112 113 /* Disable check stack since it increases footprint */ 114 #define PJ_OS_HAS_CHECK_STACK 0 115 116 117 /* 118 * PJMEDIA settings 119 */ 120 121 /* Disable non-Symbian audio devices */ 122 #define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0 123 #define PJMEDIA_AUDIO_DEV_HAS_WMME 0 124 125 /* Select codecs to disable */ 126 #define PJMEDIA_HAS_L16_CODEC 0 127 #define PJMEDIA_HAS_ILBC_CODEC 0 128 #define PJMEDIA_HAS_G722_CODEC 0 129 130 /* Fine tune Speex's default settings for best performance/quality */ 131 #define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5 132 133 /* For CPU reason, disable speex AEC and use the echo suppressor. */ 134 #define PJMEDIA_HAS_SPEEX_AEC 0 135 136 /* Shouldn't use resampling for performance reason too. */ 137 #define PJMEDIA_RESAMPLE_IMP PJMEDIA_RESAMPLE_NONE 138 139 /* Use the lighter WSOLA implementation */ 140 #define PJMEDIA_WSOLA_IMP PJMEDIA_WSOLA_IMP_WSOLA_LITE 141 142 /* We probably need more buffers especially if MDA audio backend 143 * is used, so increase the limit 144 */ 145 #define PJMEDIA_SOUND_BUFFER_COUNT 32 146 147 /* 148 * PJSIP settings. 149 */ 150 151 /* Disable safe module access, since we don't use multithreading */ 152 #define PJSIP_SAFE_MODULE 0 153 154 /* Increase allowable packet size, just in case */ 155 #define PJSIP_MAX_PKT_LEN 2000 89 156 90 157 /* Symbian has problem with too many large blocks */ 91 # define PJSIP_POOL_LEN_ENDPT 1000 92 # define PJSIP_POOL_INC_ENDPT 1000 93 # define PJSIP_POOL_RDATA_LEN 2000 94 # define PJSIP_POOL_RDATA_INC 2000 95 # define PJSIP_POOL_LEN_TDATA 2000 96 # define PJSIP_POOL_INC_TDATA 512 97 # define PJSIP_POOL_LEN_UA 2000 98 # define PJSIP_POOL_INC_UA 1000 99 # define PJSIP_POOL_TSX_LAYER_LEN 256 100 # define PJSIP_POOL_TSX_LAYER_INC 256 101 # define PJSIP_POOL_TSX_LEN 512 102 # define PJSIP_POOL_TSX_INC 128 158 #define PJSIP_POOL_LEN_ENDPT 1000 159 #define PJSIP_POOL_INC_ENDPT 1000 160 #define PJSIP_POOL_RDATA_LEN 2000 161 #define PJSIP_POOL_RDATA_INC 2000 162 #define PJSIP_POOL_LEN_TDATA 2000 163 #define PJSIP_POOL_INC_TDATA 512 164 #define PJSIP_POOL_LEN_UA 2000 165 #define PJSIP_POOL_INC_UA 1000 166 #define PJSIP_POOL_TSX_LAYER_LEN 256 167 #define PJSIP_POOL_TSX_LAYER_INC 256 168 #define PJSIP_POOL_TSX_LEN 512 169 #define PJSIP_POOL_TSX_INC 128 170 171 /* 172 * PJSUA settings. 173 */ 174 175 /* Default codec quality */ 176 #define PJSUA_DEFAULT_CODEC_QUALITY 5 103 177 104 178 /* Set maximum number of dialog/transaction/calls to minimum */ 105 #define PJSIP_MAX_TSX_COUNT 31106 # define PJSIP_MAX_DIALOG_COUNT31107 # define PJSUA_MAX_CALLS4179 #define PJSIP_MAX_TSX_COUNT 31 180 #define PJSIP_MAX_DIALOG_COUNT 31 181 #define PJSUA_MAX_CALLS 4 108 182 109 183 /* Other pjsua settings */ 110 # define PJSUA_MAX_ACC 4 111 # define PJSUA_MAX_PLAYERS 4 112 # define PJSUA_MAX_RECORDERS 4 113 # define PJSUA_MAX_CONF_PORTS (PJSUA_MAX_CALLS+2*PJSUA_MAX_PLAYERS) 114 # define PJSUA_MAX_BUDDIES 32 115 116 /* Speex default quality settings */ 117 # define PJSUA_DEFAULT_CODEC_QUALITY 5 118 # define PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY 5 184 #define PJSUA_MAX_ACC 4 185 #define PJSUA_MAX_PLAYERS 4 186 #define PJSUA_MAX_RECORDERS 4 187 #define PJSUA_MAX_CONF_PORTS (PJSUA_MAX_CALLS+2*PJSUA_MAX_PLAYERS) 188 #define PJSUA_MAX_BUDDIES 32 189 #endif 190 191 192 /* 193 * Additional configuration to activate APS-Direct feature for 194 * Nokia S60 target 195 * 196 * Please see http://trac.pjsip.org/repos/wiki/Nokia_APS_VAS_Direct 197 */ 198 #ifdef PJ_CONFIG_NOKIA_APS_DIRECT 199 200 /* MUST use switchboard rather than the conference bridge */ 201 #define PJMEDIA_CONF_USE_SWITCH_BOARD 1 202 203 /* Enable APS sound device backend and disable MDA */ 204 #define PJMEDIA_AUDIO_DEV_HAS_SYMB_MDA 0 205 #define PJMEDIA_AUDIO_DEV_HAS_SYMB_APS 1 206 207 /* Enable passthrough codec framework */ 208 #define PJMEDIA_HAS_PASSTHROUGH_CODECS 1 209 210 /* And selectively enable which codecs are supported by the handset */ 211 #define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 1 212 #define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 1 213 #define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 1 214 #define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 1 215 #define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 1 216 217 #endif 218 219 220 /* 221 * Configuration to activate "APS-Direct" media mode on Windows, 222 * useful for testing purposes only. 223 */ 224 #ifdef PJ_CONFIG_WIN32_WMME_DIRECT 225 226 /* MUST use switchboard rather than the conference bridge */ 227 #define PJMEDIA_CONF_USE_SWITCH_BOARD 1 228 229 /* Only WMME supports the "direct" feature */ 230 #define PJMEDIA_AUDIO_DEV_HAS_PORTAUDIO 0 231 #define PJMEDIA_AUDIO_DEV_HAS_WMME 1 232 233 /* Enable passthrough codec framework */ 234 #define PJMEDIA_HAS_PASSTHROUGH_CODECS 1 235 236 /* Only PCMA and PCMU are supported by WMME-direct */ 237 #define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 1 238 #define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 1 239 #define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 0 240 #define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 0 241 #define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 0 242 119 243 #endif 120 244 -
pjproject/trunk/pjlib/include/pj/errno.h
r2394 r2506 376 376 * - PJLIB_UTIL_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*3) 377 377 * - PJNATH_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*4) 378 * - PJMEDIA_AUDIODEV_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*5) 378 379 */ 379 380 -
pjproject/trunk/pjmedia/build/Makefile
r2344 r2506 19 19 export PJMEDIA_CODEC_LIB:=../lib/libpjmedia-codec-$(TARGET_NAME)$(LIBEXT) 20 20 export PJSDP_LIB:=../lib/libpjsdp-$(TARGET_NAME)$(LIBEXT) 21 export PJMEDIA_AUDIODEV_LIB:=../lib/libpjmedia-audiodev-$(TARGET_NAME)$(LIBEXT) 21 22 22 NULLSOUND_OBJS := nullsound.o23 23 24 24 ############################################################################### … … 35 35 $(HOST_CXXFLAGS) $(CXXFLAGS) 36 36 export _LDFLAGS := $(subst /,$(HOST_PSEP),$(PJMEDIA_LIB)) \ 37 $(subst /,$(HOST_PSEP),$(PJMEDIA_AUDIODEV_LIB)) \ 37 38 $(subst /,$(HOST_PSEP),$(PJMEDIA_CODEC_LIB)) \ 38 39 $(subst /,$(HOST_PSEP),$(PJLIB_LIB)) \ … … 50 51 export PJMEDIA_OBJS += $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ 51 52 alaw_ulaw.o alaw_ulaw_table.o clock_thread.o codec.o \ 52 conference.o delaybuf.o echo_common.o echo_port.o \53 echo_ suppress.o endpoint.o errno.o \53 conference.o conf_switch.o delaybuf.o echo_common.o \ 54 echo_port.o echo_suppress.o endpoint.o errno.o \ 54 55 g711.o jbuf.o master_port.o mem_capture.o mem_player.o \ 55 56 null_port.o plc_common.o port.o splitcomb.o \ 56 57 resample_resample.o resample_libsamplerate.o \ 57 58 resample_port.o rtcp.o rtcp_xr.o rtp.o \ 58 sdp.o sdp_cmp.o sdp_neg.o \59 s ession.o silencedet.o sound_port.o stereo_port.o \59 sdp.o sdp_cmp.o sdp_neg.o session.o silencedet.o \ 60 sound_legacy.o sound_port.o stereo_port.o \ 60 61 stream.o tonegen.o transport_adapter_sample.o \ 61 62 transport_ice.o transport_loop.o \ 62 63 transport_srtp.o transport_udp.o \ 63 64 wav_player.o wav_playlist.o wav_writer.o wave.o \ 64 wsola.o $(SOUND_OBJS) $(NULLSOUND_OBJS)65 wsola.o 65 66 66 67 export PJMEDIA_CFLAGS += $(_CFLAGS) 68 69 70 ############################################################################### 71 # Defines for building PJMEDIA-AUDIODEV library 72 # 73 export PJMEDIA_AUDIODEV_SRCDIR = ../src/pjmedia-audiodev 74 export PJMEDIA_AUDIODEV_OBJS += audiodev.o audiotest.o errno.o legacy_dev.o pa_dev.o \ 75 wmme_dev.o 76 export PJMEDIA_AUDIODEV_CFLAGS += $(_CFLAGS) 67 77 68 78 … … 107 117 # $(TARGET) is defined in os-$(OS_NAME).mak file in current directory. 108 118 # 109 TARGETS := pjmedia pjmedia- codec pjsdp pjmedia-test119 TARGETS := pjmedia pjmedia-audiodev pjmedia-codec pjsdp pjmedia-test 110 120 111 121 all: $(TARGETS) … … 122 132 distclean: realclean 123 133 124 .PHONY: dep depend pjmedia pjmedia-codec pjmedia- test clean realclean distclean134 .PHONY: dep depend pjmedia pjmedia-codec pjmedia-audiodev pjmedia-test clean realclean distclean 125 135 126 136 pjmedia: … … 129 139 pjmedia-codec: 130 140 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_CODEC app=pjmedia-codec $(PJMEDIA_CODEC_LIB) 141 142 pjmedia-audiodev: 143 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_AUDIODEV app=pjmedia-audiodev $(PJMEDIA_AUDIODEV_LIB) 131 144 132 145 pjsdp: … … 153 166 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia $@ 154 167 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_CODEC app=pjmedia-codec $@ 168 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_AUDIODEV app=pjmedia-audiodev $@ 155 169 $(MAKE) -f $(RULES_MAK) APP=PJSDP app=pjsdp $@ 156 170 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_TEST app=pjmedia-test $@ … … 158 172 realclean: 159 173 $(subst @@,$(subst /,$(HOST_PSEP),.pjmedia-$(TARGET_NAME).depend),$(HOST_RMR)) 174 $(subst @@,$(subst /,$(HOST_PSEP),.pjmedia-audiodev-$(TARGET_NAME).depend),$(HOST_RMR)) 160 175 $(subst @@,$(subst /,$(HOST_PSEP),.pjmedia-codec-$(TARGET_NAME).depend),$(HOST_RMR)) 161 176 $(subst @@,$(subst /,$(HOST_PSEP),.pjmedia-test-$(TARGET_NAME).depend),$(HOST_RMR)) … … 163 178 164 179 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia $@ 180 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia-audiodev $@ 165 181 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_CODEC app=pjmedia-codec $@ 166 182 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_TEST app=pjmedia-test $@ … … 169 185 depend: 170 186 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia $@ 187 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA app=pjmedia-audiodev $@ 171 188 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_CODEC app=pjmedia-codec $@ 172 189 $(MAKE) -f $(RULES_MAK) APP=PJMEDIA_TEST app=pjmedia-test $@ -
pjproject/trunk/pjmedia/build/os-auto.mak.in
r2182 r2506 79 79 # 80 80 ifneq ($(findstring pa,$(AC_PJMEDIA_SND)),) 81 export CFLAGS += -I$(THIRD_PARTY)/build/portaudio -I$(THIRD_PARTY)/portaudio/include -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_PORTAUDIO_SOUND 82 export SOUND_OBJS = pasound.o 81 export CFLAGS += -I$(THIRD_PARTY)/build/portaudio -I$(THIRD_PARTY)/portaudio/include -DPJMEDIA_AUDIO_DEV_HAS_PORTAUDIO=1 83 82 endif 84 83 85 84 # 86 # Win 32 DirectSound85 # Windows specific 87 86 # 88 ifeq ($(AC_PJMEDIA_SND),ds) 89 export SOUND_OBJS = dsound.o 90 export CFLAGS += -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_WIN32_DIRECT_SOUND 87 ifneq ($(findstring win32,$(AC_PJMEDIA_SND)),) 88 export CFLAGS += -DPJMEDIA_AUDIO_DEV_HAS_WMME=1 89 else 90 export CFLAGS += -DPJMEDIA_AUDIO_DEV_HAS_WMME=0 91 91 endif 92 92 … … 95 95 # 96 96 ifeq ($(AC_PJMEDIA_SND),null) 97 export SOUND_OBJS = nullsound.o 97 # ***** Error ****** 98 # This will not work either with the new Audiodev 98 99 export CFLAGS += -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_NULL_SOUND 99 100 endif … … 103 104 # 104 105 ifeq ($(AC_PJMEDIA_SND),external) 105 export SOUND_OBJS = 106 export CFLAGS += -DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_EXTERNAL 106 export CFLAGS += -DPJMEDIA_AUDIO_DEV_HAS_PORTAUDIO=0 -DPJMEDIA_AUDIO_DEV_HAS_WMME=0 107 107 endif 108 108 -
pjproject/trunk/pjmedia/build/pjmedia.dsp
r2290 r2506 110 110 # Begin Source File 111 111 112 SOURCE=..\src\pjmedia\conf_switch.c 113 # End Source File 114 # Begin Source File 115 112 116 SOURCE=..\src\pjmedia\conference.c 113 117 # End Source File … … 118 122 # Begin Source File 119 123 120 SOURCE=..\src\pjmedia\dsound.c121 # End Source File122 # Begin Source File123 124 124 SOURCE=..\src\pjmedia\echo_common.c 125 125 # End Source File … … 174 174 # Begin Source File 175 175 176 SOURCE=..\src\pjmedia\nullsound.c177 # End Source File178 # Begin Source File179 180 SOURCE=..\src\pjmedia\pasound.c181 # End Source File182 # Begin Source File183 184 176 SOURCE=..\src\pjmedia\plc_common.c 185 177 # End Source File … … 238 230 # Begin Source File 239 231 232 SOURCE=..\src\pjmedia\sound_legacy.c 233 # End Source File 234 # Begin Source File 235 240 236 SOURCE=..\src\pjmedia\sound_port.c 241 237 # End Source File … … 291 287 292 288 SOURCE=..\src\pjmedia\wave.c 293 # End Source File294 # Begin Source File295 296 SOURCE=..\src\pjmedia\wmme_sound.c297 289 # End Source File 298 290 # Begin Source File … … 307 299 308 300 SOURCE=..\include\pjmedia\alaw_ulaw.h 301 # End Source File 302 # Begin Source File 303 304 SOURCE=..\include\pjmedia\audio_dev.h 309 305 # End Source File 310 306 # Begin Source File -
pjproject/trunk/pjmedia/build/pjmedia.vcproj
r2430 r2506 435 435 </File> 436 436 <File 437 RelativePath="..\src\pjmedia\conf_switch.c" 438 > 439 </File> 440 <File 437 441 RelativePath="..\src\pjmedia\conference.c" 438 442 > … … 461 465 </File> 462 466 <File 463 RelativePath="..\src\pjmedia\dsound.c"464 >465 <FileConfiguration466 Name="Release|Win32"467 >468 <Tool469 Name="VCCLCompilerTool"470 AdditionalIncludeDirectories=""471 PreprocessorDefinitions=""472 />473 </FileConfiguration>474 <FileConfiguration475 Name="Debug|Win32"476 >477 <Tool478 Name="VCCLCompilerTool"479 AdditionalIncludeDirectories=""480 PreprocessorDefinitions=""481 />482 </FileConfiguration>483 </File>484 <File485 467 RelativePath="..\src\pjmedia\echo_common.c" 486 468 > … … 747 729 </File> 748 730 <File 749 RelativePath="..\src\pjmedia\nullsound.c"750 >751 <FileConfiguration752 Name="Release|Win32"753 >754 <Tool755 Name="VCCLCompilerTool"756 AdditionalIncludeDirectories=""757 PreprocessorDefinitions=""758 />759 </FileConfiguration>760 <FileConfiguration761 Name="Debug|Win32"762 >763 <Tool764 Name="VCCLCompilerTool"765 AdditionalIncludeDirectories=""766 PreprocessorDefinitions=""767 />768 </FileConfiguration>769 </File>770 <File771 RelativePath="..\src\pjmedia\pasound.c"772 >773 <FileConfiguration774 Name="Release|Win32"775 >776 <Tool777 Name="VCCLCompilerTool"778 AdditionalIncludeDirectories=""779 PreprocessorDefinitions=""780 />781 </FileConfiguration>782 <FileConfiguration783 Name="Debug|Win32"784 >785 <Tool786 Name="VCCLCompilerTool"787 AdditionalIncludeDirectories=""788 PreprocessorDefinitions=""789 />790 </FileConfiguration>791 </File>792 <File793 731 RelativePath="..\src\pjmedia\plc_common.c" 794 732 > … … 1027 965 </File> 1028 966 <File 967 RelativePath="..\src\pjmedia\sound_legacy.c" 968 > 969 </File> 970 <File 1029 971 RelativePath="..\src\pjmedia\sound_port.c" 1030 972 > … … 1243 1185 /> 1244 1186 </FileConfiguration> 1245 </File>1246 <File1247 RelativePath="..\src\pjmedia\wmme_sound.c"1248 >1249 1187 </File> 1250 1188 <File -
pjproject/trunk/pjmedia/build/pjmedia_codec.dsp
r2358 r2506 148 148 # Begin Source File 149 149 150 SOURCE="..\src\pjmedia-codec\passthrough.c" 151 # End Source File 152 # Begin Source File 153 150 154 SOURCE="..\src\pjmedia-codec\speex_codec.c" 151 155 … … 190 194 191 195 SOURCE="..\include\pjmedia-codec\l16.h" 196 # End Source File 197 # Begin Source File 198 199 SOURCE="..\include\pjmedia-codec\passthrough.h" 192 200 # End Source File 193 201 # Begin Source File -
pjproject/trunk/pjmedia/build/pjmedia_codec.vcproj
r2430 r2506 399 399 </File> 400 400 <File 401 RelativePath="..\src\pjmedia-codec\passthrough.c" 402 > 403 </File> 404 <File 401 405 RelativePath="..\src\pjmedia-codec\speex_codec.c" 402 406 > -
pjproject/trunk/pjmedia/include/pjmedia-codec.h
r2394 r2506 32 32 #include <pjmedia-codec/g722.h> 33 33 #include <pjmedia-codec/ipp_codecs.h> 34 #include <pjmedia-codec/passthrough.h> 34 35 35 36 -
pjproject/trunk/pjmedia/include/pjmedia-codec/amr_helper.h
r2394 r2506 633 633 * @return AMR mode. 634 634 */ 635 636 635 PJ_INLINE(pj_int8_t) pjmedia_codec_amr_get_mode(unsigned bitrate) 637 636 { … … 679 678 680 679 /** 680 * Get AMR mode based on frame length. 681 * 682 * @param amrnb Set to PJ_TRUE for AMR-NB domain or PJ_FALSE for AMR-WB. 683 * @param frame_len The frame length. 684 * 685 * @return AMR mode. 686 */ 687 688 PJ_INLINE(pj_int8_t) pjmedia_codec_amr_get_mode2(pj_bool_t amrnb, 689 unsigned frame_len) 690 { 691 int i; 692 693 if (amrnb) { 694 for (i = 0; i < 9; ++i) 695 if (frame_len == pjmedia_codec_amrnb_framelen[i]) 696 return (pj_int8_t)i; 697 } else { 698 for (i = 0; i < 10; ++i) { 699 if (frame_len == pjmedia_codec_amrwb_framelen[i]) 700 return (pj_int8_t)i; 701 } 702 } 703 704 pj_assert(!"Invalid AMR frame length"); 705 return -1; 706 } 707 708 /** 681 709 * Prepare a frame before pass it to decoder. This function will do: 682 710 * - reorder AMR bitstream from descending sensitivity order into … … 795 823 out_info->mode = FT_; 796 824 out->size = 5; 797 PJ_ASSERT_RETURN(out->size <= in->size, PJMEDIA_CODEC_EFRMINLEN);798 825 799 826 pj_bzero(out->buf, out->size); -
pjproject/trunk/pjmedia/include/pjmedia-codec/config.h
r2394 r2506 195 195 #endif 196 196 197 /** 198 * Enable Passthrough codecs. 199 * 200 * Default: 0 201 */ 202 #ifndef PJMEDIA_HAS_PASSTHROUGH_CODECS 203 # define PJMEDIA_HAS_PASSTHROUGH_CODECS 0 204 #endif 205 206 #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 207 # define PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 1 208 #endif 209 210 #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 211 # define PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 1 212 #endif 213 214 #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 215 # define PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 1 216 #endif 217 218 #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 219 # define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMU 1 220 # undef PJMEDIA_HAS_G711_CODEC 221 #endif 222 223 #ifndef PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 224 # define PJMEDIA_HAS_PASSTHROUGH_CODEC_PCMA 1 225 # undef PJMEDIA_HAS_G711_CODEC 226 #endif 197 227 198 228 #endif /* __PJMEDIA_CODEC_CONFIG_H__ */ -
pjproject/trunk/pjmedia/include/pjmedia/alaw_ulaw.h
r2416 r2506 145 145 * @param dst Destination buffer for 8-bit U-Law data. 146 146 * @param src Source, 16-bit linear PCM data. 147 * @param lenNumber of samples.147 * @param count Number of samples. 148 148 */ 149 149 PJ_INLINE(void) pjmedia_ulaw_encode(pj_uint8_t *dst, const pj_int16_t *src, 150 pj_size_t len)151 { 152 const pj_int16_t *end = src + len;150 pj_size_t count) 151 { 152 const pj_int16_t *end = src + count; 153 153 154 154 while (src < end) { … … 162 162 * @param dst Destination buffer for 8-bit A-Law data. 163 163 * @param src Source, 16-bit linear PCM data. 164 * @param lenNumber of samples.164 * @param count Number of samples. 165 165 */ 166 166 PJ_INLINE(void) pjmedia_alaw_encode(pj_uint8_t *dst, const pj_int16_t *src, 167 pj_size_t len)168 { 169 const pj_int16_t *end = src + len;167 pj_size_t count) 168 { 169 const pj_int16_t *end = src + count; 170 170 171 171 while (src < end) { … … 179 179 * @param dst Destination buffer for 16-bit PCM data. 180 180 * @param src Source, 8-bit U-Law data. 181 * @param len Number of samples.181 * @param len Encoded frame/source length in bytes. 182 182 */ 183 183 PJ_INLINE(void) pjmedia_ulaw_decode(pj_int16_t *dst, const pj_uint8_t *src, … … 196 196 * @param dst Destination buffer for 16-bit PCM data. 197 197 * @param src Source, 8-bit A-Law data. 198 * @param len Number of samples.198 * @param len Encoded frame/source length in bytes. 199 199 */ 200 200 PJ_INLINE(void) pjmedia_alaw_decode(pj_int16_t *dst, const pj_uint8_t *src, -
pjproject/trunk/pjmedia/include/pjmedia/codec.h
r2394 r2506 276 276 pj_uint8_t pcm_bits_per_sample; /**< Bits/sample in the PCM side */ 277 277 pj_uint8_t pt; /**< Payload type. */ 278 pjmedia_format_id fmt_id; /**< Source format, it's format of 279 encoder input and decoder 280 output. */ 278 281 } info; 279 282 -
pjproject/trunk/pjmedia/include/pjmedia/conference.h
r2394 r2506 44 44 PJ_BEGIN_DECL 45 45 46 /** 47 * The conference bridge signature in pjmedia_port_info. 48 */ 49 #define PJMEDIA_CONF_BRIDGE_SIGNATURE \ 50 PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'F') 51 52 /** 53 * The audio switchboard signature in pjmedia_port_info. 54 */ 55 #define PJMEDIA_CONF_SWITCH_SIGNATURE \ 56 PJMEDIA_PORT_SIGNATURE('A', 'S', 'W', 'I') 57 46 58 47 59 /** … … 57 69 unsigned slot; /**< Slot number. */ 58 70 pj_str_t name; /**< Port name. */ 71 pjmedia_format format; /**< Format. */ 59 72 pjmedia_port_op tx_setting; /**< Transmit settings. */ 60 73 pjmedia_port_op rx_setting; /**< Receive settings. */ 61 74 unsigned listener_cnt; /**< Number of listeners. */ 62 75 unsigned *listener_slots; /**< Array of listeners. */ 76 unsigned transmitter_cnt; /**< Number of transmitter. */ 63 77 unsigned clock_rate; /**< Clock rate of the port. */ 64 78 unsigned channel_count; /**< Number of channels. */ -
pjproject/trunk/pjmedia/include/pjmedia/config.h
r2394 r2506 45 45 #endif 46 46 47 /** 48 * Specify whether we prefer to use audio switch board rather than 49 * conference bridge. 50 * 51 * Audio switch board is a kind of simplified version of conference 52 * bridge, but not really the subset of conference bridge. It has 53 * stricter rules on audio routing among the pjmedia ports and has 54 * no audio mixing capability. The power of it is it could work with 55 * encoded audio frames where conference brigde couldn't. 56 * 57 * Default: 0 58 */ 59 #ifndef PJMEDIA_CONF_USE_SWITCH_BOARD 60 # define PJMEDIA_CONF_USE_SWITCH_BOARD 0 61 #endif 62 47 63 /* 48 64 * Types of sound stream backends. 49 65 */ 50 66 51 /** Constant for NULL sound backend. */ 52 #define PJMEDIA_SOUND_NULL_SOUND 0 53 54 /** Constant for PortAudio sound backend. */ 55 #define PJMEDIA_SOUND_PORTAUDIO_SOUND 1 56 57 /** Constant for Win32 DirectSound sound backend. */ 58 #define PJMEDIA_SOUND_WIN32_DIRECT_SOUND 2 59 60 /** Constant for Win32 MME sound backend. */ 61 #define PJMEDIA_SOUND_WIN32_MME_SOUND 3 62 63 /** When this is set, pjmedia will not provide any sound device backend. 64 * Application will have to provide its own sound device backend 65 * and link the application with it. 66 */ 67 #define PJMEDIA_SOUND_EXTERNAL 255 68 69 70 /** 71 * Unless specified otherwise, sound device uses PortAudio implementation 72 * by default. 73 */ 74 #ifndef PJMEDIA_SOUND_IMPLEMENTATION 75 # if defined(PJ_WIN32) && PJ_WIN32!=0 76 /*# define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_WIN32_DIRECT_SOUND*/ 77 /*# define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_WIN32_MME_SOUND*/ 78 # define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_PORTAUDIO_SOUND 79 # else 80 # define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_PORTAUDIO_SOUND 81 # endif 82 #endif 83 84 85 /** 86 * Specify whether we prefer to use DirectSound on Windows. 87 * 88 * Default: 0 89 */ 90 #ifndef PJMEDIA_PREFER_DIRECT_SOUND 91 # define PJMEDIA_PREFER_DIRECT_SOUND 0 92 #endif 93 94 95 /** 96 * Specify sound device latency default, in milisecond. 67 /** 68 * This macro has been deprecated in releasee 1.1. Please see 69 * http://trac.pjsip.org/repos/wiki/Audio_Dev_API for more information. 70 */ 71 #if defined(PJMEDIA_SOUND_IMPLEMENTATION) 72 # error PJMEDIA_SOUND_IMPLEMENTATION has been deprecated 73 #endif 74 75 /** 76 * This macro has been deprecated in releasee 1.1. Please see 77 * http://trac.pjsip.org/repos/wiki/Audio_Dev_API for more information. 78 */ 79 #if defined(PJMEDIA_PREFER_DIRECT_SOUND) 80 # error PJMEDIA_PREFER_DIRECT_SOUND has been deprecated 81 #endif 82 83 /** 84 * This macro controls whether the legacy sound device API is to be 85 * implemented, for applications that still use the old sound device 86 * API (sound.h). If this macro is set to non-zero, the sound_legacy.c 87 * will be included in the compilation. The sound_legacy.c is an 88 * implementation of old sound device (sound.h) using the new Audio 89 * Device API. 90 * 91 * Please see http://trac.pjsip.org/repos/wiki/Audio_Dev_API for more 92 * info. 93 */ 94 #ifndef PJMEDIA_HAS_LEGACY_SOUND_API 95 # define PJMEDIA_HAS_LEGACY_SOUND_API 1 96 #endif 97 98 /** 99 * Specify default sound device latency, in milisecond. 97 100 */ 98 101 #ifndef PJMEDIA_SND_DEFAULT_REC_LATENCY … … 100 103 #endif 101 104 105 /** 106 * Specify default sound device latency, in milisecond. 107 */ 102 108 #ifndef PJMEDIA_SND_DEFAULT_PLAY_LATENCY 103 109 # define PJMEDIA_SND_DEFAULT_PLAY_LATENCY 100 104 #endif105 106 107 /**108 * Specify whether delay buffer is used for sound device.109 * When delay buffer is enabled, the sound device callback110 * will be called one after another evenly.111 * The delay buffer also performs the best delay calculation112 * for the sound device, and will try to limit the delay caused113 * by uneven callback calls to this delay.114 *115 * When this setting is enabled, the PJMEDIA_SOUND_BUFFER_COUNT116 * macro will specify the maximum size of the delay buffer.117 */118 #ifndef PJMEDIA_SOUND_USE_DELAYBUF119 # define PJMEDIA_SOUND_USE_DELAYBUF 0120 110 #endif 121 111 … … 286 276 */ 287 277 #ifndef PJMEDIA_FILE_PORT_BUFSIZE 288 # define PJMEDIA_FILE_PORT_BUFSIZE 278 # define PJMEDIA_FILE_PORT_BUFSIZE 4000 289 279 #endif 290 280 -
pjproject/trunk/pjmedia/include/pjmedia/endpoint.h
r2394 r2506 38 38 */ 39 39 40 #include <pjmedia/sound.h>41 40 #include <pjmedia/codec.h> 42 41 #include <pjmedia/sdp.h> -
pjproject/trunk/pjmedia/include/pjmedia/port.h
r2394 r2506 26 26 */ 27 27 #include <pjmedia/types.h> 28 #include <pj/assert.h> 28 29 #include <pj/os.h> 29 30 … … 212 213 pj_bool_t need_info; /**< Need info on connect? */ 213 214 unsigned pt; /**< Payload type (can be dynamic). */ 215 pjmedia_format format; /**< Format. */ 214 216 pj_str_t encoding_name; /**< Encoding name. */ 215 217 unsigned clock_rate; /**< Sampling rate. */ … … 221 223 222 224 223 /**224 * Types of media frame.225 */226 typedef enum pjmedia_frame_type227 {228 PJMEDIA_FRAME_TYPE_NONE, /**< No frame. */229 PJMEDIA_FRAME_TYPE_AUDIO /**< Normal audio frame. */230 231 } pjmedia_frame_type;232 233 234 /**235 * This structure describes a media frame.236 */237 typedef struct pjmedia_frame238 {239 pjmedia_frame_type type; /**< Frame type. */240 void *buf; /**< Pointer to buffer. */241 pj_size_t size; /**< Frame size in bytes. */242 pj_timestamp timestamp; /**< Frame timestamp. */243 pj_uint32_t bit_info; /**< Bit info of the frame, sample case:244 a frame may not exactly start and end245 at the octet boundary, so this field246 may be used for specifying start &247 end bit offset. */248 } pjmedia_frame;249 250 251 225 /** 252 226 * Port interface. -
pjproject/trunk/pjmedia/include/pjmedia/sound.h
r2394 r2506 24 24 /** 25 25 * @file sound.h 26 * @brief Sound player and recorder device framework. 27 */ 26 * @brief Legacy sound device API 27 */ 28 #include <pjmedia-audiodev/audiodev.h> 28 29 #include <pjmedia/types.h> 29 #include <pj/pool.h> 30 30 31 31 32 PJ_BEGIN_DECL … … 36 37 * @brief PJMEDIA abstraction for sound device hardware 37 38 * @{ 39 * 40 * <strong>Warning: this sound device API has been deprecated 41 * and replaced by PJMEDIA Audio Device API. Please see 42 * http://trac.pjsip.org/repos/wiki/Audio_Dev_API for more 43 * information.</strong> 38 44 * 39 45 * This section describes lower level abstraction for sound device … … 62 68 */ 63 69 64 /** Opaque d ata type for audiostream. */70 /** Opaque declaration for pjmedia_snd_stream. */ 65 71 typedef struct pjmedia_snd_stream pjmedia_snd_stream; 66 72 … … 92 98 unsigned play_latency; /**< Playback latency, in samples. */ 93 99 } pjmedia_snd_stream_info; 94 95 100 96 101 /** -
pjproject/trunk/pjmedia/include/pjmedia/sound_port.h
r2394 r2506 25 25 * @brief Media port connection abstraction to sound device. 26 26 */ 27 #include <pjmedia /sound.h>27 #include <pjmedia-audiodev/audiodev.h> 28 28 #include <pjmedia/port.h> 29 29 … … 160 160 unsigned options, 161 161 pjmedia_snd_port **p_port); 162 162 163 164 /** 165 * Create sound device port according to the specified parameters. 166 * 167 * @param pool Pool to allocate sound port structure. 168 * @param prm Sound device settings. 169 * @param p_port Pointer to receive the sound device port instance. 170 * 171 * @return PJ_SUCCESS on success, or the appropriate error 172 * code. 173 */ 174 PJ_DECL(pj_status_t) pjmedia_snd_port_create2(pj_pool_t *pool, 175 const pjmedia_aud_param *prm, 176 pjmedia_snd_port **p_port); 177 163 178 164 179 /** … … 180 195 * @return The sound stream instance. 181 196 */ 182 PJ_DECL(pjmedia_ snd_stream*) pjmedia_snd_port_get_snd_stream(197 PJ_DECL(pjmedia_aud_stream*) pjmedia_snd_port_get_snd_stream( 183 198 pjmedia_snd_port *snd_port); 184 199 185 200 186 201 /** 187 * Configure the echo cancellation tail length. By default, echo canceller 188 * is enabled in the sound device with the default tail length. After the 189 * sound port is created, application can query the current echo canceller 190 * tail length by calling #pjmedia_snd_port_get_ec_tail. 191 * 192 * Note that you should only change the EC settings when the sound port 193 * is not connected to any downstream ports, otherwise race condition may 194 * occur. 202 * Change the echo cancellation settings. The echo cancellation settings 203 * should have been specified when this sound port was created, by setting 204 * the appropriate fields in the pjmedia_aud_param, because not all sound 205 * device implementation supports changing the EC setting once the device 206 * has been opened. 207 * 208 * The behavior of this function depends on whether device or software AEC 209 * is being used. If the device supports AEC, this function will forward 210 * the change request to the device and it will be up to the device whether 211 * to support the request. If software AEC is being used (the software EC 212 * will be used if the device does not support AEC), this function will 213 * change the software EC settings. 195 214 * 196 215 * @param snd_port The sound device port. … … 200 219 * be disabled. 201 220 * @param options The options to be passed to #pjmedia_echo_create(). 221 * This is only used if software EC is being used. 202 222 * 203 223 * @return PJ_SUCCESS on success. -
pjproject/trunk/pjmedia/include/pjmedia/stream.h
r2394 r2506 27 27 */ 28 28 29 #include <pjmedia/sound.h>30 29 #include <pjmedia/codec.h> 31 30 #include <pjmedia/endpoint.h> -
pjproject/trunk/pjmedia/include/pjmedia/symbian_sound_aps.h
r2394 r2506 32 32 33 33 /** 34 * Activate/deactivate loudspeaker, when loudspeaker is inactive, audio 35 * will be routed to earpiece. 34 * Set audio routing for APS sound device. 36 35 * 37 36 * @param stream The sound device stream, the stream should be started 38 * before calling this function. This param can be NULL 39 * to set the behaviour of next opened stream. 40 * @param active Specify PJ_TRUE to activate loudspeaker, and PJ_FALSE 41 * otherwise. 37 * before calling this function. 38 * @param route Audio routing to be set. 42 39 * 43 40 * @return PJ_SUCCESS on success. 44 41 */ 45 PJ_DECL(pj_status_t) pjmedia_snd_aps_activate_loudspeaker( 46 pjmedia_snd_stream *stream, 47 pj_bool_t active); 48 42 PJ_DECL(pj_status_t) pjmedia_snd_aps_set_route( pjmedia_snd_stream *stream, 43 pjmedia_snd_route route); 49 44 50 45 PJ_END_DECL -
pjproject/trunk/pjmedia/include/pjmedia/types.h
r2394 r2506 48 48 */ 49 49 50 /** 51 * Top most media type. 50 /** 51 * Top most media type. 52 52 */ 53 53 typedef enum pjmedia_type … … 62 62 PJMEDIA_TYPE_VIDEO = 2, 63 63 64 /** Unknown media type, in this case the name will be specified in 64 /** Unknown media type, in this case the name will be specified in 65 65 * encoding_name. 66 66 */ … … 73 73 74 74 75 /** 76 * Media transport protocol. 75 /** 76 * Media transport protocol. 77 77 */ 78 78 typedef enum pjmedia_tp_proto … … 93 93 94 94 95 /** 96 * Media direction. 95 /** 96 * Media direction. 97 97 */ 98 98 typedef enum pjmedia_dir … … 139 139 140 140 141 /** 142 * Opa gue declaration of media endpoint.141 /** 142 * Opaque declaration of media endpoint. 143 143 */ 144 144 typedef struct pjmedia_endpt pjmedia_endpt; … … 151 151 152 152 153 /** 153 /** 154 154 * Media socket info is used to describe the underlying sockets 155 155 * to be used as media transport. … … 181 181 182 182 /** 183 * Macro for packing format. 184 */ 185 #define PJMEDIA_FORMAT_PACK(C1, C2, C3, C4) ( C4<<24 | C3<<16 | C2<<8 | C1 ) 186 187 /** 188 * This enumeration describes format ID. 189 */ 190 typedef enum pjmedia_format_id 191 { 192 /** 193 * 16bit linear 194 */ 195 PJMEDIA_FORMAT_L16 = 0, 196 197 /** 198 * Alias for PJMEDIA_FORMAT_L16 199 */ 200 PJMEDIA_FORMAT_PCM = PJMEDIA_FORMAT_L16, 201 202 /** 203 * G.711 ALAW 204 */ 205 PJMEDIA_FORMAT_PCMA = PJMEDIA_FORMAT_PACK('A', 'L', 'A', 'W'), 206 207 /** 208 * Alias for PJMEDIA_FORMAT_PCMA 209 */ 210 PJMEDIA_FORMAT_ALAW = PJMEDIA_FORMAT_PCMA, 211 212 /** 213 * G.711 ULAW 214 */ 215 PJMEDIA_FORMAT_PCMU = PJMEDIA_FORMAT_PACK('u', 'L', 'A', 'W'), 216 217 /** 218 * Aliaw for PJMEDIA_FORMAT_PCMU 219 */ 220 PJMEDIA_FORMAT_ULAW = PJMEDIA_FORMAT_PCMU, 221 222 /** 223 * AMR narrowband 224 */ 225 PJMEDIA_FORMAT_AMR = PJMEDIA_FORMAT_PACK(' ', 'A', 'M', 'R'), 226 227 /** 228 * ITU G.729 229 */ 230 PJMEDIA_FORMAT_G729 = PJMEDIA_FORMAT_PACK('G', '7', '2', '9'), 231 232 /** 233 * Internet Low Bit-Rate Codec (ILBC) 234 */ 235 PJMEDIA_FORMAT_ILBC = PJMEDIA_FORMAT_PACK('I', 'L', 'B', 'C') 236 237 } pjmedia_format_id; 238 239 240 /** 241 * Media format information. 242 */ 243 typedef struct pjmedia_format 244 { 245 /** Format ID */ 246 pjmedia_format_id id; 247 248 /** Bitrate. */ 249 pj_uint32_t bitrate; 250 251 /** Flag to indicate whether VAD is enabled */ 252 pj_bool_t vad; 253 254 } pjmedia_format; 255 256 257 258 /** 183 259 * This is a general purpose function set PCM samples to zero. 184 * Since this function is needed by many parts of the library, 260 * Since this function is needed by many parts of the library, 185 261 * by putting this functionality in one place, it enables some. 186 262 * clever people to optimize this function. … … 206 282 /** 207 283 * This is a general purpose function to copy samples from/to buffers with 208 * equal size. Since this function is needed by many parts of the library, 284 * equal size. Since this function is needed by many parts of the library, 209 285 * by putting this functionality in one place, it enables some. 210 286 * clever people to optimize this function. … … 221 297 unsigned i; 222 298 count >>= 1; 223 for (i=0; i<count; ++i) 299 for (i=0; i<count; ++i) 224 300 ((pj_int32_t*)dst)[i] = ((pj_int32_t*)src)[i]; 225 301 #endif … … 229 305 /** 230 306 * This is a general purpose function to copy samples from/to buffers with 231 * equal size. Since this function is needed by many parts of the library, 307 * equal size. Since this function is needed by many parts of the library, 232 308 * by putting this functionality in one place, it enables some. 233 309 * clever people to optimize this function. … … 244 320 unsigned i; 245 321 count >>= 1; 246 for (i=0; i<count; ++i) 322 for (i=0; i<count; ++i) 247 323 ((pj_int32_t*)dst)[i] = ((pj_int32_t*)src)[i]; 248 324 #endif 249 325 } 250 326 327 /** 328 * Types of media frame. 329 */ 330 typedef enum pjmedia_frame_type 331 { 332 PJMEDIA_FRAME_TYPE_NONE, /**< No frame. */ 333 PJMEDIA_FRAME_TYPE_AUDIO, /**< Normal audio frame. */ 334 PJMEDIA_FRAME_TYPE_EXTENDED /**< Extended audio frame. */ 335 336 } pjmedia_frame_type; 337 338 339 /** 340 * This structure describes a media frame. 341 */ 342 typedef struct pjmedia_frame 343 { 344 pjmedia_frame_type type; /**< Frame type. */ 345 void *buf; /**< Pointer to buffer. */ 346 pj_size_t size; /**< Frame size in bytes. */ 347 pj_timestamp timestamp; /**< Frame timestamp. */ 348 pj_uint32_t bit_info; /**< Bit info of the frame, sample case: 349 a frame may not exactly start and end 350 at the octet boundary, so this field 351 may be used for specifying start & 352 end bit offset. */ 353 } pjmedia_frame; 354 355 356 /** 357 * The pjmedia_frame_ext is used to carry a more complex audio frames than 358 * the typical PCM audio frames, and it is signaled by setting the "type" 359 * field of a pjmedia_frame to PJMEDIA_FRAME_TYPE_EXTENDED. With this set, 360 * application may typecast pjmedia_frame to pjmedia_frame_ext. 361 * 362 * This structure may contain more than one audio frames, which subsequently 363 * will be called subframes in this structure. The subframes section 364 * immediately follows the end of this structure, and each subframe is 365 * represented by pjmedia_frame_ext_subframe structure. Every next 366 * subframe immediately follows the previous subframe, and all subframes 367 * are byte-aligned although its payload may not be byte-aligned. 368 */ 369 370 #pragma pack(1) 371 typedef struct pjmedia_frame_ext { 372 pjmedia_frame base; /**< Base frame info */ 373 pj_uint16_t samples_cnt; /**< Number of samples in this frame */ 374 pj_uint16_t subframe_cnt; /**< Number of (sub)frames in this frame */ 375 376 /* Zero or more (sub)frames follows immediately after this, 377 * each will be represented by pjmedia_frame_ext_subframe 378 */ 379 } pjmedia_frame_ext; 380 #pragma pack() 381 382 /** 383 * This structure represents the individual subframes in the 384 * pjmedia_frame_ext structure. 385 */ 386 #pragma pack(1) 387 typedef struct pjmedia_frame_ext_subframe { 388 pj_uint16_t bitlen; /**< Number of bits in the data */ 389 pj_uint8_t data[1]; /**< Start of encoded data */ 390 } pjmedia_frame_ext_subframe; 391 392 #pragma pack() 393 394 395 /** 396 * Append one subframe to #pjmedia_frame_ext. 397 * 398 * @param frm The #pjmedia_frame_ext. 399 * @param src Subframe data. 400 * @param bitlen Lenght of subframe, in bits. 401 * @param samples_cnt Number of audio samples in subframe. 402 */ 403 PJ_INLINE(void) pjmedia_frame_ext_append_subframe(pjmedia_frame_ext *frm, 404 const void *src, 405 unsigned bitlen, 406 unsigned samples_cnt) 407 { 408 pjmedia_frame_ext_subframe *fsub; 409 pj_uint8_t *p; 410 unsigned i; 411 412 p = (pj_uint8_t*)frm + sizeof(pjmedia_frame_ext); 413 for (i = 0; i < frm->subframe_cnt; ++i) { 414 fsub = (pjmedia_frame_ext_subframe*) p; 415 p += sizeof(fsub->bitlen) + ((fsub->bitlen+7) >> 3); 416 } 417 418 fsub = (pjmedia_frame_ext_subframe*) p; 419 fsub->bitlen = (pj_uint16_t)bitlen; 420 if (bitlen) 421 pj_memcpy(fsub->data, src, (bitlen+7) >> 3); 422 423 frm->subframe_cnt++; 424 frm->samples_cnt = (pj_uint16_t)(frm->samples_cnt + samples_cnt); 425 } 426 427 /** 428 * Get a subframe from #pjmedia_frame_ext. 429 * 430 * @param frm The #pjmedia_frame_ext. 431 * @param n Subframe index, zero based. 432 * 433 * @return The n-th subframe, or NULL if n is out-of-range. 434 */ 435 PJ_INLINE(pjmedia_frame_ext_subframe*) 436 pjmedia_frame_ext_get_subframe(const pjmedia_frame_ext *frm, unsigned n) 437 { 438 pjmedia_frame_ext_subframe *sf = NULL; 439 440 if (n < frm->subframe_cnt) { 441 pj_uint8_t *p; 442 unsigned i; 443 444 p = (pj_uint8_t*)frm + sizeof(pjmedia_frame_ext); 445 for (i = 0; i < n; ++i) { 446 sf = (pjmedia_frame_ext_subframe*) p; 447 p += sizeof(sf->bitlen) + ((sf->bitlen+7) >> 3); 448 } 449 450 sf = (pjmedia_frame_ext_subframe*) p; 451 } 452 453 return sf; 454 } 455 456 /** 457 * Extract all frame payload to the specified buffer. 458 * 459 * @param frm The frame. 460 * @param dst Destination buffer. 461 * @param maxsize Maximum size to copy (i.e. the size of the 462 * destination buffer). 463 * 464 * @return Total size of payload copied. 465 */ 466 PJ_INLINE(unsigned) 467 pjmedia_frame_ext_copy_payload(const pjmedia_frame_ext *frm, 468 void *dst, 469 unsigned maxlen) 470 { 471 unsigned i, copied=0; 472 for (i=0; i<frm->subframe_cnt; ++i) { 473 pjmedia_frame_ext_subframe *sf; 474 unsigned sz; 475 476 sf = pjmedia_frame_ext_get_subframe(frm, i); 477 if (!sf) 478 continue; 479 480 sz = ((sf->bitlen + 7) >> 3); 481 if (sz + copied > maxlen) 482 break; 483 484 pj_memcpy(((pj_uint8_t*)dst) + copied, sf->data, sz); 485 copied += sz; 486 } 487 return copied; 488 } 489 490 491 /** 492 * Pop out first n subframes from #pjmedia_frame_ext. 493 * 494 * @param frm The #pjmedia_frame_ext. 495 * @param n Number of first subframes to be popped out. 496 * 497 * @return PJ_SUCCESS when successful. 498 */ 499 PJ_INLINE(pj_status_t) 500 pjmedia_frame_ext_pop_subframes(pjmedia_frame_ext *frm, unsigned n) 501 { 502 pjmedia_frame_ext_subframe *sf; 503 pj_uint8_t *move_src; 504 unsigned move_len; 505 506 if (frm->subframe_cnt <= n) { 507 frm->subframe_cnt = 0; 508 frm->samples_cnt = 0; 509 return PJ_SUCCESS; 510 } 511 512 move_src = (pj_uint8_t*)pjmedia_frame_ext_get_subframe(frm, n); 513 sf = pjmedia_frame_ext_get_subframe(frm, frm->subframe_cnt-1); 514 move_len = (pj_uint8_t*)sf - move_src + sizeof(sf->bitlen) + 515 ((sf->bitlen+7) >> 3); 516 pj_memmove((pj_uint8_t*)frm+sizeof(pjmedia_frame_ext), 517 move_src, move_len); 518 519 frm->samples_cnt = (pj_uint16_t) 520 (frm->samples_cnt - n*frm->samples_cnt/frm->subframe_cnt); 521 frm->subframe_cnt = (pj_uint16_t) (frm->subframe_cnt - n); 522 523 return PJ_SUCCESS; 524 } 525 526 251 527 /** 252 528 * @} -
pjproject/trunk/pjmedia/src/pjmedia-audiodev/wmme_dev.c
r2504 r2506 37 37 #ifdef _MSC_VER 38 38 # pragma warning(pop) 39 #endif 40 41 /* mingw lacks WAVE_FORMAT_ALAW/MULAW */ 42 #ifndef WAVE_FORMAT_ALAW 43 # define WAVE_FORMAT_ALAW 0x0006 44 #endif 45 #ifndef WAVE_FORMAT_MULAW 46 # define WAVE_FORMAT_MULAW 0x0007 39 47 #endif 40 48 -
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r2394 r2506 34 34 #include <pj/string.h> 35 35 36 #if !defined(PJMEDIA_CONF_USE_SWITCH_BOARD) || PJMEDIA_CONF_USE_SWITCH_BOARD==0 36 37 37 38 /* CONF_DEBUG enables detailed operation of the conference bridge. … … 64 65 #define BYTES_PER_SAMPLE 2 65 66 66 #define SIGNATURE PJMEDIA_ PORT_SIGNATURE('C', 'O', 'N', 'F')67 #define SIGNATURE PJMEDIA_CONF_BRIDGE_SIGNATURE 67 68 #define SIGNATURE_PORT PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'P') 68 69 /* Normal level is hardcodec to 128 in all over places */ … … 465 466 466 467 if ((conf->options & PJMEDIA_CONF_NO_DEVICE) == 0) { 467 pjmedia_ snd_stream *strm;468 pjmedia_ snd_stream_info si;468 pjmedia_aud_stream *strm; 469 pjmedia_aud_param param; 469 470 470 471 /* … … 494 495 495 496 strm = pjmedia_snd_port_get_snd_stream(conf->snd_dev_port); 496 status = pjmedia_ snd_stream_get_info(strm, &si);497 status = pjmedia_aud_stream_get_param(strm, ¶m); 497 498 if (status == PJ_SUCCESS) { 498 const pjmedia_snd_dev_info *snd_dev_info;499 pjmedia_aud_dev_info snd_dev_info; 499 500 if (conf->options & PJMEDIA_CONF_NO_MIC) 500 snd_dev_info = pjmedia_snd_get_dev_info(si.play_id);501 pjmedia_aud_dev_get_info(param.play_id, &snd_dev_info); 501 502 else 502 snd_dev_info = pjmedia_snd_get_dev_info(si.rec_id);503 pj_strdup2_with_null(pool, &conf_port->name, snd_dev_info ->name);503 pjmedia_aud_dev_get_info(param.rec_id, &snd_dev_info); 504 pj_strdup2_with_null(pool, &conf_port->name, snd_dev_info.name); 504 505 } 505 506 } … … 1171 1172 info->listener_cnt = conf_port->listener_cnt; 1172 1173 info->listener_slots = conf_port->listener_slots; 1174 info->transmitter_cnt = conf_port->transmitter_cnt; 1173 1175 info->clock_rate = conf_port->clock_rate; 1174 1176 info->channel_count = conf_port->channel_count; … … 1988 1990 } 1989 1991 1992 #endif -
pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
r2394 r2506 21 21 #include <pjmedia/errno.h> 22 22 #include <pjmedia/sdp.h> 23 #include <pjmedia-audiodev/audiodev.h> 23 24 #include <pj/assert.h> 24 25 #include <pj/ioqueue.h> … … 122 123 123 124 /* Sound */ 124 status = pjmedia_ snd_init(pf);125 status = pjmedia_aud_subsys_init(pf); 125 126 if (status != PJ_SUCCESS) 126 127 goto on_error; … … 172 173 pj_ioqueue_destroy(endpt->ioqueue); 173 174 174 pjmedia_ snd_deinit();175 pjmedia_aud_subsys_shutdown(); 175 176 pj_pool_release(pool); 176 177 return status; … … 213 214 endpt->pf = NULL; 214 215 215 pjmedia_ snd_deinit();216 pjmedia_aud_subsys_shutdown(); 216 217 pj_pool_release (endpt->pool); 217 218 -
pjproject/trunk/pjmedia/src/pjmedia/errno.c
r2394 r2506 21 21 #include <pjmedia/types.h> 22 22 #include <pj/string.h> 23 #if PJMEDIA_SOUND_IMPLEMENTATION == PJMEDIA_SOUND_PORTAUDIO_SOUND 23 #if defined(PJMEDIA_SOUND_IMPLEMENTATION) && \ 24 PJMEDIA_SOUND_IMPLEMENTATION == PJMEDIA_SOUND_PORTAUDIO_SOUND 24 25 # include <portaudio.h> 25 26 #endif … … 180 181 181 182 /* See if the error comes from PortAudio. */ 182 #if PJMEDIA_SOUND_IMPLEMENTATION==PJMEDIA_SOUND_PORTAUDIO_SOUND 183 #if defined(PJMEDIA_SOUND_IMPLEMENTATION) && \ 184 PJMEDIA_SOUND_IMPLEMENTATION == PJMEDIA_SOUND_PORTAUDIO_SOUND 183 185 if (statcode >= PJMEDIA_PORTAUDIO_ERRNO_START && 184 186 statcode <= PJMEDIA_PORTAUDIO_ERRNO_END) -
pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
r2394 r2506 19 19 */ 20 20 #include <pjmedia/sound_port.h> 21 #include <pjmedia/alaw_ulaw.h> 21 22 #include <pjmedia/delaybuf.h> 22 23 #include <pjmedia/echo.h> 23 24 #include <pjmedia/errno.h> 24 #include <pjmedia/plc.h>25 25 #include <pj/assert.h> 26 26 #include <pj/log.h> … … 28 28 #include <pj/string.h> /* pj_memset() */ 29 29 30 //#define SIMULATE_LOST_PCT 2031 30 #define AEC_TAIL 128 /* default AEC length in ms */ 32 31 #define AEC_SUSPEND_LIMIT 5 /* seconds of no activity */ … … 36 35 //#define TEST_OVERFLOW_UNDERFLOW 37 36 38 enum39 {40 PJMEDIA_PLC_ENABLED = 1,41 };42 43 //#define DEFAULT_OPTIONS PJMEDIA_PLC_ENABLED44 #define DEFAULT_OPTIONS 045 46 47 37 struct pjmedia_snd_port 48 38 { 49 39 int rec_id; 50 40 int play_id; 51 pjmedia_snd_stream *snd_stream; 41 pj_uint32_t aud_caps; 42 pjmedia_aud_param aud_param; 43 pjmedia_aud_stream *aud_stream; 52 44 pjmedia_dir dir; 53 45 pjmedia_port *port; 54 unsigned options;55 56 pjmedia_echo_state *ec_state;57 unsigned aec_tail_len;58 59 pj_bool_t ec_suspended;60 unsigned ec_suspend_count;61 unsigned ec_suspend_limit;62 63 pjmedia_plc *plc;64 46 65 47 unsigned clock_rate; … … 68 50 unsigned bits_per_sample; 69 51 70 #if PJMEDIA_SOUND_USE_DELAYBUF 71 pjmedia_delay_buf *delay_buf; 72 #endif 52 /* software ec */ 53 pjmedia_echo_state *ec_state; 54 unsigned ec_options; 55 unsigned ec_tail_len; 56 pj_bool_t ec_suspended; 57 unsigned ec_suspend_count; 58 unsigned ec_suspend_limit; 73 59 }; 74 60 … … 77 63 * played. 78 64 */ 79 static pj_status_t play_cb(/* in */ void *user_data, 80 /* in */ pj_uint32_t timestamp, 81 /* out */ void *output, 82 /* out */ unsigned size) 65 static pj_status_t play_cb(void *user_data, pjmedia_frame *frame) 83 66 { 84 67 pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data; 85 68 pjmedia_port *port; 86 pjmedia_frame frame;69 unsigned required_size = frame->size; 87 70 pj_status_t status; 88 71 89 /* We're risking accessing the port without holding any mutex.90 * It's possible that port is disconnected then destroyed while91 * we're trying to access it.92 * But in the name of performance, we'll try this approach until93 * someone complains when it crashes.94 */95 72 port = snd_port->port; 96 73 if (port == NULL) 97 74 goto no_frame; 98 75 99 frame.buf = output; 100 frame.size = size; 101 frame.timestamp.u32.hi = 0; 102 frame.timestamp.u32.lo = timestamp; 103 104 #if PJMEDIA_SOUND_USE_DELAYBUF 105 if (snd_port->delay_buf) { 106 status = pjmedia_delay_buf_get(snd_port->delay_buf, (pj_int16_t*)output); 107 if (status != PJ_SUCCESS) 108 pj_bzero(output, size); 109 110 frame.type = PJMEDIA_FRAME_TYPE_AUDIO; 111 pjmedia_port_put_frame(port, &frame); 112 113 #ifdef TEST_OVERFLOW_UNDERFLOW 114 { 115 static int count = 1; 116 if (++count % 10 == 0) { 117 status = pjmedia_delay_buf_get(snd_port->delay_buf, 118 (pj_int16_t*)output); 119 if (status != PJ_SUCCESS) 120 pj_bzero(output, size); 121 122 frame.type = PJMEDIA_FRAME_TYPE_AUDIO; 123 pjmedia_port_put_frame(port, &frame); 124 } 125 } 126 #endif 127 128 } 129 #endif 130 131 status = pjmedia_port_get_frame(port, &frame); 76 status = pjmedia_port_get_frame(port, frame); 132 77 if (status != PJ_SUCCESS) 133 78 goto no_frame; 134 79 135 if (frame .type != PJMEDIA_FRAME_TYPE_AUDIO)80 if (frame->type != PJMEDIA_FRAME_TYPE_AUDIO) 136 81 goto no_frame; 137 82 138 83 /* Must supply the required samples */ 139 pj_assert(frame.size == size); 140 141 #ifdef SIMULATE_LOST_PCT 142 /* Simulate packet lost */ 143 if (pj_rand() % 100 < SIMULATE_LOST_PCT) { 144 PJ_LOG(4,(THIS_FILE, "Frame dropped")); 145 goto no_frame; 146 } 147 #endif 148 149 if (snd_port->plc) 150 pjmedia_plc_save(snd_port->plc, (pj_int16_t*) output); 84 PJ_UNUSED_ARG(required_size); 85 pj_assert(frame->size == required_size); 151 86 152 87 if (snd_port->ec_state) { … … 157 92 } 158 93 snd_port->ec_suspend_count = 0; 159 pjmedia_echo_playback(snd_port->ec_state, (pj_int16_t*) output);94 pjmedia_echo_playback(snd_port->ec_state, (pj_int16_t*)frame->buf); 160 95 } 161 96 … … 173 108 if (snd_port->ec_state) { 174 109 /* To maintain correct delay in EC */ 175 pjmedia_echo_playback(snd_port->ec_state, (pj_int16_t*)output); 176 } 177 } 178 179 /* Apply PLC */ 180 if (snd_port->plc) { 181 182 pjmedia_plc_generate(snd_port->plc, (pj_int16_t*) output); 183 #ifdef SIMULATE_LOST_PCT 184 PJ_LOG(4,(THIS_FILE, "Lost frame generated")); 185 #endif 186 } else { 187 pj_bzero(output, size); 188 } 189 110 pjmedia_echo_playback(snd_port->ec_state, (pj_int16_t*)frame->buf); 111 } 112 } 190 113 191 114 return PJ_SUCCESS; … … 197 120 * frame. 198 121 */ 199 static pj_status_t rec_cb(/* in */ void *user_data, 200 /* in */ pj_uint32_t timestamp, 201 /* in */ void *input, 202 /* in*/ unsigned size) 122 static pj_status_t rec_cb(void *user_data, pjmedia_frame *frame) 203 123 { 204 124 pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data; 205 125 pjmedia_port *port; 206 pjmedia_frame frame; 207 208 /* We're risking accessing the port without holding any mutex. 209 * It's possible that port is disconnected then destroyed while 210 * we're trying to access it. 211 * But in the name of performance, we'll try this approach until 212 * someone complains when it crashes. 213 */ 126 214 127 port = snd_port->port; 215 128 if (port == NULL) … … 218 131 /* Cancel echo */ 219 132 if (snd_port->ec_state && !snd_port->ec_suspended) { 220 pjmedia_echo_capture(snd_port->ec_state, (pj_int16_t*) input, 0); 221 } 222 223 #if PJMEDIA_SOUND_USE_DELAYBUF 224 if (snd_port->delay_buf) { 225 pjmedia_delay_buf_put(snd_port->delay_buf, (pj_int16_t*)input); 226 } else { 227 frame.buf = (void*)input; 228 frame.size = size; 229 frame.type = PJMEDIA_FRAME_TYPE_AUDIO; 230 frame.timestamp.u32.lo = timestamp; 231 232 pjmedia_port_put_frame(port, &frame); 233 } 234 #else 235 frame.buf = (void*)input; 236 frame.size = size; 237 frame.type = PJMEDIA_FRAME_TYPE_AUDIO; 238 frame.timestamp.u32.lo = timestamp; 239 240 pjmedia_port_put_frame(port, &frame); 241 #endif 133 pjmedia_echo_capture(snd_port->ec_state, (pj_int16_t*) frame->buf, 0); 134 } 135 136 pjmedia_port_put_frame(port, frame); 137 138 return PJ_SUCCESS; 139 } 140 141 /* 142 * The callback called by sound player when it needs more samples to be 143 * played. This version is for non-PCM data. 144 */ 145 static pj_status_t play_cb_ext(void *user_data, pjmedia_frame *frame) 146 { 147 pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data; 148 pjmedia_port *port = snd_port->port; 149 150 if (port == NULL) { 151 frame->type = PJMEDIA_FRAME_TYPE_NONE; 152 return PJ_SUCCESS; 153 } 154 155 pjmedia_port_get_frame(port, frame); 156 157 return PJ_SUCCESS; 158 } 159 160 161 /* 162 * The callback called by sound recorder when it has finished capturing a 163 * frame. This version is for non-PCM data. 164 */ 165 static pj_status_t rec_cb_ext(void *user_data, pjmedia_frame *frame) 166 { 167 pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data; 168 pjmedia_port *port; 169 170 port = snd_port->port; 171 if (port == NULL) 172 return PJ_SUCCESS; 173 174 pjmedia_port_put_frame(port, frame); 242 175 243 176 return PJ_SUCCESS; … … 251 184 pjmedia_snd_port *snd_port ) 252 185 { 186 pjmedia_aud_rec_cb snd_rec_cb; 187 pjmedia_aud_play_cb snd_play_cb; 188 pjmedia_aud_param param_copy; 253 189 pj_status_t status; 254 190 255 191 /* Check if sound has been started. */ 256 if (snd_port-> snd_stream != NULL)192 if (snd_port->aud_stream != NULL) 257 193 return PJ_SUCCESS; 258 194 259 /* Open sound stream. */ 260 if (snd_port->dir == PJMEDIA_DIR_CAPTURE) { 261 status = pjmedia_snd_open_rec( snd_port->rec_id, 262 snd_port->clock_rate, 263 snd_port->channel_count, 264 snd_port->samples_per_frame, 265 snd_port->bits_per_sample, 266 &rec_cb, 195 PJ_ASSERT_RETURN(snd_port->dir == PJMEDIA_DIR_CAPTURE || 196 snd_port->dir == PJMEDIA_DIR_PLAYBACK || 197 snd_port->dir == PJMEDIA_DIR_CAPTURE_PLAYBACK, 198 PJ_EBUG); 199 200 /* Get device caps */ 201 if (snd_port->aud_param.dir & PJMEDIA_DIR_CAPTURE) { 202 pjmedia_aud_dev_info dev_info; 203 204 status = pjmedia_aud_dev_get_info(snd_port->aud_param.rec_id, 205 &dev_info); 206 if (status != PJ_SUCCESS) 207 return status; 208 209 snd_port->aud_caps = dev_info.caps; 210 } else { 211 snd_port->aud_caps = 0; 212 } 213 214 /* Process EC settings */ 215 pj_memcpy(¶m_copy, &snd_port->aud_param, sizeof(param_copy)); 216 if (param_copy.flags & PJMEDIA_AUD_DEV_CAP_EC) { 217 /* EC is wanted */ 218 if (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) { 219 /* Device supports EC */ 220 /* Nothing to do */ 221 } else { 222 /* Device doesn't support EC, remove EC settings from 223 * device parameters 224 */ 225 param_copy.flags &= ~(PJMEDIA_AUD_DEV_CAP_EC | 226 PJMEDIA_AUD_DEV_CAP_EC_TAIL); 227 } 228 } 229 230 /* Use different callback if format is not PCM */ 231 if (snd_port->aud_param.ext_fmt.id == PJMEDIA_FORMAT_L16) { 232 snd_rec_cb = &rec_cb; 233 snd_play_cb = &play_cb; 234 } else { 235 snd_rec_cb = &rec_cb_ext; 236 snd_play_cb = &play_cb_ext; 237 } 238 239 /* Open the device */ 240 status = pjmedia_aud_stream_create(¶m_copy, 241 snd_rec_cb, 242 snd_play_cb, 267 243 snd_port, 268 &snd_port->snd_stream); 269 270 } else if (snd_port->dir == PJMEDIA_DIR_PLAYBACK) { 271 status = pjmedia_snd_open_player( snd_port->play_id, 272 snd_port->clock_rate, 273 snd_port->channel_count, 274 snd_port->samples_per_frame, 275 snd_port->bits_per_sample, 276 &play_cb, 277 snd_port, 278 &snd_port->snd_stream); 279 280 } else if (snd_port->dir == PJMEDIA_DIR_CAPTURE_PLAYBACK) { 281 status = pjmedia_snd_open( snd_port->rec_id, 282 snd_port->play_id, 283 snd_port->clock_rate, 284 snd_port->channel_count, 285 snd_port->samples_per_frame, 286 snd_port->bits_per_sample, 287 &rec_cb, 288 &play_cb, 289 snd_port, 290 &snd_port->snd_stream); 291 } else { 292 pj_assert(!"Invalid dir"); 293 status = PJ_EBUG; 294 } 244 &snd_port->aud_stream); 295 245 296 246 if (status != PJ_SUCCESS) 297 247 return status; 298 299 300 #ifdef SIMULATE_LOST_PCT301 snd_port->options |= PJMEDIA_PLC_ENABLED;302 #endif303 304 /* If we have player components, allocate buffer to save the last305 * frame played to the speaker. The last frame is used for packet306 * lost concealment (PLC) algorithm.307 */308 if ((snd_port->dir & PJMEDIA_DIR_PLAYBACK) &&309 (snd_port->options & PJMEDIA_PLC_ENABLED))310 {311 status = pjmedia_plc_create(pool, snd_port->clock_rate,312 snd_port->samples_per_frame *313 snd_port->channel_count,314 0, &snd_port->plc);315 if (status != PJ_SUCCESS) {316 PJ_LOG(4,(THIS_FILE, "Unable to create PLC"));317 snd_port->plc = NULL;318 }319 }320 248 321 249 /* Inactivity limit before EC is suspended. */ … … 324 252 snd_port->samples_per_frame); 325 253 254 /* Create software EC if parameter specifies EC but device 255 * doesn't support EC. Only do this if the format is PCM! 256 */ 257 if ((snd_port->aud_param.flags & PJMEDIA_AUD_DEV_CAP_EC) && 258 (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC)==0 && 259 param_copy.ext_fmt.id == PJMEDIA_FORMAT_PCM) 260 { 261 if ((snd_port->aud_param.flags & PJMEDIA_AUD_DEV_CAP_EC_TAIL)==0) { 262 snd_port->aud_param.flags |= PJMEDIA_AUD_DEV_CAP_EC_TAIL; 263 snd_port->aud_param.ec_tail_ms = AEC_TAIL; 264 PJ_LOG(4,(THIS_FILE, "AEC tail is set to default %u ms", 265 snd_port->aud_param.ec_tail_ms)); 266 } 267 268 status = pjmedia_snd_port_set_ec(snd_port, pool, 269 snd_port->aud_param.ec_tail_ms, 0); 270 if (status != PJ_SUCCESS) { 271 pjmedia_aud_stream_destroy(snd_port->aud_stream); 272 snd_port->aud_stream = NULL; 273 return status; 274 } 275 } 276 326 277 /* Start sound stream. */ 327 status = pjmedia_ snd_stream_start(snd_port->snd_stream);278 status = pjmedia_aud_stream_start(snd_port->aud_stream); 328 279 if (status != PJ_SUCCESS) { 329 pjmedia_ snd_stream_close(snd_port->snd_stream);330 snd_port-> snd_stream = NULL;280 pjmedia_aud_stream_destroy(snd_port->aud_stream); 281 snd_port->aud_stream = NULL; 331 282 return status; 332 283 } … … 343 294 { 344 295 /* Check if we have sound stream device. */ 345 if (snd_port-> snd_stream) {346 pjmedia_ snd_stream_stop(snd_port->snd_stream);347 pjmedia_ snd_stream_close(snd_port->snd_stream);348 snd_port-> snd_stream = NULL;296 if (snd_port->aud_stream) { 297 pjmedia_aud_stream_stop(snd_port->aud_stream); 298 pjmedia_aud_stream_destroy(snd_port->aud_stream); 299 snd_port->aud_stream = NULL; 349 300 } 350 301 … … 372 323 pjmedia_snd_port **p_port) 373 324 { 374 pjmedia_snd_port *snd_port; 375 376 PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL); 377 378 snd_port = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_port); 379 PJ_ASSERT_RETURN(snd_port, PJ_ENOMEM); 380 381 snd_port->rec_id = rec_id; 382 snd_port->play_id = play_id; 383 snd_port->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; 384 snd_port->options = options | DEFAULT_OPTIONS; 385 snd_port->clock_rate = clock_rate; 386 snd_port->channel_count = channel_count; 387 snd_port->samples_per_frame = samples_per_frame; 388 snd_port->bits_per_sample = bits_per_sample; 389 390 #if PJMEDIA_SOUND_USE_DELAYBUF 391 do { 392 pj_status_t status; 393 unsigned ptime; 394 395 ptime = samples_per_frame * 1000 / (clock_rate * channel_count); 396 397 status = pjmedia_delay_buf_create(pool, "snd_buff", 398 clock_rate, samples_per_frame, 399 channel_count, 400 PJMEDIA_SOUND_BUFFER_COUNT * ptime, 401 0, &snd_port->delay_buf); 402 PJ_ASSERT_RETURN(status == PJ_SUCCESS, status); 403 } while (0); 404 #endif 405 406 *p_port = snd_port; 407 408 409 /* Start sound device immediately. 410 * If there's no port connected, the sound callback will return 411 * empty signal. 412 */ 413 return start_sound_device( pool, snd_port ); 414 325 pjmedia_aud_param param; 326 pj_status_t status; 327 328 PJ_UNUSED_ARG(options); 329 330 status = pjmedia_aud_dev_default_param(rec_id, ¶m); 331 if (status != PJ_SUCCESS) 332 return status; 333 334 param.dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; 335 param.rec_id = rec_id; 336 param.play_id = play_id; 337 param.clock_rate = clock_rate; 338 param.channel_count = channel_count; 339 param.samples_per_frame = samples_per_frame; 340 param.bits_per_sample = bits_per_sample; 341 342 return pjmedia_snd_port_create2(pool, ¶m, p_port); 415 343 } 416 344 … … 427 355 pjmedia_snd_port **p_port) 428 356 { 429 pjmedia_snd_port *snd_port; 430 431 PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL); 432 433 snd_port = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_port); 434 PJ_ASSERT_RETURN(snd_port, PJ_ENOMEM); 435 436 snd_port->rec_id = dev_id; 437 snd_port->dir = PJMEDIA_DIR_CAPTURE; 438 snd_port->options = options | DEFAULT_OPTIONS; 439 snd_port->clock_rate = clock_rate; 440 snd_port->channel_count = channel_count; 441 snd_port->samples_per_frame = samples_per_frame; 442 snd_port->bits_per_sample = bits_per_sample; 443 444 *p_port = snd_port; 445 446 /* Start sound device immediately. 447 * If there's no port connected, the sound callback will return 448 * empty signal. 449 */ 450 return start_sound_device( pool, snd_port ); 357 pjmedia_aud_param param; 358 pj_status_t status; 359 360 PJ_UNUSED_ARG(options); 361 362 status = pjmedia_aud_dev_default_param(dev_id, ¶m); 363 if (status != PJ_SUCCESS) 364 return status; 365 366 param.dir = PJMEDIA_DIR_CAPTURE; 367 param.rec_id = dev_id; 368 param.clock_rate = clock_rate; 369 param.channel_count = channel_count; 370 param.samples_per_frame = samples_per_frame; 371 param.bits_per_sample = bits_per_sample; 372 373 return pjmedia_snd_port_create2(pool, ¶m, p_port); 451 374 } 452 375 … … 464 387 pjmedia_snd_port **p_port) 465 388 { 389 pjmedia_aud_param param; 390 pj_status_t status; 391 392 PJ_UNUSED_ARG(options); 393 394 status = pjmedia_aud_dev_default_param(dev_id, ¶m); 395 if (status != PJ_SUCCESS) 396 return status; 397 398 param.dir = PJMEDIA_DIR_PLAYBACK; 399 param.play_id = dev_id; 400 param.clock_rate = clock_rate; 401 param.channel_count = channel_count; 402 param.samples_per_frame = samples_per_frame; 403 param.bits_per_sample = bits_per_sample; 404 405 return pjmedia_snd_port_create2(pool, ¶m, p_port); 406 } 407 408 409 /* 410 * Create sound port. 411 */ 412 PJ_DEF(pj_status_t) pjmedia_snd_port_create2(pj_pool_t *pool, 413 const pjmedia_aud_param *prm, 414 pjmedia_snd_port **p_port) 415 { 466 416 pjmedia_snd_port *snd_port; 467 468 PJ_ASSERT_RETURN(pool && p_port, PJ_EINVAL); 417 pj_status_t status; 418 419 PJ_ASSERT_RETURN(pool && prm && p_port, PJ_EINVAL); 469 420 470 421 snd_port = PJ_POOL_ZALLOC_T(pool, pjmedia_snd_port); 471 422 PJ_ASSERT_RETURN(snd_port, PJ_ENOMEM); 472 423 473 snd_port-> play_id = dev_id;474 snd_port-> dir = PJMEDIA_DIR_PLAYBACK;475 snd_port-> options = options | DEFAULT_OPTIONS;476 snd_port-> clock_rate = clock_rate;477 snd_port->c hannel_count = channel_count;478 snd_port-> samples_per_frame = samples_per_frame;479 snd_port-> bits_per_sample = bits_per_sample;480 481 *p_port = snd_port;482 424 snd_port->dir = prm->dir; 425 snd_port->rec_id = prm->rec_id; 426 snd_port->play_id = prm->play_id; 427 snd_port->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; 428 snd_port->clock_rate = prm->clock_rate; 429 snd_port->channel_count = prm->channel_count; 430 snd_port->samples_per_frame = prm->samples_per_frame; 431 snd_port->bits_per_sample = prm->bits_per_sample; 432 pj_memcpy(&snd_port->aud_param, prm, sizeof(*prm)); 433 483 434 /* Start sound device immediately. 484 435 * If there's no port connected, the sound callback will return 485 436 * empty signal. 486 437 */ 487 return start_sound_device( pool, snd_port ); 438 status = start_sound_device( pool, snd_port ); 439 if (status != PJ_SUCCESS) { 440 pjmedia_snd_port_destroy(snd_port); 441 return status; 442 } 443 444 *p_port = snd_port; 445 return PJ_SUCCESS; 488 446 } 489 447 … … 503 461 * Retrieve the sound stream associated by this sound device port. 504 462 */ 505 PJ_DEF(pjmedia_ snd_stream*) pjmedia_snd_port_get_snd_stream(463 PJ_DEF(pjmedia_aud_stream*) pjmedia_snd_port_get_snd_stream( 506 464 pjmedia_snd_port *snd_port) 507 465 { 508 466 PJ_ASSERT_RETURN(snd_port, NULL); 509 return snd_port-> snd_stream;510 } 511 512 513 /* 514 * Enable AEC467 return snd_port->aud_stream; 468 } 469 470 471 /* 472 * Change EC settings. 515 473 */ 516 474 PJ_DEF(pj_status_t) pjmedia_snd_port_set_ec( pjmedia_snd_port *snd_port, … … 519 477 unsigned options) 520 478 { 521 pjmedia_ snd_stream_info si;479 pjmedia_aud_param prm; 522 480 pj_status_t status; 523 481 … … 527 485 PJ_EINVALIDOP); 528 486 529 /* Sound port must have 16bits per sample */ 530 PJ_ASSERT_RETURN(snd_port->bits_per_sample == 16, 531 PJ_EINVALIDOP); 532 533 /* Destroy AEC */ 534 if (snd_port->ec_state) { 535 pjmedia_echo_destroy(snd_port->ec_state); 536 snd_port->ec_state = NULL; 537 } 538 539 snd_port->aec_tail_len = tail_ms; 540 541 if (tail_ms != 0) { 542 unsigned delay_ms; 543 544 status = pjmedia_snd_stream_get_info(snd_port->snd_stream, &si); 487 /* Determine whether we use device or software EC */ 488 if (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) { 489 /* We use device EC */ 490 pj_bool_t ec_enabled; 491 492 /* Query EC status */ 493 status = pjmedia_aud_stream_get_cap(snd_port->aud_stream, 494 PJMEDIA_AUD_DEV_CAP_EC, 495 &ec_enabled); 545 496 if (status != PJ_SUCCESS) 546 si.rec_latency = si.play_latency = 0; 547 548 //No need to add input latency in the latency calculation, 549 //since actual input latency should be zero. 550 //delay_ms = (si.rec_latency + si.play_latency) * 1000 / 551 // snd_port->clock_rate; 552 delay_ms = si.play_latency * 1000 / snd_port->clock_rate; 553 status = pjmedia_echo_create2(pool, snd_port->clock_rate, 554 snd_port->channel_count, 555 snd_port->samples_per_frame, 556 tail_ms, delay_ms, 557 options, &snd_port->ec_state); 497 return status; 498 499 if (tail_ms != 0) { 500 /* Change EC setting */ 501 502 if (!ec_enabled) { 503 /* Enable EC first */ 504 pj_bool_t value = PJ_TRUE; 505 status = pjmedia_aud_stream_set_cap(snd_port->aud_stream, 506 PJMEDIA_AUD_DEV_CAP_EC, 507 &value); 508 if (status != PJ_SUCCESS) 509 return status; 510 } 511 512 if ((snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC_TAIL)==0) { 513 /* Device does not support setting EC tail */ 514 return PJMEDIA_EAUD_INVCAP; 515 } 516 517 return pjmedia_aud_stream_set_cap(snd_port->aud_stream, 518 PJMEDIA_AUD_DEV_CAP_EC_TAIL, 519 &tail_ms); 520 521 } else if (ec_enabled) { 522 /* Disable EC */ 523 pj_bool_t value = PJ_FALSE; 524 return pjmedia_aud_stream_set_cap(snd_port->aud_stream, 525 PJMEDIA_AUD_DEV_CAP_EC, 526 &value); 527 } else { 528 /* Request to disable EC but EC has been disabled */ 529 /* Do nothing */ 530 return PJ_SUCCESS; 531 } 532 533 } else { 534 /* We use software EC */ 535 536 /* Check if there is change in parameters */ 537 if (tail_ms==snd_port->ec_tail_len && options==snd_port->ec_options) { 538 PJ_LOG(5,(THIS_FILE, "pjmedia_snd_port_set_ec() ignored, no " 539 "change in settings")); 540 return PJ_SUCCESS; 541 } 542 543 status = pjmedia_aud_stream_get_param(snd_port->aud_stream, &prm); 558 544 if (status != PJ_SUCCESS) 545 return status; 546 547 /* Audio stream must be in PCM format */ 548 PJ_ASSERT_RETURN(prm.ext_fmt.id == PJMEDIA_FORMAT_PCM, 549 PJ_EINVALIDOP); 550 551 /* Destroy AEC */ 552 if (snd_port->ec_state) { 553 pjmedia_echo_destroy(snd_port->ec_state); 559 554 snd_port->ec_state = NULL; 560 else 561 snd_port->ec_suspended = PJ_FALSE; 562 } else { 563 PJ_LOG(4,(THIS_FILE, "Echo canceller is now disabled in the " 564 "sound port")); 565 status = PJ_SUCCESS; 555 } 556 557 if (tail_ms != 0) { 558 unsigned delay_ms; 559 560 //No need to add input latency in the latency calculation, 561 //since actual input latency should be zero. 562 //delay_ms = (si.rec_latency + si.play_latency) * 1000 / 563 // snd_port->clock_rate; 564 delay_ms = prm.output_latency_ms; 565 status = pjmedia_echo_create2(pool, snd_port->clock_rate, 566 snd_port->channel_count, 567 snd_port->samples_per_frame, 568 tail_ms, delay_ms, 569 options, &snd_port->ec_state); 570 if (status != PJ_SUCCESS) 571 snd_port->ec_state = NULL; 572 else 573 snd_port->ec_suspended = PJ_FALSE; 574 } else { 575 PJ_LOG(4,(THIS_FILE, "Echo canceller is now disabled in the " 576 "sound port")); 577 status = PJ_SUCCESS; 578 } 579 580 snd_port->ec_options = options; 581 snd_port->ec_tail_len = tail_ms; 566 582 } 567 583 … … 575 591 { 576 592 PJ_ASSERT_RETURN(snd_port && p_length, PJ_EINVAL); 577 *p_length = snd_port->ec_state ? snd_port->aec_tail_len : 0; 578 return PJ_SUCCESS; 579 } 580 593 594 /* Determine whether we use device or software EC */ 595 if (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) { 596 /* We use device EC */ 597 pj_bool_t ec_enabled; 598 pj_status_t status; 599 600 /* Query EC status */ 601 status = pjmedia_aud_stream_get_cap(snd_port->aud_stream, 602 PJMEDIA_AUD_DEV_CAP_EC, 603 &ec_enabled); 604 if (status != PJ_SUCCESS) 605 return status; 606 607 if (!ec_enabled) { 608 *p_length = 0; 609 } else if (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC_TAIL) { 610 /* Get device EC tail */ 611 status = pjmedia_aud_stream_get_cap(snd_port->aud_stream, 612 PJMEDIA_AUD_DEV_CAP_EC_TAIL, 613 p_length); 614 if (status != PJ_SUCCESS) 615 return status; 616 } else { 617 /* Just use default */ 618 *p_length = AEC_TAIL; 619 } 620 621 } else { 622 /* We use software EC */ 623 *p_length = snd_port->ec_state ? snd_port->ec_tail_len : 0; 624 } 625 return PJ_SUCCESS; 626 } 581 627 582 628 -
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r2477 r2506 409 409 410 410 411 /* The other version of get_frame callback used when stream port format 412 * is non linear PCM. 413 */ 414 static pj_status_t get_frame_ext( pjmedia_port *port, pjmedia_frame *frame) 415 { 416 pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata; 417 pjmedia_channel *channel = stream->dec; 418 pjmedia_frame_ext *f = (pjmedia_frame_ext*)frame; 419 unsigned samples_per_frame, samples_required; 420 pj_status_t status; 421 422 /* Return no frame if channel is paused */ 423 if (channel->paused) { 424 frame->type = PJMEDIA_FRAME_TYPE_NONE; 425 return PJ_SUCCESS; 426 } 427 428 /* Repeat get frame from the jitter buffer and decode the frame 429 * until we have enough frames according to codec's ptime. 430 */ 431 432 samples_required = stream->port.info.samples_per_frame; 433 samples_per_frame = stream->codec_param.info.frm_ptime * 434 stream->codec_param.info.clock_rate * 435 stream->codec_param.info.channel_cnt / 436 1000; 437 438 pj_bzero(f, sizeof(pjmedia_frame_ext)); 439 f->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; 440 441 while (f->samples_cnt < samples_required) { 442 char frame_type; 443 pj_size_t frame_size; 444 pj_uint32_t bit_info; 445 446 /* Lock jitter buffer mutex first */ 447 pj_mutex_lock( stream->jb_mutex ); 448 449 /* Get frame from jitter buffer. */ 450 pjmedia_jbuf_get_frame2(stream->jb, channel->out_pkt, &frame_size, 451 &frame_type, &bit_info); 452 453 /* Unlock jitter buffer mutex. */ 454 pj_mutex_unlock( stream->jb_mutex ); 455 456 if (frame_type == PJMEDIA_JB_NORMAL_FRAME) { 457 /* Got "NORMAL" frame from jitter buffer */ 458 pjmedia_frame frame_in; 459 460 /* Decode */ 461 frame_in.buf = channel->out_pkt; 462 frame_in.size = frame_size; 463 frame_in.bit_info = bit_info; 464 frame_in.type = PJMEDIA_FRAME_TYPE_AUDIO; 465 466 status = stream->codec->op->decode( stream->codec, &frame_in, 467 0, frame); 468 if (status != PJ_SUCCESS) { 469 LOGERR_((port->info.name.ptr, "codec decode() error", 470 status)); 471 pjmedia_frame_ext_append_subframe(f, NULL, 0, 472 (pj_uint16_t)samples_per_frame); 473 } 474 } else { 475 status = (*stream->codec->op->recover)(stream->codec, 476 0, frame); 477 if (status != PJ_SUCCESS) { 478 pjmedia_frame_ext_append_subframe(f, NULL, 0, 479 (pj_uint16_t)samples_per_frame); 480 } 481 482 if (frame_type == PJMEDIA_JB_MISSING_FRAME) { 483 PJ_LOG(5,(stream->port.info.name.ptr, "Frame lost!")); 484 } else if (frame_type == PJMEDIA_JB_ZERO_EMPTY_FRAME) { 485 /* Jitter buffer is empty. Check if this is the first "empty" 486 * state. 487 */ 488 if (frame_type != stream->jb_last_frm) { 489 pjmedia_jb_state jb_state; 490 491 /* Report the state of jitter buffer */ 492 pjmedia_jbuf_get_state(stream->jb, &jb_state); 493 PJ_LOG(5,(stream->port.info.name.ptr, 494 "Jitter buffer empty (prefetch=%d)", 495 jb_state.prefetch)); 496 } 497 } else { 498 pjmedia_jb_state jb_state; 499 500 /* It can only be PJMEDIA_JB_ZERO_PREFETCH frame */ 501 pj_assert(frame_type == PJMEDIA_JB_ZERO_PREFETCH_FRAME); 502 503 /* Get the state of jitter buffer */ 504 pjmedia_jbuf_get_state(stream->jb, &jb_state); 505 506 if (stream->jb_last_frm != frame_type) { 507 PJ_LOG(5,(stream->port.info.name.ptr, 508 "Jitter buffer is bufferring (prefetch=%d)", 509 jb_state.prefetch)); 510 } 511 } 512 } 513 514 stream->jb_last_frm = frame_type; 515 } 516 517 return PJ_SUCCESS; 518 } 519 520 411 521 /* 412 522 * Transmit DTMF … … 687 797 if (frame->type == PJMEDIA_FRAME_TYPE_AUDIO) 688 798 ts_len = (frame->size >> 1) / stream->codec_param.info.channel_cnt; 799 else if (frame->type == PJMEDIA_FRAME_TYPE_EXTENDED) 800 ts_len = stream->port.info.samples_per_frame / 801 stream->port.info.channel_count; 689 802 else 690 803 ts_len = 0; … … 753 866 } else if (frame->type == PJMEDIA_FRAME_TYPE_AUDIO && 754 867 frame->buf == NULL && 868 stream->port.info.format.id == PJMEDIA_FORMAT_L16 && 755 869 (stream->dir & PJMEDIA_DIR_ENCODING) && 756 870 stream->codec_param.info.frm_ptime * … … 1484 1598 stream->port.info.clock_rate = info->fmt.clock_rate; 1485 1599 stream->port.info.channel_count = info->fmt.channel_cnt; 1600 stream->port.info.format.id = info->param->info.fmt_id; 1486 1601 stream->port.port_data.pdata = stream; 1487 stream->port.put_frame = &put_frame; 1488 stream->port.get_frame = &get_frame; 1602 if (stream->port.info.format.id == PJMEDIA_FORMAT_L16) { 1603 stream->port.put_frame = &put_frame; 1604 stream->port.get_frame = &get_frame; 1605 } else { 1606 stream->port.info.format.bitrate = info->param->info.avg_bps; 1607 stream->port.info.format.vad = (info->param->setting.vad != 0); 1608 1609 stream->port.put_frame = &put_frame; 1610 stream->port.get_frame = &get_frame_ext; 1611 } 1489 1612 1490 1613 -
pjproject/trunk/pjmedia/src/pjmedia/transport_ice.c
r2394 r2506 22 22 #include <pj/assert.h> 23 23 #include <pj/log.h> 24 #include <pj/pool.h> 24 25 #include <pj/rand.h> 25 26 -
pjproject/trunk/pjmedia/src/pjmedia/transport_loop.c
r2394 r2506 23 23 #include <pj/ioqueue.h> 24 24 #include <pj/log.h> 25 #include <pj/pool.h> 25 26 #include <pj/rand.h> 26 27 #include <pj/string.h> -
pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
r2394 r2506 24 24 #include <pj/ioqueue.h> 25 25 #include <pj/log.h> 26 #include <pj/pool.h> 26 27 #include <pj/rand.h> 27 28 #include <pj/string.h> -
pjproject/trunk/pjproject-vs8.sln
r2430 r2506 13 13 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjlib_util_test", "pjlib-util\build\pjlib_util_test.vcproj", "{ED02BE13-8297-4770-8097-27DC2CCABF9A}" 14 14 ProjectSection(ProjectDependencies) = postProject 15 { DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8}16 { FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693}15 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 16 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 17 17 EndProjectSection 18 18 EndProject … … 29 29 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjsua", "pjsip-apps\build\pjsua.vcproj", "{8310649E-A25E-4AF0-91E8-9E3CC659BB89}" 30 30 ProjectSection(ProjectDependencies) = postProject 31 {4281CA5E-1D48-45D4-A991-2718A454B4BA} = {4281CA5E-1D48-45D4-A991-2718A454B4BA} 32 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} = {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} 33 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 34 {4BF51C21-5A30-423B-82FE-1ED410E5769D} = {4BF51C21-5A30-423B-82FE-1ED410E5769D} 35 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 36 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 37 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 38 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 39 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 40 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 41 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 42 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 43 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 44 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 45 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} = {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} 46 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 31 47 {E53AA5FF-B737-40AA-BD13-387EFA99023D} = {E53AA5FF-B737-40AA-BD13-387EFA99023D} 48 EndProjectSection 49 EndProject 50 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjsua_lib", "pjsip\build\pjsua_lib.vcproj", "{9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}" 51 EndProject 52 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample_debug", "pjsip-apps\build\sample_debug.vcproj", "{A0F1AA62-0F6F-420D-B09A-AC04B6862821}" 53 ProjectSection(ProjectDependencies) = postProject 54 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 55 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 56 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 57 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 58 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 59 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 60 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 61 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 62 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 63 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 64 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 65 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} = {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} 32 66 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 67 {E53AA5FF-B737-40AA-BD13-387EFA99023D} = {E53AA5FF-B737-40AA-BD13-387EFA99023D} 68 {4281CA5E-1D48-45D4-A991-2718A454B4BA} = {4281CA5E-1D48-45D4-A991-2718A454B4BA} 69 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} = {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} 70 EndProjectSection 71 EndProject 72 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "samples", "pjsip-apps\build\samples.vcproj", "{E378A1FC-0C9C-4462-860F-7E60BC1BF84E}" 73 ProjectSection(ProjectDependencies) = postProject 74 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} = {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} 75 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 76 {4BF51C21-5A30-423B-82FE-1ED410E5769D} = {4BF51C21-5A30-423B-82FE-1ED410E5769D} 77 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 78 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 79 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 80 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 81 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 82 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 83 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 84 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 85 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 86 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 33 87 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} = {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} 34 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 88 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 89 {E53AA5FF-B737-40AA-BD13-387EFA99023D} = {E53AA5FF-B737-40AA-BD13-387EFA99023D} 90 EndProjectSection 91 EndProject 92 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_pjsip", "pjsip\build\test_pjsip.vcproj", "{B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}" 93 ProjectSection(ProjectDependencies) = postProject 94 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 95 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 96 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 97 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 98 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 35 99 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 36 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 100 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 101 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 102 EndProjectSection 103 EndProject 104 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjnath", "pjnath\build\pjnath.vcproj", "{A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}" 105 EndProject 106 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgsmcodec", "third_party\build\gsm\libgsmcodec.vcproj", "{E53AA5FF-B737-40AA-BD13-387EFA99023D}" 107 EndProject 108 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libilbccodec", "third_party\build\ilbc\libilbccodec.vcproj", "{B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}" 109 EndProject 110 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libportaudio", "third_party\build\portaudio\libportaudio.vcproj", "{3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA}" 111 EndProject 112 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libresample", "third_party\build\resample\libresample.vcproj", "{6794B975-4E84-4F49-B2DC-C31F2224E03E}" 113 EndProject 114 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspeex", "third_party\build\speex\libspeex.vcproj", "{4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}" 115 EndProject 116 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libresample_dll", "third_party\build\resample\libresample_dll.vcproj", "{C48EAAF5-F69E-410B-9CE4-23AB41B00E2A}" 117 EndProject 118 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmilenage", "third_party\build\milenage\libmilenage.vcproj", "{4BF51C21-5A30-423B-82FE-1ED410E5769D}" 119 EndProject 120 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsrtp", "third_party\build\srtp\libsrtp.vcproj", "{F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}" 121 EndProject 122 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjnath_test", "pjnath\build\pjnath_test.vcproj", "{553C094C-F581-4A80-9540-D5D7B398A2C6}" 123 ProjectSection(ProjectDependencies) = postProject 124 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 125 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 126 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 127 EndProjectSection 128 EndProject 129 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjmedia_test", "pjmedia\build\pjmedia_test.vcproj", "{21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}" 130 ProjectSection(ProjectDependencies) = postProject 131 {4281CA5E-1D48-45D4-A991-2718A454B4BA} = {4281CA5E-1D48-45D4-A991-2718A454B4BA} 132 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} = {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} 133 {4BF51C21-5A30-423B-82FE-1ED410E5769D} = {4BF51C21-5A30-423B-82FE-1ED410E5769D} 134 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 135 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 136 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 137 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 138 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 37 139 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 38 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 39 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 40 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 41 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 42 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 43 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 44 {4BF51C21-5A30-423B-82FE-1ED410E5769D} = {4BF51C21-5A30-423B-82FE-1ED410E5769D} 45 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 46 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} = {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} 47 EndProjectSection 48 EndProject 49 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjsua_lib", "pjsip\build\pjsua_lib.vcproj", "{9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37}" 50 EndProject 51 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample_debug", "pjsip-apps\build\sample_debug.vcproj", "{A0F1AA62-0F6F-420D-B09A-AC04B6862821}" 52 ProjectSection(ProjectDependencies) = postProject 140 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 141 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} = {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} 53 142 {E53AA5FF-B737-40AA-BD13-387EFA99023D} = {E53AA5FF-B737-40AA-BD13-387EFA99023D} 54 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 55 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} = {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} 56 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 57 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 58 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 59 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 60 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 61 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 62 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 63 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 64 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 65 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 66 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 67 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} = {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} 68 EndProjectSection 69 EndProject 70 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "samples", "pjsip-apps\build\samples.vcproj", "{E378A1FC-0C9C-4462-860F-7E60BC1BF84E}" 71 ProjectSection(ProjectDependencies) = postProject 72 {E53AA5FF-B737-40AA-BD13-387EFA99023D} = {E53AA5FF-B737-40AA-BD13-387EFA99023D} 73 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 74 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} = {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} 75 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 76 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 77 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 78 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 79 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 80 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 81 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 82 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 83 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 84 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 85 {4BF51C21-5A30-423B-82FE-1ED410E5769D} = {4BF51C21-5A30-423B-82FE-1ED410E5769D} 86 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 87 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} = {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} 88 EndProjectSection 89 EndProject 90 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_pjsip", "pjsip\build\test_pjsip.vcproj", "{B3F7D4E9-702F-4EB4-ADA8-098D0A83D770}" 91 ProjectSection(ProjectDependencies) = postProject 92 {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} = {9CA0FDFB-2172-41FC-B7F1-5CE915EDCB37} 93 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 94 {B8719FD5-E8A6-4A36-943C-891D07F5DD21} = {B8719FD5-E8A6-4A36-943C-891D07F5DD21} 95 {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} = {4B5945CD-0CB3-49AA-A7FF-7612D93F82C0} 96 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 97 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 98 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 99 {2BB84911-C1B4-4747-B93D-36AA82CC5031} = {2BB84911-C1B4-4747-B93D-36AA82CC5031} 100 EndProjectSection 101 EndProject 102 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjnath", "pjnath\build\pjnath.vcproj", "{A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4}" 103 EndProject 104 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgsmcodec", "third_party\build\gsm\libgsmcodec.vcproj", "{E53AA5FF-B737-40AA-BD13-387EFA99023D}" 105 EndProject 106 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libilbccodec", "third_party\build\ilbc\libilbccodec.vcproj", "{B5FE16F8-3EDB-4110-BD80-B4238CC01E8D}" 107 EndProject 108 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libportaudio", "third_party\build\portaudio\libportaudio.vcproj", "{3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA}" 109 EndProject 110 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libresample", "third_party\build\resample\libresample.vcproj", "{6794B975-4E84-4F49-B2DC-C31F2224E03E}" 111 EndProject 112 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspeex", "third_party\build\speex\libspeex.vcproj", "{4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9}" 113 EndProject 114 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libresample_dll", "third_party\build\resample\libresample_dll.vcproj", "{C48EAAF5-F69E-410B-9CE4-23AB41B00E2A}" 115 EndProject 116 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libmilenage", "third_party\build\milenage\libmilenage.vcproj", "{4BF51C21-5A30-423B-82FE-1ED410E5769D}" 117 EndProject 118 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsrtp", "third_party\build\srtp\libsrtp.vcproj", "{F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858}" 119 EndProject 120 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjnath_test", "pjnath\build\pjnath_test.vcproj", "{553C094C-F581-4A80-9540-D5D7B398A2C6}" 121 ProjectSection(ProjectDependencies) = postProject 122 {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} = {A5D9AA24-08ED-48B9-BD65-F0A25E96BFC4} 123 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 124 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 125 EndProjectSection 126 EndProject 127 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjmedia_test", "pjmedia\build\pjmedia_test.vcproj", "{21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}" 128 ProjectSection(ProjectDependencies) = postProject 129 {E53AA5FF-B737-40AA-BD13-387EFA99023D} = {E53AA5FF-B737-40AA-BD13-387EFA99023D} 130 {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} = {B5FE16F8-3EDB-4110-BD80-B4238CC01E8D} 131 {DA0E03ED-53A7-4050-8A85-90541C5509F8} = {DA0E03ED-53A7-4050-8A85-90541C5509F8} 132 {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} = {855DC8C0-D3E9-4A2E-AE47-116605A7BC9B} 133 {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} = {4B059DBA-CD9C-4D0F-BE8C-FFB4EFD498E9} 134 {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} = {3CF9FFA9-8387-4635-9D1B-E7944CBEFEAA} 135 {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} = {7FDE3880-A4AB-49E3-B439-EBEF0A0C7A65} 136 {6794B975-4E84-4F49-B2DC-C31F2224E03E} = {6794B975-4E84-4F49-B2DC-C31F2224E03E} 137 {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} = {FE07F272-AE7F-4549-9E9F-EF9B80CB1693} 138 {4BF51C21-5A30-423B-82FE-1ED410E5769D} = {4BF51C21-5A30-423B-82FE-1ED410E5769D} 139 {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} = {F0DBAA03-1BA3-4E3B-A2CA-727E3D3AB858} 140 EndProjectSection 143 EndProjectSection 144 EndProject 145 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pjmedia_audiodev", "pjmedia\build\pjmedia_audiodev.vcproj", "{4281CA5E-1D48-45D4-A991-2718A454B4BA}" 141 146 EndProject 142 147 Global … … 386 391 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Build.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) 387 392 {21C0CECF-69DD-4F70-BC2B-9B4DE7F15277}.Release|Windows Mobile 6 Standard SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 6 Standard SDK (ARMV4I) 393 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug|Win32.ActiveCfg = Debug|Win32 394 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug|Win32.Build.0 = Debug|Win32 395 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Debug|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Debug|Win32 396 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release|Win32.ActiveCfg = Release|Win32 397 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release|Win32.Build.0 = Release|Win32 398 {4281CA5E-1D48-45D4-A991-2718A454B4BA}.Release|Windows Mobile 6 Standard SDK (ARMV4I).ActiveCfg = Release|Win32 388 399 EndGlobalSection 389 400 GlobalSection(SolutionProperties) = preSolution -
pjproject/trunk/pjproject.dsw
r2104 r2506 4 4 ############################################################################### 5 5 6 Project: "libgsmcodec"= .\THIRD_PARTY\BUILD\GSM\libgsmcodec.dsp- Package Owner=<4>7 8 Package=<5> 9 {{{ 10 }}} 11 12 Package=<4> 13 {{{ 14 }}} 15 16 ############################################################################### 17 18 Project: "libilbccodec"= .\THIRD_PARTY\BUILD\ILBC\libilbccodec.dsp- Package Owner=<4>19 20 Package=<5> 21 {{{ 22 }}} 23 24 Package=<4> 25 {{{ 26 }}} 27 28 ############################################################################### 29 30 Project: "libmilenage"= .\third_party\build\milenage\libmilenage.dsp- Package Owner=<4>31 32 Package=<5> 33 {{{ 34 }}} 35 36 Package=<4> 37 {{{ 38 }}} 39 40 ############################################################################### 41 42 Project: "libportaudio"= .\THIRD_PARTY\BUILD\PORTAUDIO\libportaudio.dsp- Package Owner=<4>43 44 Package=<5> 45 {{{ 46 }}} 47 48 Package=<4> 49 {{{ 50 }}} 51 52 ############################################################################### 53 54 Project: "libresample"= .\THIRD_PARTY\BUILD\RESAMPLE\libresample.dsp- Package Owner=<4>55 56 Package=<5> 57 {{{ 58 }}} 59 60 Package=<4> 61 {{{ 62 }}} 63 64 ############################################################################### 65 66 Project: "libresample_dll"= .\THIRD_PARTY\BUILD\RESAMPLE\libresample_dll.dsp- Package Owner=<4>67 68 Package=<5> 69 {{{ 70 }}} 71 72 Package=<4> 73 {{{ 74 }}} 75 76 ############################################################################### 77 78 Project: "libspeex"= .\third_party\build\speex\libspeex.dsp- Package Owner=<4>79 80 Package=<5> 81 {{{ 82 }}} 83 84 Package=<4> 85 {{{ 86 }}} 87 88 ############################################################################### 89 90 Project: "libsrtp"= .\third_party\build\srtp\libsrtp.dsp- Package Owner=<4>91 92 Package=<5> 93 {{{ 94 }}} 95 96 Package=<4> 97 {{{ 98 }}} 99 100 ############################################################################### 101 102 Project: "pjlib"= .\pjlib\build\pjlib.dsp- Package Owner=<4>103 104 Package=<5> 105 {{{ 106 }}} 107 108 Package=<4> 109 {{{ 110 }}} 111 112 ############################################################################### 113 114 Project: "pjlib_test"= .\pjlib\build\pjlib_test.dsp- Package Owner=<4>6 Project: "libgsmcodec"=".\THIRD_PARTY\BUILD\GSM\libgsmcodec.dsp" - Package Owner=<4> 7 8 Package=<5> 9 {{{ 10 }}} 11 12 Package=<4> 13 {{{ 14 }}} 15 16 ############################################################################### 17 18 Project: "libilbccodec"=".\THIRD_PARTY\BUILD\ILBC\libilbccodec.dsp" - Package Owner=<4> 19 20 Package=<5> 21 {{{ 22 }}} 23 24 Package=<4> 25 {{{ 26 }}} 27 28 ############################################################################### 29 30 Project: "libmilenage"=".\third_party\build\milenage\libmilenage.dsp" - Package Owner=<4> 31 32 Package=<5> 33 {{{ 34 }}} 35 36 Package=<4> 37 {{{ 38 }}} 39 40 ############################################################################### 41 42 Project: "libportaudio"=".\THIRD_PARTY\BUILD\PORTAUDIO\libportaudio.dsp" - Package Owner=<4> 43 44 Package=<5> 45 {{{ 46 }}} 47 48 Package=<4> 49 {{{ 50 }}} 51 52 ############################################################################### 53 54 Project: "libresample"=".\THIRD_PARTY\BUILD\RESAMPLE\libresample.dsp" - Package Owner=<4> 55 56 Package=<5> 57 {{{ 58 }}} 59 60 Package=<4> 61 {{{ 62 }}} 63 64 ############################################################################### 65 66 Project: "libresample_dll"=".\THIRD_PARTY\BUILD\RESAMPLE\libresample_dll.dsp" - Package Owner=<4> 67 68 Package=<5> 69 {{{ 70 }}} 71 72 Package=<4> 73 {{{ 74 }}} 75 76 ############################################################################### 77 78 Project: "libspeex"=".\third_party\build\speex\libspeex.dsp" - Package Owner=<4> 79 80 Package=<5> 81 {{{ 82 }}} 83 84 Package=<4> 85 {{{ 86 }}} 87 88 ############################################################################### 89 90 Project: "libsrtp"=".\third_party\build\srtp\libsrtp.dsp" - Package Owner=<4> 91 92 Package=<5> 93 {{{ 94 }}} 95 96 Package=<4> 97 {{{ 98 }}} 99 100 ############################################################################### 101 102 Project: "pjlib"=".\pjlib\build\pjlib.dsp" - Package Owner=<4> 103 104 Package=<5> 105 {{{ 106 }}} 107 108 Package=<4> 109 {{{ 110 }}} 111 112 ############################################################################### 113 114 Project: "pjlib_test"=".\pjlib\build\pjlib_test.dsp" - Package Owner=<4> 115 115 116 116 Package=<5> … … 157 157 ############################################################################### 158 158 159 Project: "pjmedia"=.\pjmedia\build\pjmedia.dsp - Package Owner=<4> 160 161 Package=<5> 162 {{{ 163 }}} 164 165 Package=<4> 166 {{{ 167 }}} 168 169 ############################################################################### 170 171 Project: "pjmedia_codec"=.\pjmedia\build\pjmedia_codec.dsp - Package Owner=<4> 172 173 Package=<5> 174 {{{ 175 }}} 176 177 Package=<4> 178 {{{ 179 }}} 180 181 ############################################################################### 182 183 Project: "pjmedia_test"=.\pjmedia\build\pjmedia_test.dsp - Package Owner=<4> 159 Project: "pjmedia"=".\pjmedia\build\pjmedia.dsp" - Package Owner=<4> 160 161 Package=<5> 162 {{{ 163 }}} 164 165 Package=<4> 166 {{{ 167 }}} 168 169 ############################################################################### 170 171 Project: "pjmedia_audiodev"=".\pjmedia\build\pjmedia_audiodev.dsp" - Package Owner=<4> 172 173 Package=<5> 174 {{{ 175 }}} 176 177 Package=<4> 178 {{{ 179 }}} 180 181 ############################################################################### 182 183 Project: "pjmedia_codec"=".\pjmedia\build\pjmedia_codec.dsp" - Package Owner=<4> 184 185 Package=<5> 186 {{{ 187 }}} 188 189 Package=<4> 190 {{{ 191 }}} 192 193 ############################################################################### 194 195 Project: "pjmedia_test"=".\pjmedia\build\pjmedia_test.dsp" - Package Owner=<4> 184 196 185 197 Package=<5> … … 222 234 Project_Dep_Name pjnath 223 235 End Project Dependency 224 }}} 225 226 ############################################################################### 227 228 Project: "pjnath"=.\pjnath\build\pjnath.dsp - Package Owner=<4> 229 230 Package=<5> 231 {{{ 232 }}} 233 234 Package=<4> 235 {{{ 236 }}} 237 238 ############################################################################### 239 240 Project: "pjnath_test"=.\pjnath\build\pjnath_test.dsp - Package Owner=<4> 241 242 Package=<5> 243 {{{ 244 }}} 245 246 Package=<4> 247 {{{ 248 Begin Project Dependency 249 Project_Dep_Name pjlib 250 End Project Dependency 251 Begin Project Dependency 252 Project_Dep_Name pjlib_util 253 End Project Dependency 254 Begin Project Dependency 255 Project_Dep_Name pjnath 256 End Project Dependency 257 }}} 258 259 ############################################################################### 260 261 Project: "pjsip_core"=.\pjsip\build\pjsip_core.dsp - Package Owner=<4> 262 263 Package=<5> 264 {{{ 265 }}} 266 267 Package=<4> 268 {{{ 269 }}} 270 271 ############################################################################### 272 273 Project: "pjsip_simple"=.\pjsip\build\pjsip_simple.dsp - Package Owner=<4> 274 275 Package=<5> 276 {{{ 277 }}} 278 279 Package=<4> 280 {{{ 281 }}} 282 283 ############################################################################### 284 285 Project: "pjsip_ua"=.\pjsip\build\pjsip_ua.dsp - Package Owner=<4> 236 Begin Project Dependency 237 Project_Dep_Name pjmedia_audiodev 238 End Project Dependency 239 }}} 240 241 ############################################################################### 242 243 Project: "pjnath"=".\pjnath\build\pjnath.dsp" - Package Owner=<4> 244 245 Package=<5> 246 {{{ 247 }}} 248 249 Package=<4> 250 {{{ 251 }}} 252 253 ############################################################################### 254 255 Project: "pjnath_test"=".\pjnath\build\pjnath_test.dsp" - Package Owner=<4> 256 257 Package=<5> 258 {{{ 259 }}} 260 261 Package=<4> 262 {{{ 263 Begin Project Dependency 264 Project_Dep_Name pjlib 265 End Project Dependency 266 Begin Project Dependency 267 Project_Dep_Name pjlib_util 268 End Project Dependency 269 Begin Project Dependency 270 Project_Dep_Name pjnath 271 End Project Dependency 272 }}} 273 274 ############################################################################### 275 276 Project: "pjsip_core"=".\pjsip\build\pjsip_core.dsp" - Package Owner=<4> 277 278 Package=<5> 279 {{{ 280 }}} 281 282 Package=<4> 283 {{{ 284 }}} 285 286 ############################################################################### 287 288 Project: "pjsip_simple"=".\pjsip\build\pjsip_simple.dsp" - Package Owner=<4> 289 290 Package=<5> 291 {{{ 292 }}} 293 294 Package=<4> 295 {{{ 296 }}} 297 298 ############################################################################### 299 300 Project: "pjsip_ua"=".\pjsip\build\pjsip_ua.dsp" - Package Owner=<4> 286 301 287 302 Package=<5> … … 351 366 Project_Dep_Name libsrtp 352 367 End Project Dependency 353 }}} 354 355 ############################################################################### 356 357 Project: "pjsua_lib"=.\pjsip\build\pjsua_lib.dsp - Package Owner=<4> 358 359 Package=<5> 360 {{{ 361 }}} 362 363 Package=<4> 364 {{{ 365 }}} 366 367 ############################################################################### 368 369 Project: "pjturn_client"=.\pjnath\build\pjturn_client.dsp - Package Owner=<4> 370 371 Package=<5> 372 {{{ 373 }}} 374 375 Package=<4> 376 {{{ 377 Begin Project Dependency 378 Project_Dep_Name pjlib 379 End Project Dependency 380 Begin Project Dependency 381 Project_Dep_Name pjlib_util 382 End Project Dependency 383 Begin Project Dependency 384 Project_Dep_Name pjnath 385 End Project Dependency 386 }}} 387 388 ############################################################################### 389 390 Project: "pjturn_srv"=.\pjnath\build\pjturn_srv.dsp - Package Owner=<4> 368 Begin Project Dependency 369 Project_Dep_Name pjmedia_audiodev 370 End Project Dependency 371 }}} 372 373 ############################################################################### 374 375 Project: "pjsua_lib"=".\pjsip\build\pjsua_lib.dsp" - Package Owner=<4> 376 377 Package=<5> 378 {{{ 379 }}} 380 381 Package=<4> 382 {{{ 383 }}} 384 385 ############################################################################### 386 387 Project: "pjturn_client"=".\pjnath\build\pjturn_client.dsp" - Package Owner=<4> 388 389 Package=<5> 390 {{{ 391 }}} 392 393 Package=<4> 394 {{{ 395 Begin Project Dependency 396 Project_Dep_Name pjlib 397 End Project Dependency 398 Begin Project Dependency 399 Project_Dep_Name pjlib_util 400 End Project Dependency 401 Begin Project Dependency 402 Project_Dep_Name pjnath 403 End Project Dependency 404 }}} 405 406 ############################################################################### 407 408 Project: "pjturn_srv"=".\pjnath\build\pjturn_srv.dsp" - Package Owner=<4> 391 409 392 410 Package=<5> … … 439 457 End Project Dependency 440 458 Begin Project Dependency 459 Project_Dep_Name libgsmcodec 460 End Project Dependency 461 Begin Project Dependency 462 Project_Dep_Name libilbccodec 463 End Project Dependency 464 Begin Project Dependency 465 Project_Dep_Name libportaudio 466 End Project Dependency 467 Begin Project Dependency 468 Project_Dep_Name libresample 469 End Project Dependency 470 Begin Project Dependency 471 Project_Dep_Name libspeex 472 End Project Dependency 473 Begin Project Dependency 474 Project_Dep_Name pjnath 475 End Project Dependency 476 Begin Project Dependency 477 Project_Dep_Name libsrtp 478 End Project Dependency 479 Begin Project Dependency 480 Project_Dep_Name pjmedia_audiodev 481 End Project Dependency 482 }}} 483 484 ############################################################################### 485 486 Project: "samples"=".\pjsip-apps\build\samples.dsp" - Package Owner=<4> 487 488 Package=<5> 489 {{{ 490 }}} 491 492 Package=<4> 493 {{{ 494 Begin Project Dependency 495 Project_Dep_Name pjlib 496 End Project Dependency 497 Begin Project Dependency 498 Project_Dep_Name pjlib_util 499 End Project Dependency 500 Begin Project Dependency 501 Project_Dep_Name pjmedia 502 End Project Dependency 503 Begin Project Dependency 504 Project_Dep_Name pjmedia_codec 505 End Project Dependency 506 Begin Project Dependency 507 Project_Dep_Name pjsip_core 508 End Project Dependency 509 Begin Project Dependency 510 Project_Dep_Name pjsip_simple 511 End Project Dependency 512 Begin Project Dependency 513 Project_Dep_Name pjsip_ua 514 End Project Dependency 515 Begin Project Dependency 441 516 Project_Dep_Name pjsua_lib 442 517 End Project Dependency … … 462 537 Project_Dep_Name libsrtp 463 538 End Project Dependency 464 }}} 465 466 ############################################################################### 467 468 Project: "samples"=".\pjsip-apps\build\samples.dsp" - Package Owner=<4> 539 Begin Project Dependency 540 Project_Dep_Name pjmedia_audiodev 541 End Project Dependency 542 }}} 543 544 ############################################################################### 545 546 Project: "test_pjsip"=".\pjsip\build\test_pjsip.dsp" - Package Owner=<4> 469 547 470 548 Package=<5> … … 498 576 Project_Dep_Name pjsua_lib 499 577 End Project Dependency 500 Begin Project Dependency501 Project_Dep_Name libgsmcodec502 End Project Dependency503 Begin Project Dependency504 Project_Dep_Name libilbccodec505 End Project Dependency506 Begin Project Dependency507 Project_Dep_Name libportaudio508 End Project Dependency509 Begin Project Dependency510 Project_Dep_Name libresample511 End Project Dependency512 Begin Project Dependency513 Project_Dep_Name libspeex514 End Project Dependency515 Begin Project Dependency516 Project_Dep_Name pjnath517 End Project Dependency518 Begin Project Dependency519 Project_Dep_Name libsrtp520 End Project Dependency521 }}}522 523 ###############################################################################524 525 Project: "test_pjsip"=.\pjsip\build\test_pjsip.dsp - Package Owner=<4>526 527 Package=<5>528 {{{529 }}}530 531 Package=<4>532 {{{533 Begin Project Dependency534 Project_Dep_Name pjlib535 End Project Dependency536 Begin Project Dependency537 Project_Dep_Name pjlib_util538 End Project Dependency539 Begin Project Dependency540 Project_Dep_Name pjmedia541 End Project Dependency542 Begin Project Dependency543 Project_Dep_Name pjmedia_codec544 End Project Dependency545 Begin Project Dependency546 Project_Dep_Name pjsip_core547 End Project Dependency548 Begin Project Dependency549 Project_Dep_Name pjsip_simple550 End Project Dependency551 Begin Project Dependency552 Project_Dep_Name pjsip_ua553 End Project Dependency554 Begin Project Dependency555 Project_Dep_Name pjsua_lib556 End Project Dependency557 578 }}} 558 579 -
pjproject/trunk/pjsip-apps/build/Makefile
r2183 r2506 9 9 PJNATH_LIB:=../../pjnath/lib/libpjnath-$(TARGET_NAME)$(LIBEXT) 10 10 PJMEDIA_LIB:=../../pjmedia/lib/libpjmedia-$(TARGET_NAME)$(LIBEXT) 11 PJMEDIA_AUDIODEV_LIB:=../../pjmedia/lib/libpjmedia-audiodev-$(TARGET_NAME)$(LIBEXT) 11 12 PJMEDIA_CODEC_LIB:=../../pjmedia/lib/libpjmedia-codec-$(TARGET_NAME)$(LIBEXT) 12 13 PJSIP_LIB:=../../pjsip/lib/libpjsip-$(TARGET_NAME)$(LIBEXT) -
pjproject/trunk/pjsip-apps/build/Samples-vc.mak
r2178 r2506 14 14 PJMEDIA_LIB = ..\..\pjmedia\lib\pjmedia-$(TARGET)$(LIBEXT) 15 15 PJMEDIA_CODEC_LIB = ..\..\pjmedia\lib\pjmedia-codec-$(TARGET)$(LIBEXT) 16 PJMEDIA_AUDIODEV_LIB = ..\..\pjmedia\lib\pjmedia-audiodev-$(TARGET)$(LIBEXT) 16 17 PJSIP_LIB = ..\..\pjsip\lib\pjsip-core-$(TARGET)$(LIBEXT) 17 18 PJSIP_UA_LIB = ..\..\pjsip\lib\pjsip-ua-$(TARGET)$(LIBEXT) … … 30 31 31 32 LIBS = $(PJSUA_LIB_LIB) $(PJSIP_UA_LIB) $(PJSIP_SIMPLE_LIB) \ 32 $(PJSIP_LIB) $(PJMEDIA_CODEC_LIB) $(PJMEDIA_ LIB) $(PJNATH_LIB) \33 $(PJ LIB_UTIL_LIB) $(PJLIB_LIB) \33 $(PJSIP_LIB) $(PJMEDIA_CODEC_LIB) $(PJMEDIA_AUDIODEV_LIB) \ 34 $(PJMEDIA_LIB) $(PJNATH_LIB) $(PJLIB_UTIL_LIB) $(PJLIB_LIB) \ 34 35 $(THIRD_PARTY_LIBS) 35 36 … … 50 51 51 52 52 SAMPLES = $(BINDIR)\confsample.exe \ 53 SAMPLES = $(BINDIR)\auddemo.exe \ 54 $(BINDIR)\confsample.exe \ 53 55 $(BINDIR)\confbench.exe \ 54 56 $(BINDIR)\encdec.exe \ … … 66 68 $(BINDIR)\siprtp.exe \ 67 69 $(BINDIR)\sipstateless.exe \ 68 $(BINDIR)\sndinfo.exe \69 $(BINDIR)\sndtest.exe \70 70 $(BINDIR)\stateful_proxy.exe \ 71 71 $(BINDIR)\stateless_proxy.exe \ -
pjproject/trunk/pjsip-apps/build/Samples.mak
r2183 r2506 14 14 BINDIR := ../bin/samples 15 15 16 SAMPLES := confsample \ 16 SAMPLES := auddemo \ 17 confsample \ 17 18 encdec \ 18 19 latency \ … … 29 30 siprtp \ 30 31 sipstateless \ 31 sndinfo \32 sndtest \33 32 stateful_proxy \ 34 33 stateless_proxy \ -
pjproject/trunk/pjsip-apps/build/sample_debug.dsp
r1765 r2506 91 91 92 92 SOURCE=..\src\samples\debug.c 93 94 !IF "$(CFG)" == "sample_debug - Win32 Release"95 96 !ELSEIF "$(CFG)" == "sample_debug - Win32 Debug"97 98 !ENDIF99 100 93 # End Source File 101 94 # End Group -
pjproject/trunk/pjsip-apps/build/samples.dsp
r2178 r2506 91 91 # Begin Source File 92 92 93 SOURCE=..\src\samples\auddemo.c 94 # End Source File 95 # Begin Source File 96 93 97 SOURCE=..\src\samples\confbench.c 94 98 # End Source File -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2505 r2506 4159 4159 app_config.cfg.cb.on_nat_detect = &on_nat_detect; 4160 4160 4161 /* Set sound device latency */ 4162 if (app_config.capture_lat > 0) 4163 app_config.media_cfg.snd_rec_latency = app_config.capture_lat; 4164 if (app_config.playback_lat) 4165 app_config.media_cfg.snd_play_latency = app_config.playback_lat; 4166 4161 4167 /* Initialize pjsua */ 4162 4168 status = pjsua_init(&app_config.cfg, &app_config.log_cfg, … … 4423 4429 if (status != PJ_SUCCESS) 4424 4430 goto on_error; 4425 4426 /* Set sound device latency */4427 pjmedia_snd_set_latency(app_config.capture_lat, app_config.playback_lat);4428 4431 4429 4432 /* Use null sound device? */ -
pjproject/trunk/pjsip-apps/src/samples/debug.c
r2394 r2506 29 29 * #include "playfile.c" 30 30 */ 31 #include "a ectest.c"31 #include "auddemo.c" 32 32 -
pjproject/trunk/pjsip-apps/src/symbian_ua/main_symbian.cpp
r2394 r2506 30 30 31 31 // Needed by APS 32 TPtrC APP_UID = _L(" A000000D");32 TPtrC APP_UID = _L("200235D3"); 33 33 34 34 -
pjproject/trunk/pjsip-apps/src/symbian_ua/ua.cpp
r2481 r2506 20 20 #include <pjsua-lib/pjsua.h> 21 21 #include <pjsua-lib/pjsua_internal.h> 22 //#include <pjmedia/symbian_sound_aps.h> 22 23 #include "ua.h" 23 24 24 25 #define THIS_FILE "symbian_ua.cpp" 25 #define LOG_LEVEL 3 26 #define CON_LOG_LEVEL 3 // console log level 27 #define FILE_LOG_LEVEL 4 // logfile log level 26 28 27 29 // … … 281 283 282 284 /* Set log level */ 283 pj_log_set_level( LOG_LEVEL);285 pj_log_set_level(CON_LOG_LEVEL); 284 286 285 287 /* Create pjsua first! */ … … 329 331 330 332 pjsua_logging_config_default(&log_cfg); 331 log_cfg.level = LOG_LEVEL;332 log_cfg.console_level = LOG_LEVEL;333 log_cfg.level = FILE_LOG_LEVEL; 334 log_cfg.console_level = CON_LOG_LEVEL; 333 335 log_cfg.cb = &log_writer; 334 //log_cfg.log_filename = pj_str("C:\\data\\symbian_ua.log");336 log_cfg.log_filename = pj_str("C:\\data\\symbian_ua.log"); 335 337 336 338 pjsua_media_config_default(&med_cfg); … … 338 340 med_cfg.has_ioqueue = PJ_FALSE; 339 341 med_cfg.clock_rate = 8000; 340 #if defined(PJMEDIA_SYM_SND_USE_APS) && (PJMEDIA_SYM_SND_USE_APS==1)341 med_cfg.audio_frame_ptime = 20;342 #else343 342 med_cfg.audio_frame_ptime = 40; 344 #endif345 343 med_cfg.ec_tail_len = 0; 346 344 med_cfg.enable_ice = USE_ICE; 347 med_cfg.snd_auto_close_time = 5; // wait for 5 seconds idle before sound dev get auto-closed 345 med_cfg.snd_auto_close_time = 0; // wait for 0 seconds idle before sound dev get auto-closed 346 //med_cfg.no_vad = PJ_TRUE; 348 347 349 348 status = pjsua_init(&cfg, &log_cfg, &med_cfg); … … 492 491 } 493 492 494 static void PrintMenu() 495 { 496 PJ_LOG(3, (THIS_FILE, "\n\n" 497 "Menu:\n" 498 " d Dump states\n" 499 " D Dump states detail\n" 500 " P Dump pool factory\n" 501 " l Start loopback audio device\n" 502 " L Stop loopback audio device\n" 493 static void PrintMainMenu() 494 { 495 const char *menu = 496 "\n\n" 497 "Main Menu:\n" 498 " d Enable/disable codecs\n" 503 499 " m Call " SIP_DST_URI "\n" 504 500 " a Answer call\n" 505 501 " g Hangup all calls\n" 502 " t Toggle audio route\n" 503 #if !defined(PJMEDIA_CONF_USE_SWITCH_BOARD) || PJMEDIA_CONF_USE_SWITCH_BOARD==0 504 " j Toggle loopback audio\n" 505 #endif 506 "up/dn Increase/decrease output volume\n" 506 507 " s Subscribe " SIP_DST_URI "\n" 507 508 " S Unsubscribe presence\n" 508 509 " o Set account online\n" 509 510 " O Set account offline\n" 510 " w Quit\n")); 511 " w Quit\n"; 512 513 PJ_LOG(3, (THIS_FILE, menu)); 514 } 515 516 static void PrintCodecMenu() 517 { 518 const char *menu = 519 "\n\n" 520 "Codec Menu:\n" 521 " a Enable all codecs\n" 522 #if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 523 " d Enable only AMR\n" 524 #endif 525 #if PJMEDIA_HAS_PASSTHROUGH_CODEC_G729 526 " g Enable only G.729\n" 527 #endif 528 #if PJMEDIA_HAS_PASSTHROUGH_CODEC_ILBC 529 " j Enable only iLBC\n" 530 #endif 531 " m Enable only Speex\n" 532 " p Enable only GSM\n" 533 " t Enable only PCMU\n" 534 " w Enable only PCMA\n"; 535 536 PJ_LOG(3, (THIS_FILE, menu)); 537 } 538 539 static void HandleMainMenu(TKeyCode kc) { 540 switch (kc) { 541 542 case EKeyUpArrow: 543 case EKeyDownArrow: 544 { 545 unsigned vol; 546 pj_status_t status; 547 548 status = pjsua_snd_get_setting( 549 PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, &vol); 550 if (status == PJ_SUCCESS) { 551 if (kc == EKeyUpArrow) 552 vol = PJ_MIN(100, vol+10); 553 else 554 vol = (vol>=10 ? vol-10 : 0); 555 status = pjsua_snd_set_setting( 556 PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, 557 &vol, PJ_TRUE); 558 } 559 560 if (status == PJ_SUCCESS) { 561 PJ_LOG(3,(THIS_FILE, "Output volume set to %d", vol)); 562 } else { 563 pjsua_perror(THIS_FILE, "Error setting volume", status); 564 } 565 } 566 break; 567 568 case 't': 569 { 570 pjmedia_aud_dev_route route; 571 pj_status_t status; 572 573 status = pjsua_snd_get_setting(PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, 574 &route); 575 576 if (status == PJ_SUCCESS) { 577 if (route == PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER) 578 route = PJMEDIA_AUD_DEV_ROUTE_EARPIECE; 579 else 580 route = PJMEDIA_AUD_DEV_ROUTE_LOUDSPEAKER; 581 582 status = pjsua_snd_set_setting( 583 PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, 584 &route, PJ_TRUE); 585 } 586 587 if (status != PJ_SUCCESS) 588 pjsua_perror(THIS_FILE, "Error switch audio route", status); 589 } 590 break; 591 592 case 'j': 593 { 594 static pj_bool_t loopback_active = PJ_FALSE; 595 if (!loopback_active) 596 pjsua_conf_connect(0, 0); 597 else 598 pjsua_conf_disconnect(0, 0); 599 loopback_active = !loopback_active; 600 } 601 break; 602 603 case 'm': 604 if (g_call_id != PJSUA_INVALID_ID) { 605 PJ_LOG(3,(THIS_FILE, "Another call is active")); 606 break; 607 } 608 609 if (pjsua_verify_sip_url(SIP_DST_URI) == PJ_SUCCESS) { 610 pj_str_t dst = pj_str(SIP_DST_URI); 611 pjsua_call_make_call(g_acc_id, &dst, 0, NULL, 612 NULL, &g_call_id); 613 } else { 614 PJ_LOG(3,(THIS_FILE, "Invalid SIP URI")); 615 } 616 break; 617 case 'a': 618 if (g_call_id != PJSUA_INVALID_ID) 619 pjsua_call_answer(g_call_id, 200, NULL, NULL); 620 break; 621 case 'g': 622 pjsua_call_hangup_all(); 623 break; 624 case 's': 625 case 'S': 626 if (g_buddy_id != PJSUA_INVALID_ID) 627 pjsua_buddy_subscribe_pres(g_buddy_id, kc=='s'); 628 break; 629 case 'o': 630 case 'O': 631 pjsua_acc_set_online_status(g_acc_id, kc=='o'); 632 break; 633 634 default: 635 PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed", kc, kc)); 636 break; 637 } 638 639 PrintMainMenu(); 640 } 641 642 static void HandleCodecMenu(TKeyCode kc) { 643 const pj_str_t ID_ALL = {"*", 1}; 644 pj_str_t codec = {NULL, 0}; 645 646 if (kc == 'a') { 647 pjsua_codec_set_priority(&ID_ALL, PJMEDIA_CODEC_PRIO_NORMAL); 648 PJ_LOG(3,(THIS_FILE, "All codecs activated")); 649 } else { 650 switch (kc) { 651 case 'd': 652 codec = pj_str("AMR"); 653 break; 654 case 'g': 655 codec = pj_str("G729"); 656 break; 657 case 'j': 658 codec = pj_str("ILBC"); 659 break; 660 case 'm': 661 codec = pj_str("SPEEX/8000"); 662 break; 663 case 'p': 664 codec = pj_str("GSM"); 665 break; 666 case 't': 667 codec = pj_str("PCMU"); 668 break; 669 case 'w': 670 codec = pj_str("PCMA"); 671 break; 672 default: 673 PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed", kc, kc)); 674 break; 675 } 676 677 if (codec.slen) { 678 pj_status_t status; 679 680 pjsua_codec_set_priority(&ID_ALL, PJMEDIA_CODEC_PRIO_DISABLED); 681 682 status = pjsua_codec_set_priority(&codec, 683 PJMEDIA_CODEC_PRIO_NORMAL); 684 if (status == PJ_SUCCESS) 685 PJ_LOG(3,(THIS_FILE, "%s activated", codec.ptr)); 686 else 687 PJ_LOG(3,(THIS_FILE, "Failed activating %s, err=%d", 688 codec.ptr, status)); 689 } 690 } 511 691 } 512 692 … … 514 694 void ConsoleUI::RunL() 515 695 { 696 enum { 697 MENU_TYPE_MAIN = 0, 698 MENU_TYPE_CODEC = 1 699 }; 700 static int menu_type = MENU_TYPE_MAIN; 516 701 TKeyCode kc = con_->KeyCode(); 517 702 pj_bool_t reschedule = PJ_TRUE; 518 703 519 switch (kc) {520 case 'w': 704 if (menu_type == MENU_TYPE_MAIN) { 705 if (kc == 'w') { 521 706 CActiveScheduler::Stop(); 522 707 reschedule = PJ_FALSE; 523 break; 524 case 'D': 525 case 'd': 526 pjsua_dump(kc == 'D'); 527 break; 528 case 'p': 529 case 'P': 530 pj_pool_factory_dump(pjsua_get_pool_factory(), PJ_TRUE); 531 break; 532 case 'l': 533 pjsua_conf_connect(0, 0); 534 break; 535 case 'L': 536 pjsua_conf_disconnect(0, 0); 537 break; 538 case 'm': 539 if (g_call_id != PJSUA_INVALID_ID) { 540 PJ_LOG(3,(THIS_FILE, "Another call is active")); 541 break; 542 } 543 544 if (pjsua_verify_sip_url(SIP_DST_URI) == PJ_SUCCESS) { 545 pj_str_t dst = pj_str(SIP_DST_URI); 546 pjsua_call_make_call(g_acc_id, &dst, 0, NULL, 547 NULL, &g_call_id); 548 } else { 549 PJ_LOG(3,(THIS_FILE, "Invalid SIP URI")); 550 } 551 break; 552 case 'a': 553 if (g_call_id != PJSUA_INVALID_ID) 554 pjsua_call_answer(g_call_id, 200, NULL, NULL); 555 break; 556 case 'g': 557 pjsua_call_hangup_all(); 558 break; 559 case 's': 560 case 'S': 561 if (g_buddy_id != PJSUA_INVALID_ID) 562 pjsua_buddy_subscribe_pres(g_buddy_id, kc=='s'); 563 break; 564 case 'o': 565 case 'O': 566 pjsua_acc_set_online_status(g_acc_id, kc=='o'); 567 break; 568 default: 569 PJ_LOG(3,(THIS_FILE, "Keycode '%c' (%d) is pressed", 570 kc, kc)); 571 break; 572 } 573 574 PrintMenu(); 708 } else if (kc == 'd') { 709 menu_type = MENU_TYPE_CODEC; 710 PrintCodecMenu(); 711 } else { 712 HandleMainMenu(kc); 713 } 714 } else { 715 HandleCodecMenu(kc); 716 717 menu_type = MENU_TYPE_MAIN; 718 PrintMainMenu(); 719 } 575 720 576 721 if (reschedule) … … 816 961 817 962 PJ_LOG(3, (THIS_FILE, "PJSUA restarted.")); 818 PrintM enu();963 PrintMainMenu(); 819 964 } 820 965 … … 874 1019 875 1020 con->Run(); 876 PrintM enu();1021 PrintMainMenu(); 877 1022 878 1023 // Init & start connection monitor … … 911 1056 aConn.Close(); 912 1057 aSocketServer.Close(); 913 1058 914 1059 return status; 915 1060 } -
pjproject/trunk/pjsip-apps/src/symbian_ua_gui/group/symbian_ua_gui.mmp
r2257 r2506 40 40 STATICLIBRARY pjsua_lib.lib pjsip_ua.lib 41 41 STATICLIBRARY pjsip_simple.lib pjsip.lib pjsdp.lib pjmedia.lib 42 STATICLIBRARY pjmedia_audiodev.lib 42 43 STATICLIBRARY pjnath.lib pjlib_util.lib pjlib.lib 43 44 STATICLIBRARY libsrtp.lib … … 50 51 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment 51 52 #elif SND_USE_APS 52 STATICLIBRARY symbian_audio_aps.lib 53 LIBRARY APSSession2.lib 53 LIBRARY APSSession2.lib 54 54 CAPABILITY NetworkServices LocalServices ReadUserData WriteUserData UserEnvironment MultimediaDD 55 MACRO PJMEDIA_SYM_SND_USE_APS=155 MACRO PJMEDIA_SYM_SND_USE_APS=1 56 56 #else 57 STATICLIBRARY symbian_audio.lib58 57 LIBRARY mediaclientaudiostream.lib 59 58 LIBRARY mediaclientaudioinputstream.lib -
pjproject/trunk/pjsip-apps/src/symsndtest/app_main.cpp
r2394 r2506 50 50 51 51 PJ_UNUSED_ARG(level); 52 52 53 53 pj_ansi_to_unicode(buf, len, buf16, PJ_ARRAY_SIZE(buf16)); 54 54 … … 58 58 59 59 /* perror util */ 60 static void app_perror(const char *title, pj_status_t status) 61 { 62 char errmsg[PJ_ERR_MSG_SIZE]; 60 static void app_perror(const char *title, pj_status_t status) 61 { 62 char errmsg[PJ_ERR_MSG_SIZE]; 63 63 pj_strerror(status, errmsg, sizeof(errmsg)); 64 64 PJ_LOG(1,(THIS_FILE, "Error: %s: %s", title, errmsg)); … … 66 66 67 67 /* Application init */ 68 static pj_status_t app_init() 68 static pj_status_t app_init() 69 69 { 70 70 unsigned i, count; 71 71 pj_status_t status; 72 72 73 73 /* Redirect log */ 74 74 pj_log_set_log_func((void (*)(int,const char*,int)) &log_writer); 75 75 pj_log_set_decor(PJ_LOG_HAS_NEWLINE); 76 76 pj_log_set_level(3); 77 77 78 78 /* Init pjlib */ 79 79 status = pj_init(); … … 84 84 85 85 pj_caching_pool_init(&cp, NULL, 0); 86 86 87 87 /* Init sound subsystem */ 88 88 status = pjmedia_snd_init(&cp.factory); … … 93 93 return status; 94 94 } 95 95 96 96 count = pjmedia_snd_get_dev_count(); 97 97 PJ_LOG(3,(THIS_FILE, "Device count: %d", count)); 98 98 for (i=0; i<count; ++i) { 99 99 const pjmedia_snd_dev_info *info; 100 100 101 101 info = pjmedia_snd_get_dev_info(i); 102 102 PJ_LOG(3, (THIS_FILE, "%d: %s %d/%d %dHz", 103 103 i, info->name, info->input_count, info->output_count, 104 info->default_samples_per_sec)); 104 info->default_samples_per_sec)); 105 105 } 106 106 … … 115 115 116 116 /* Init delay buffer */ 117 status = pjmedia_delay_buf_create(pool, THIS_FILE, CLOCK_RATE, 118 SAMPLES_PER_FRAME, CHANNEL_COUNT, 117 status = pjmedia_delay_buf_create(pool, THIS_FILE, CLOCK_RATE, 118 SAMPLES_PER_FRAME, CHANNEL_COUNT, 119 119 0, 0, &delaybuf); 120 120 if (status != PJ_SUCCESS) { … … 124 124 //return status; 125 125 } 126 126 127 127 return PJ_SUCCESS; 128 128 } … … 130 130 131 131 /* Sound capture callback */ 132 static pj_status_t rec_cb(void *user_data, 132 static pj_status_t rec_cb(void *user_data, 133 133 pj_uint32_t timestamp, 134 134 void *input, 135 unsigned size) 135 unsigned size) 136 136 { 137 137 PJ_UNUSED_ARG(user_data); … … 154 154 pj_uint32_t timestamp, 155 155 void *output, 156 unsigned size) 156 unsigned size) 157 157 { 158 158 PJ_UNUSED_ARG(user_data); 159 159 PJ_UNUSED_ARG(timestamp); 160 160 PJ_UNUSED_ARG(size); 161 161 162 162 pjmedia_delay_buf_get(delaybuf, (pj_int16_t*)output); 163 163 164 164 ++play_cnt; 165 return PJ_SUCCESS; 165 return PJ_SUCCESS; 166 166 } 167 167 168 168 /* Start sound */ 169 static pj_status_t snd_start(unsigned flag) 169 static pj_status_t snd_start(unsigned flag) 170 170 { 171 171 pj_status_t status; 172 172 173 173 if (strm != NULL) { 174 174 app_perror("snd already open", PJ_EINVALIDOP); 175 175 return PJ_EINVALIDOP; 176 176 } 177 177 178 178 if (flag==PJMEDIA_DIR_CAPTURE_PLAYBACK) 179 179 status = pjmedia_snd_open(-1, -1, CLOCK_RATE, CHANNEL_COUNT, … … 188 188 SAMPLES_PER_FRAME, BITS_PER_SAMPLE, 189 189 &play_cb, NULL, &strm); 190 190 191 191 if (status != PJ_SUCCESS) { 192 192 app_perror("snd open", status); … … 211 211 212 212 /* Stop sound */ 213 static pj_status_t snd_stop() 213 static pj_status_t snd_stop() 214 214 { 215 215 pj_time_val now; 216 216 pj_status_t status; 217 217 218 218 if (strm == NULL) { 219 219 app_perror("snd not open", PJ_EINVALIDOP); 220 220 return PJ_EINVALIDOP; 221 221 } 222 222 223 status = pjmedia_snd_stream_stop(strm); 224 if (status != PJ_SUCCESS) { 225 app_perror("snd failed to stop", status); 226 } 223 227 status = pjmedia_snd_stream_close(strm); 224 228 strm = NULL; 225 229 226 230 pj_gettimeofday(&now); 227 231 PJ_TIME_VAL_SUB(now, t_start); … … 235 239 236 240 /* Shutdown application */ 237 static void app_fini() 241 static void app_fini() 238 242 { 239 243 if (strm) 240 244 snd_stop(); 241 245 242 246 pjmedia_snd_deinit(); 243 247 pjmedia_delay_buf_destroy(delaybuf); … … 254 258 #include <e32base.h> 255 259 256 class ConsoleUI : public CActive 260 class ConsoleUI : public CActive 257 261 { 258 262 public: 259 ConsoleUI(C ActiveSchedulerWait *asw, CConsoleBase *con);263 ConsoleUI(CConsoleBase *con); 260 264 261 265 // Run console UI … … 264 268 // Stop 265 269 void Stop(); 266 270 267 271 protected: 268 272 // Cancel asynchronous read. … … 271 275 // Implementation: called when read has completed. 272 276 void RunL(); 273 277 274 278 private: 275 CActiveSchedulerWait *asw_;276 279 CConsoleBase *con_; 277 280 }; 278 281 279 282 280 ConsoleUI::ConsoleUI(C ActiveSchedulerWait *asw, CConsoleBase *con)281 : CActive(EPriority High), asw_(asw), con_(con)283 ConsoleUI::ConsoleUI(CConsoleBase *con) 284 : CActive(EPriorityUserInput), con_(con) 282 285 { 283 286 CActiveScheduler::Add(this); … … 285 288 286 289 // Run console UI 287 void ConsoleUI::Run() 290 void ConsoleUI::Run() 288 291 { 289 292 con_->Read(iStatus); … … 292 295 293 296 // Stop console UI 294 void ConsoleUI::Stop() 297 void ConsoleUI::Stop() 295 298 { 296 299 DoCancel(); … … 298 301 299 302 // Cancel asynchronous read. 300 void ConsoleUI::DoCancel() 303 void ConsoleUI::DoCancel() 301 304 { 302 305 con_->ReadCancel(); 303 306 } 304 307 305 static void PrintMenu() 308 static void PrintMenu() 306 309 { 307 310 PJ_LOG(3, (THIS_FILE, "\n\n" … … 315 318 316 319 // Implementation: called when read has completed. 317 void ConsoleUI::RunL() 320 void ConsoleUI::RunL() 318 321 { 319 322 TKeyCode kc = con_->KeyCode(); 320 323 pj_bool_t reschedule = PJ_TRUE; 321 324 322 325 switch (kc) { 323 326 case 'w': 324 asw_->AsyncStop(); 327 snd_stop(); 328 CActiveScheduler::Stop(); 325 329 reschedule = PJ_FALSE; 326 330 break; … … 344 348 345 349 PrintMenu(); 346 350 347 351 if (reschedule) 348 352 Run(); … … 351 355 352 356 //////////////////////////////////////////////////////////////////////////// 353 int app_main() 357 int app_main() 354 358 { 355 359 if (app_init() != PJ_SUCCESS) 356 360 return -1; 357 361 358 362 // Run the UI 359 CActiveSchedulerWait *asw = new CActiveSchedulerWait; 360 ConsoleUI *con = new ConsoleUI(asw, console); 361 363 ConsoleUI *con = new ConsoleUI(console); 364 362 365 con->Run(); 363 366 364 367 PrintMenu(); 365 asw->Start();366 368 CActiveScheduler::Start(); 369 367 370 delete con; 368 delete asw; 369 371 370 372 app_fini(); 371 373 return 0; -
pjproject/trunk/pjsip-apps/src/symsndtest/main_symbian.cpp
r2394 r2506 30 30 31 31 // Needed by APS 32 TPtrC APP_UID = _L("A000000 D");32 TPtrC APP_UID = _L("A000000E"); 33 33 34 34 int app_main(); 35 35 36 37 ////////////////////////////////////////////////////////////////////////////38 class MyTask : public CActive39 {40 public:41 static MyTask *NewL(CActiveSchedulerWait *asw);42 ~MyTask();43 void Start();44 45 protected:46 MyTask(CActiveSchedulerWait *asw);47 void ConstructL();48 virtual void RunL();49 virtual void DoCancel();50 51 private:52 RTimer timer_;53 CActiveSchedulerWait *asw_;54 };55 56 MyTask::MyTask(CActiveSchedulerWait *asw)57 : CActive(EPriorityNormal), asw_(asw)58 {59 }60 61 MyTask::~MyTask()62 {63 timer_.Close();64 }65 66 void MyTask::ConstructL()67 {68 timer_.CreateLocal();69 CActiveScheduler::Add(this);70 }71 72 MyTask *MyTask::NewL(CActiveSchedulerWait *asw)73 {74 MyTask *self = new (ELeave) MyTask(asw);75 CleanupStack::PushL(self);76 77 self->ConstructL();78 79 CleanupStack::Pop(self);80 return self;81 }82 83 void MyTask::Start()84 {85 timer_.After(iStatus, 0);86 SetActive();87 }88 89 void MyTask::RunL()90 {91 int rc = app_main();92 asw_->AsyncStop();93 }94 95 void MyTask::DoCancel()96 {97 98 }99 36 100 37 //////////////////////////////////////////////////////////////////////////// … … 106 43 CActiveScheduler::Install(scheduler); 107 44 108 CActiveSchedulerWait *asw = new CActiveSchedulerWait; 109 CleanupStack::PushL(asw); 110 111 MyTask *task = MyTask::NewL(asw); 112 task->Start(); 45 app_main(); 113 46 114 asw->Start();115 116 delete task;117 118 CleanupStack::Pop(asw);119 delete asw;120 121 47 CActiveScheduler::Install(NULL); 122 48 CleanupStack::Pop(scheduler); … … 143 69 TRAPD(startError, DoStartL()); 144 70 145 console->Printf(_L("[press any key to close]\n"));146 console->Getch();147 71 //console->Printf(_L("[press any key to close]\n")); 72 //console->Getch(); 73 148 74 delete console; 149 75 delete cleanup; 150 76 151 CloseSTDLIB(); 77 CloseSTDLIB(); 152 78 153 79 // Mark end of heap usage, detect memory leaks -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r2394 r2506 4201 4201 unsigned ec_tail_len; 4202 4202 4203 /** 4204 * Audio capture buffer length, in milliseconds. 4205 * 4206 * Default: PJMEDIA_SND_DEFAULT_REC_LATENCY 4207 */ 4208 unsigned snd_rec_latency; 4209 4210 /** 4211 * Audio playback buffer length, in milliseconds. 4212 * 4213 * Default: PJMEDIA_SND_DEFAULT_PLAY_LATENCY 4214 */ 4215 unsigned snd_play_latency; 4216 4203 4217 /** 4204 4218 * Jitter buffer initial prefetch delay in msec. The value must be … … 4273 4287 /** 4274 4288 * Specify idle time of sound device before it is automatically closed, 4275 * in seconds. 4276 * 4277 * Default : -1 (Disable the auto-close feature of sound device) 4289 * in seconds. Use value -1 to disable the auto-close feature of sound 4290 * device 4291 * 4292 * Default : 1 4278 4293 */ 4279 4294 int snd_auto_close_time; … … 4788 4803 4789 4804 /** 4790 * Enum all sounddevices installed in the system.4805 * Enum all audio devices installed in the system. 4791 4806 * 4792 4807 * @param info Array of info to be initialized. … … 4796 4811 * 4797 4812 * @return PJ_SUCCESS on success, or the appropriate error code. 4813 */ 4814 PJ_DECL(pj_status_t) pjsua_enum_aud_devs(pjmedia_aud_dev_info info[], 4815 unsigned *count); 4816 4817 /** 4818 * Enum all sound devices installed in the system (old API). 4819 * 4820 * @param info Array of info to be initialized. 4821 * @param count On input, specifies max elements in the array. 4822 * On return, it contains actual number of elements 4823 * that have been initialized. 4824 * 4825 * @return PJ_SUCCESS on success, or the appropriate error code. 4798 4826 * 4799 4827 * … … 4807 4835 PJ_DECL(pj_status_t) pjsua_enum_snd_devs(pjmedia_snd_dev_info info[], 4808 4836 unsigned *count); 4809 4810 4811 4837 4812 4838 /** … … 4880 4906 4881 4907 /** 4882 * Configure the echo canceller tail length of the sound port. 4908 * Change the echo cancellation settings. 4909 * 4910 * The behavior of this function depends on whether the sound device is 4911 * currently active, and if it is, whether device or software AEC is 4912 * being used. 4913 * 4914 * If the sound device is currently active, and if the device supports AEC, 4915 * this function will forward the change request to the device and it will 4916 * be up to the device on whether support the request. If software AEC is 4917 * being used (the software EC will be used if the device does not support 4918 * AEC), this function will change the software EC settings. In all cases, 4919 * the setting will be saved for future opening of the sound device. 4920 * 4921 * If the sound device is not currently active, this will only change the 4922 * default AEC settings and the setting will be applied next time the 4923 * sound device is opened. 4883 4924 * 4884 4925 * @param tail_ms The tail length, in miliseconds. Set to zero to … … 4898 4939 4899 4940 /** 4900 * Get current echo canceller tail length. 4941 * Get current echo canceller tail length. 4901 4942 * 4902 4943 * @param p_tail_ms Pointer to receive the tail length, in miliseconds. … … 4912 4953 PJ_DECL(pj_status_t) pjsua_get_ec_tail(unsigned *p_tail_ms); 4913 4954 4955 4956 /** 4957 * Check whether the sound device is currently active. The sound device 4958 * may be inactive if the application has set the auto close feature to 4959 * non-zero (the snd_auto_close_time setting in #pjsua_media_config), or 4960 * if null sound device or no sound device has been configured via the 4961 * #pjsua_set_no_snd_dev() function. 4962 */ 4963 PJ_DECL(pj_bool_t) pjsua_snd_is_active(void); 4964 4965 4966 /** 4967 * Configure sound device setting to the sound device being used. If sound 4968 * device is currently active, the function will forward the setting to the 4969 * sound device instance to be applied immediately, if it supports it. 4970 * 4971 * The setting will be saved for future opening of the sound device, if the 4972 * "keep" argument is set to non-zero. If the sound device is currently 4973 * inactive, and the "keep" argument is false, this function will return 4974 * error. 4975 * 4976 * Note that in case the setting is kept for future use, it will be applied 4977 * to any devices, even when application has changed the sound device to be 4978 * used. 4979 * 4980 * Note also that the echo cancellation setting should be set with 4981 * #pjsua_set_ec() API instead. 4982 * 4983 * See also #pjmedia_aud_stream_set_cap() for more information about setting 4984 * an audio device capability. 4985 * 4986 * @param cap The sound device setting to change. 4987 * @param pval Pointer to value. Please see #pjmedia_aud_dev_cap 4988 * documentation about the type of value to be 4989 * supplied for each setting. 4990 * @param keep Specify whether the setting is to be kept for future 4991 * use. 4992 * 4993 * @return PJ_SUCCESS on success or the appropriate error code. 4994 */ 4995 PJ_DECL(pj_status_t) pjsua_snd_set_setting(pjmedia_aud_dev_cap cap, 4996 const void *pval, 4997 pj_bool_t keep); 4998 4999 /** 5000 * Retrieve a sound device setting. If sound device is currently active, 5001 * the function will forward the request to the sound device. If sound device 5002 * is currently inactive, and if application had previously set the setting 5003 * and mark the setting as kept, then that setting will be returned. 5004 * Otherwise, this function will return error. 5005 * 5006 * Note that echo cancellation settings should be retrieved with 5007 * #pjsua_get_ec_tail() API instead. 5008 * 5009 * @param cap The sound device setting to retrieve. 5010 * @param pval Pointer to receive the value. 5011 * Please see #pjmedia_aud_dev_cap documentation about 5012 * the type of value to be supplied for each setting. 5013 * 5014 * @return PJ_SUCCESS on success or the appropriate error code. 5015 */ 5016 PJ_DECL(pj_status_t) pjsua_snd_get_setting(pjmedia_aud_dev_cap cap, 5017 void *pval); 4914 5018 4915 5019 -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
r2394 r2506 273 273 pjsua_conf_setting mconf_cfg; /**< Additionan conf. bridge. param */ 274 274 pjmedia_conf *mconf; /**< Conference bridge. */ 275 int cap_dev; /**< Capture device ID. */ 276 int play_dev; /**< Playback device ID. */ 275 pj_bool_t is_mswitch;/**< Are we using audio switchboard 276 (a.k.a APS-Direct) */ 277 278 /* Sound device */ 279 pjmedia_aud_dev_index cap_dev; /**< Capture device ID. */ 280 pjmedia_aud_dev_index play_dev; /**< Playback device ID. */ 281 pj_uint32_t aud_svmask;/**< Which settings to save */ 282 pjmedia_aud_param aud_param; /**< User settings to sound dev */ 283 pj_bool_t aud_open_cnt;/**< How many # device is opened */ 277 284 pj_bool_t no_snd; /**< No sound (app will manage it) */ 278 285 pj_pool_t *snd_pool; /**< Sound's private pool. */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r2394 r2506 371 371 PJSUA_LOCK(); 372 372 373 /* Create sound port if none is instantiated */ 374 if (pjsua_var.snd_port==NULL && pjsua_var.null_snd==NULL && 375 !pjsua_var.no_snd) 373 /* Create sound port if none is instantiated, to check if sound device 374 * can be used. But only do this with the conference bridge, as with 375 * audio switchboard (i.e. APS-Direct), we can only open the sound 376 * device once the correct format has been known 377 */ 378 if (!pjsua_var.is_mswitch && pjsua_var.snd_port==NULL && 379 pjsua_var.null_snd==NULL && !pjsua_var.no_snd) 376 380 { 377 381 pj_status_t status; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r2481 r2506 178 178 cfg->ilbc_mode = PJSUA_DEFAULT_ILBC_MODE; 179 179 cfg->ec_tail_len = PJSUA_DEFAULT_EC_TAIL_LEN; 180 cfg->snd_rec_latency = PJMEDIA_SND_DEFAULT_REC_LATENCY; 181 cfg->snd_play_latency = PJMEDIA_SND_DEFAULT_PLAY_LATENCY; 180 182 cfg->jb_init = cfg->jb_min_pre = cfg->jb_max_pre = cfg->jb_max = -1; 181 cfg->snd_auto_close_time = -1;183 cfg->snd_auto_close_time = 1; 182 184 183 185 cfg->turn_conn_type = PJ_TURN_TP_UDP; … … 582 584 583 585 /* Set default sound device ID */ 584 pjsua_var.cap_dev = pjsua_var.play_dev = -1; 586 pjsua_var.cap_dev = PJMEDIA_AUD_DEFAULT_CAPTURE_DEV; 587 pjsua_var.play_dev = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV; 585 588 586 589 /* Init caching pool. */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r2425 r2506 36 36 static pj_uint16_t next_rtp_port; 37 37 38 /* Open sound dev */ 39 static pj_status_t open_snd_dev(pjmedia_aud_param *param); 38 40 /* Close existing sound device */ 39 41 static void close_snd_dev(void); 42 /* Create audio device param */ 43 static pj_status_t create_aud_param(pjmedia_aud_param *param, 44 pjmedia_aud_dev_index capture_dev, 45 pjmedia_aud_dev_index playback_dev, 46 unsigned clock_rate, 47 unsigned channel_count, 48 unsigned samples_per_frame, 49 unsigned bits_per_sample); 40 50 41 51 … … 60 70 /* To suppress warning about unused var when all codecs are disabled */ 61 71 PJ_UNUSED_ARG(codec_id); 72 73 /* Specify which audio device settings are save-able */ 74 pjsua_var.aud_svmask = 0xFFFFFFFF; 75 /* These are not-settable */ 76 pjsua_var.aud_svmask &= ~(PJMEDIA_AUD_DEV_CAP_EXT_FORMAT | 77 PJMEDIA_AUD_DEV_CAP_INPUT_SIGNAL_METER | 78 PJMEDIA_AUD_DEV_CAP_OUTPUT_SIGNAL_METER); 79 /* EC settings use different API */ 80 pjsua_var.aud_svmask &= ~(PJMEDIA_AUD_DEV_CAP_EC | 81 PJMEDIA_AUD_DEV_CAP_EC_TAIL); 62 82 63 83 /* Copy configuration */ … … 172 192 173 193 #endif /* PJMEDIA_HAS_INTEL_IPP */ 194 195 #if PJMEDIA_HAS_PASSTHROUGH_CODECS 196 /* Register passthrough codecs */ 197 status = pjmedia_codec_passthrough_init(pjsua_var.med_endpt); 198 if (status != PJ_SUCCESS) { 199 pjsua_perror(THIS_FILE, "Error initializing passthrough codecs", 200 status); 201 return status; 202 } 203 #endif /* PJMEDIA_HAS_PASSTHROUGH_CODECS */ 174 204 175 205 #if PJMEDIA_HAS_L16_CODEC … … 226 256 return status; 227 257 } 258 259 /* Are we using the audio switchboard (a.k.a APS-Direct)? */ 260 pjsua_var.is_mswitch = pjmedia_conf_get_master_port(pjsua_var.mconf) 261 ->info.signature == PJMEDIA_CONF_SWITCH_SIGNATURE; 228 262 229 263 /* Create null port just in case user wants to use null sound. */ … … 574 608 pjmedia_codec_ipp_deinit(); 575 609 # endif /* PJMEDIA_HAS_INTEL_IPP */ 610 611 # if PJMEDIA_HAS_PASSTHROUGH_CODECS 612 pjmedia_codec_passthrough_deinit(); 613 # endif /* PJMEDIA_HAS_PASSTHROUGH_CODECS */ 576 614 577 615 # if PJMEDIA_HAS_L16_CODEC … … 1496 1534 } 1497 1535 1498 1499 1536 /* 1500 1537 * Get maxinum number of conference ports. … … 1611 1648 } 1612 1649 1613 /* Create sound port if none is instantiated */ 1614 if (pjsua_var.snd_port==NULL && pjsua_var.null_snd==NULL && 1615 !pjsua_var.no_snd) 1616 { 1650 1651 /* For audio switchboard (i.e. APS-Direct): 1652 * Check if sound device need to be reopened, i.e: its attributes 1653 * (format, clock rate, channel count) must match to peer's. 1654 * Note that sound device can be reopened only if it doesn't have 1655 * any connection. 1656 */ 1657 if (pjsua_var.is_mswitch) { 1658 pjmedia_conf_port_info port0_info; 1659 pjmedia_conf_port_info peer_info; 1660 unsigned peer_id; 1661 pj_bool_t need_reopen = PJ_FALSE; 1617 1662 pj_status_t status; 1618 1663 1619 status = pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev); 1620 if (status != PJ_SUCCESS) { 1621 pjsua_perror(THIS_FILE, "Error opening sound device", status); 1622 return status; 1623 } 1664 peer_id = (source!=0)? source : sink; 1665 status = pjmedia_conf_get_port_info(pjsua_var.mconf, peer_id, 1666 &peer_info); 1667 pj_assert(status == PJ_SUCCESS); 1668 1669 status = pjmedia_conf_get_port_info(pjsua_var.mconf, 0, &port0_info); 1670 pj_assert(status == PJ_SUCCESS); 1671 1672 /* Check if sound device is instantiated. */ 1673 need_reopen = (pjsua_var.snd_port==NULL && pjsua_var.null_snd==NULL && 1674 !pjsua_var.no_snd); 1675 1676 /* Check if sound device need to reopen because it needs to modify 1677 * settings to match its peer. Sound device must be idle in this case 1678 * though. 1679 */ 1680 if (!need_reopen && 1681 port0_info.listener_cnt==0 && port0_info.transmitter_cnt==0) 1682 { 1683 need_reopen = (peer_info.format.id != port0_info.format.id || 1684 peer_info.format.bitrate != port0_info.format.bitrate || 1685 peer_info.clock_rate != port0_info.clock_rate || 1686 peer_info.channel_count != port0_info.channel_count); 1687 } 1688 1689 if (need_reopen) { 1690 pjmedia_aud_param param; 1691 1692 /* Create parameter based on peer info */ 1693 status = create_aud_param(¶m, pjsua_var.cap_dev, 1694 pjsua_var.play_dev, 1695 peer_info.clock_rate, 1696 peer_info.channel_count, 1697 peer_info.samples_per_frame, 1698 peer_info.bits_per_sample); 1699 1700 /* And peer format */ 1701 if (peer_info.format.id != PJMEDIA_FORMAT_PCM) { 1702 param.flags |= PJMEDIA_AUD_DEV_CAP_EXT_FORMAT; 1703 param.ext_fmt = peer_info.format; 1704 } 1705 1706 status = open_snd_dev(¶m); 1707 if (status != PJ_SUCCESS) { 1708 pjsua_perror(THIS_FILE, "Error opening sound device", status); 1709 return status; 1710 } 1711 } 1712 1713 } else { 1714 /* The bridge version */ 1715 1716 /* Create sound port if none is instantiated */ 1717 if (pjsua_var.snd_port==NULL && pjsua_var.null_snd==NULL && 1718 !pjsua_var.no_snd) 1719 { 1720 pj_status_t status; 1721 1722 status = pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev); 1723 if (status != PJ_SUCCESS) { 1724 pjsua_perror(THIS_FILE, "Error opening sound device", status); 1725 return status; 1726 } 1727 } 1728 1624 1729 } 1625 1730 … … 2098 2203 * Enum sound devices. 2099 2204 */ 2205 2206 PJ_DEF(pj_status_t) pjsua_enum_aud_devs( pjmedia_aud_dev_info info[], 2207 unsigned *count) 2208 { 2209 unsigned i, dev_count; 2210 2211 dev_count = pjmedia_aud_dev_count(); 2212 2213 if (dev_count > *count) dev_count = *count; 2214 2215 for (i=0; i<dev_count; ++i) { 2216 pj_status_t status; 2217 2218 status = pjmedia_aud_dev_get_info(i, &info[i]); 2219 if (status != PJ_SUCCESS) 2220 return status; 2221 } 2222 2223 *count = dev_count; 2224 2225 return PJ_SUCCESS; 2226 } 2227 2228 2100 2229 PJ_DEF(pj_status_t) pjsua_enum_snd_devs( pjmedia_snd_dev_info info[], 2101 2230 unsigned *count) … … 2103 2232 unsigned i, dev_count; 2104 2233 2105 dev_count = pjmedia_ snd_get_dev_count();2234 dev_count = pjmedia_aud_dev_count(); 2106 2235 2107 2236 if (dev_count > *count) dev_count = *count; 2237 pj_bzero(info, dev_count * sizeof(pjmedia_snd_dev_info)); 2108 2238 2109 2239 for (i=0; i<dev_count; ++i) { 2110 const pjmedia_snd_dev_info *ci; 2111 2112 ci = pjmedia_snd_get_dev_info(i); 2113 pj_memcpy(&info[i], ci, sizeof(*ci)); 2240 pjmedia_aud_dev_info ai; 2241 pj_status_t status; 2242 2243 status = pjmedia_aud_dev_get_info(i, &ai); 2244 if (status != PJ_SUCCESS) 2245 return status; 2246 2247 strncpy(info[i].name, ai.name, sizeof(info[i].name)); 2248 info[i].name[sizeof(info[i].name)-1] = '\0'; 2249 info[i].input_count = ai.input_count; 2250 info[i].output_count = ai.output_count; 2251 info[i].default_samples_per_sec = ai.default_samples_per_sec; 2114 2252 } 2115 2253 … … 2119 2257 } 2120 2258 2121 2122 /* Close existing sound device */ 2123 static void close_snd_dev(void) 2124 { 2125 /* Close sound device */ 2126 if (pjsua_var.snd_port) { 2127 const pjmedia_snd_dev_info *cap_info, *play_info; 2128 2129 cap_info = pjmedia_snd_get_dev_info(pjsua_var.cap_dev); 2130 play_info = pjmedia_snd_get_dev_info(pjsua_var.play_dev); 2131 2132 PJ_LOG(4,(THIS_FILE, "Closing %s sound playback device and " 2133 "%s sound capture device", 2134 play_info->name, cap_info->name)); 2135 2136 pjmedia_snd_port_disconnect(pjsua_var.snd_port); 2137 pjmedia_snd_port_destroy(pjsua_var.snd_port); 2138 pjsua_var.snd_port = NULL; 2139 } 2140 2141 /* Close null sound device */ 2142 if (pjsua_var.null_snd) { 2143 PJ_LOG(4,(THIS_FILE, "Closing null sound device..")); 2144 pjmedia_master_port_destroy(pjsua_var.null_snd, PJ_FALSE); 2145 pjsua_var.null_snd = NULL; 2146 } 2147 2148 if (pjsua_var.snd_pool) 2149 pj_pool_release(pjsua_var.snd_pool); 2150 pjsua_var.snd_pool = NULL; 2151 } 2152 2153 /* 2154 * Select or change sound device. Application may call this function at 2155 * any time to replace current sound device. 2156 */ 2157 PJ_DEF(pj_status_t) pjsua_set_snd_dev( int capture_dev, 2158 int playback_dev) 2259 /* Create audio device parameter to open the device */ 2260 static pj_status_t create_aud_param(pjmedia_aud_param *param, 2261 pjmedia_aud_dev_index capture_dev, 2262 pjmedia_aud_dev_index playback_dev, 2263 unsigned clock_rate, 2264 unsigned channel_count, 2265 unsigned samples_per_frame, 2266 unsigned bits_per_sample) 2267 { 2268 pj_status_t status; 2269 2270 /* Normalize device ID with new convention about default device ID */ 2271 if (playback_dev == PJMEDIA_AUD_DEFAULT_CAPTURE_DEV) 2272 playback_dev = PJMEDIA_AUD_DEFAULT_PLAYBACK_DEV; 2273 2274 /* Create default parameters for the device */ 2275 status = pjmedia_aud_dev_default_param(capture_dev, param); 2276 if (status != PJ_SUCCESS) { 2277 pjsua_perror(THIS_FILE, "Error retrieving default audio " 2278 "device parameters", status); 2279 return status; 2280 } 2281 param->dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; 2282 param->rec_id = capture_dev; 2283 param->play_id = playback_dev; 2284 param->clock_rate = clock_rate; 2285 param->channel_count = channel_count; 2286 param->samples_per_frame = samples_per_frame; 2287 param->bits_per_sample = bits_per_sample; 2288 2289 /* Update the setting with user preference */ 2290 #define update_param(cap, field) \ 2291 if (pjsua_var.aud_param.flags & cap) { \ 2292 param->flags |= cap; \ 2293 param->field = pjsua_var.aud_param.field; \ 2294 } 2295 update_param( PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING, input_vol); 2296 update_param( PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, output_vol); 2297 update_param( PJMEDIA_AUD_DEV_CAP_INPUT_ROUTE, input_route); 2298 update_param( PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, output_route); 2299 #undef update_param 2300 2301 /* Latency settings */ 2302 param->flags |= (PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY | 2303 PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY); 2304 param->input_latency_ms = pjsua_var.media_cfg.snd_rec_latency; 2305 param->output_latency_ms = pjsua_var.media_cfg.snd_play_latency; 2306 2307 /* EC settings */ 2308 if (pjsua_var.media_cfg.ec_tail_len) { 2309 param->flags |= (PJMEDIA_AUD_DEV_CAP_EC | PJMEDIA_AUD_DEV_CAP_EC_TAIL); 2310 param->ec_enabled = PJ_TRUE; 2311 param->ec_tail_ms = pjsua_var.media_cfg.ec_tail_len; 2312 } else { 2313 param->flags &= ~(PJMEDIA_AUD_DEV_CAP_EC|PJMEDIA_AUD_DEV_CAP_EC_TAIL); 2314 } 2315 2316 return PJ_SUCCESS; 2317 } 2318 2319 /* Internal: the first time the audio device is opened (during app 2320 * startup), retrieve the audio settings such as volume level 2321 * so that aud_get_settings() will work. 2322 */ 2323 static pj_status_t update_initial_aud_param() 2324 { 2325 pjmedia_aud_stream *strm; 2326 pjmedia_aud_param param; 2327 pj_status_t status; 2328 2329 PJ_ASSERT_RETURN(pjsua_var.snd_port != NULL, PJ_EBUG); 2330 2331 strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port); 2332 2333 status = pjmedia_aud_stream_get_param(strm, ¶m); 2334 if (status != PJ_SUCCESS) { 2335 pjsua_perror(THIS_FILE, "Error audio stream " 2336 "device parameters", status); 2337 return status; 2338 } 2339 2340 #define update_saved_param(cap, field) \ 2341 if (param.flags & cap) { \ 2342 pjsua_var.aud_param.flags |= cap; \ 2343 pjsua_var.aud_param.field = param.field; \ 2344 } 2345 2346 update_saved_param(PJMEDIA_AUD_DEV_CAP_INPUT_VOLUME_SETTING, input_vol); 2347 update_saved_param(PJMEDIA_AUD_DEV_CAP_OUTPUT_VOLUME_SETTING, output_vol); 2348 update_saved_param(PJMEDIA_AUD_DEV_CAP_INPUT_ROUTE, input_route); 2349 update_saved_param(PJMEDIA_AUD_DEV_CAP_OUTPUT_ROUTE, output_route); 2350 #undef update_saved_param 2351 2352 return PJ_SUCCESS; 2353 } 2354 2355 /* Get format name */ 2356 static const char *get_fmt_name(pj_uint32_t id) 2357 { 2358 static char name[8]; 2359 2360 if (id == PJMEDIA_FORMAT_L16) 2361 return "PCM"; 2362 pj_memcpy(name, &id, 4); 2363 name[4] = '\0'; 2364 return name; 2365 } 2366 2367 /* Open sound device with the setting. */ 2368 static pj_status_t open_snd_dev(pjmedia_aud_param *param) 2159 2369 { 2160 2370 pjmedia_port *conf_port; 2161 const pjmedia_snd_dev_info *play_info; 2162 unsigned clock_rates[] = {0, 44100, 48000, 32000, 16000, 8000}; 2163 unsigned selected_clock_rate = 0; 2164 unsigned i; 2165 pjmedia_snd_stream *strm; 2166 pjmedia_snd_stream_info si; 2167 pj_str_t tmp; 2168 pj_status_t status = -1; 2371 pj_status_t status; 2372 2373 PJ_ASSERT_RETURN(param, PJ_EINVAL); 2169 2374 2170 2375 /* Check if NULL sound device is used */ 2171 if (NULL_SND_DEV_ID == capture_dev || NULL_SND_DEV_ID == playback_dev) {2376 if (NULL_SND_DEV_ID==param->rec_id || NULL_SND_DEV_ID==param->play_id) { 2172 2377 return pjsua_set_null_snd_dev(); 2173 2378 } … … 2180 2385 PJ_ASSERT_RETURN(pjsua_var.snd_pool, PJ_ENOMEM); 2181 2386 2182 /* Set default clock rate */ 2183 clock_rates[0] = pjsua_var.media_cfg.snd_clock_rate; 2184 if (clock_rates[0] == 0) 2185 clock_rates[0] = pjsua_var.media_cfg.clock_rate; 2387 2388 PJ_LOG(4,(THIS_FILE, "Opening sound device %s@%d/%d/%dms", 2389 get_fmt_name(param->ext_fmt.id), 2390 param->clock_rate, param->channel_count, 2391 param->samples_per_frame / param->channel_count * 1000 / 2392 param->clock_rate)); 2393 2394 status = pjmedia_snd_port_create2( pjsua_var.snd_pool, 2395 param, &pjsua_var.snd_port); 2396 if (status != PJ_SUCCESS) 2397 return status; 2186 2398 2187 2399 /* Get the port0 of the conference bridge. */ … … 2189 2401 pj_assert(conf_port != NULL); 2190 2402 2191 /* Attempts to open the sound device with different clock rates */ 2192 for (i=0; i<PJ_ARRAY_SIZE(clock_rates); ++i) { 2193 char errmsg[PJ_ERR_MSG_SIZE]; 2194 unsigned samples_per_frame; 2195 2196 PJ_LOG(4,(THIS_FILE, 2197 "pjsua_set_snd_dev(): attempting to open devices " 2198 "@%d Hz", clock_rates[i])); 2199 2200 samples_per_frame = clock_rates[i] * 2201 pjsua_var.media_cfg.audio_frame_ptime * 2202 pjsua_var.media_cfg.channel_count / 1000; 2203 2204 /* Create the sound device. Sound port will start immediately. */ 2205 status = pjmedia_snd_port_create(pjsua_var.snd_pool, capture_dev, 2206 playback_dev, 2207 clock_rates[i], 2208 pjsua_var.media_cfg.channel_count, 2209 samples_per_frame, 2210 16, 0, &pjsua_var.snd_port); 2211 2212 if (status == PJ_SUCCESS) { 2213 selected_clock_rate = clock_rates[i]; 2214 2215 /* If there's mismatch between sound port and conference's port, 2216 * create a resample port to bridge them. 2217 */ 2218 if (selected_clock_rate != pjsua_var.media_cfg.clock_rate) { 2219 pjmedia_port *resample_port; 2220 unsigned resample_opt = 0; 2221 2222 if (pjsua_var.media_cfg.quality >= 3 && 2223 pjsua_var.media_cfg.quality <= 4) 2224 { 2225 resample_opt |= PJMEDIA_RESAMPLE_USE_SMALL_FILTER; 2226 } 2227 else if (pjsua_var.media_cfg.quality < 3) { 2228 resample_opt |= PJMEDIA_RESAMPLE_USE_LINEAR; 2229 } 2230 2231 status = pjmedia_resample_port_create(pjsua_var.snd_pool, 2232 conf_port, 2233 selected_clock_rate, 2234 resample_opt, 2235 &resample_port); 2236 if (status != PJ_SUCCESS) { 2237 pj_strerror(status, errmsg, sizeof(errmsg)); 2238 PJ_LOG(4, (THIS_FILE, 2239 "Error creating resample port, trying next " 2240 "clock rate", 2241 errmsg)); 2242 pjmedia_snd_port_destroy(pjsua_var.snd_port); 2243 pjsua_var.snd_port = NULL; 2244 continue; 2245 } else { 2246 conf_port = resample_port; 2247 break; 2248 } 2249 2250 } else { 2251 break; 2252 } 2253 } 2254 2255 pj_strerror(status, errmsg, sizeof(errmsg)); 2256 PJ_LOG(4, (THIS_FILE, "..failed: %s", errmsg)); 2257 } 2258 2259 if (status != PJ_SUCCESS) { 2260 pjsua_perror(THIS_FILE, "Unable to open sound device", status); 2261 return status; 2262 } 2263 2264 /* Set AEC */ 2265 pjmedia_snd_port_set_ec( pjsua_var.snd_port, pjsua_var.snd_pool, 2266 pjsua_var.media_cfg.ec_tail_len, 2267 pjsua_var.media_cfg.ec_options); 2268 2269 /* Connect sound port to the bridge */ 2403 /* For conference bridge, resample if necessary if the bridge's 2404 * clock rate is different than the sound device's clock rate. 2405 */ 2406 if (!pjsua_var.is_mswitch && 2407 param->ext_fmt.id == PJMEDIA_FORMAT_PCM && 2408 conf_port->info.clock_rate != param->clock_rate) 2409 { 2410 pjmedia_port *resample_port; 2411 unsigned resample_opt = 0; 2412 2413 if (pjsua_var.media_cfg.quality >= 3 && 2414 pjsua_var.media_cfg.quality <= 4) 2415 { 2416 resample_opt |= PJMEDIA_RESAMPLE_USE_SMALL_FILTER; 2417 } 2418 else if (pjsua_var.media_cfg.quality < 3) { 2419 resample_opt |= PJMEDIA_RESAMPLE_USE_LINEAR; 2420 } 2421 2422 status = pjmedia_resample_port_create(pjsua_var.snd_pool, 2423 conf_port, 2424 param->clock_rate, 2425 resample_opt, 2426 &resample_port); 2427 if (status != PJ_SUCCESS) { 2428 char errmsg[PJ_ERR_MSG_SIZE]; 2429 pj_strerror(status, errmsg, sizeof(errmsg)); 2430 PJ_LOG(4, (THIS_FILE, 2431 "Error creating resample port: %s", 2432 errmsg)); 2433 close_snd_dev(); 2434 return status; 2435 } 2436 2437 conf_port = resample_port; 2438 } 2439 2440 /* Otherwise for audio switchboard, the switch's port0 setting is 2441 * derived from the sound device setting, so update the setting. 2442 */ 2443 if (pjsua_var.is_mswitch) { 2444 pj_memcpy(&conf_port->info.format, ¶m->ext_fmt, 2445 sizeof(conf_port->info.format)); 2446 conf_port->info.clock_rate = param->clock_rate; 2447 conf_port->info.samples_per_frame = param->samples_per_frame; 2448 conf_port->info.channel_count = param->channel_count; 2449 conf_port->info.bits_per_sample = 16; 2450 } 2451 2452 /* Connect sound port to the bridge */ 2270 2453 status = pjmedia_snd_port_connect(pjsua_var.snd_port, 2271 2454 conf_port ); … … 2279 2462 2280 2463 /* Save the device IDs */ 2281 pjsua_var.cap_dev = capture_dev;2282 pjsua_var.play_dev = p layback_dev;2464 pjsua_var.cap_dev = param->rec_id; 2465 pjsua_var.play_dev = param->play_id; 2283 2466 2284 2467 /* Update sound device name. */ 2285 strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port); 2286 pjmedia_snd_stream_get_info(strm, &si); 2287 play_info = pjmedia_snd_get_dev_info(si.rec_id); 2288 2289 if (si.clock_rate != pjsua_var.media_cfg.clock_rate) { 2290 char tmp_buf[128]; 2291 int tmp_buf_len = sizeof(tmp_buf); 2292 2293 tmp_buf_len = pj_ansi_snprintf(tmp_buf, sizeof(tmp_buf)-1, "%s (%dKHz)", 2294 play_info->name, si.clock_rate/1000); 2295 pj_strset(&tmp, tmp_buf, tmp_buf_len); 2296 pjmedia_conf_set_port0_name(pjsua_var.mconf, &tmp); 2468 { 2469 pjmedia_aud_dev_info rec_info; 2470 pjmedia_aud_stream *strm; 2471 pjmedia_aud_param si; 2472 pj_str_t tmp; 2473 2474 strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port); 2475 status = pjmedia_aud_stream_get_param(strm, &si); 2476 if (status == PJ_SUCCESS) 2477 status = pjmedia_aud_dev_get_info(si.rec_id, &rec_info); 2478 2479 if (status==PJ_SUCCESS) { 2480 if (param->clock_rate != pjsua_var.media_cfg.clock_rate) { 2481 char tmp_buf[128]; 2482 int tmp_buf_len = sizeof(tmp_buf); 2483 2484 tmp_buf_len = pj_ansi_snprintf(tmp_buf, sizeof(tmp_buf)-1, 2485 "%s (%dKHz)", 2486 rec_info.name, 2487 param->clock_rate/1000); 2488 pj_strset(&tmp, tmp_buf, tmp_buf_len); 2489 pjmedia_conf_set_port0_name(pjsua_var.mconf, &tmp); 2490 } else { 2491 pjmedia_conf_set_port0_name(pjsua_var.mconf, 2492 pj_cstr(&tmp, rec_info.name)); 2493 } 2494 } 2495 2496 /* Any error is not major, let it through */ 2497 status = PJ_SUCCESS; 2498 }; 2499 2500 /* If this is the first time the audio device is open, retrieve some 2501 * settings from the device (such as volume settings) so that the 2502 * pjsua_snd_get_setting() work. 2503 */ 2504 if (pjsua_var.aud_open_cnt == 0) { 2505 update_initial_aud_param(); 2506 ++pjsua_var.aud_open_cnt; 2507 } 2508 2509 return PJ_SUCCESS; 2510 } 2511 2512 2513 /* Close existing sound device */ 2514 static void close_snd_dev(void) 2515 { 2516 /* Close sound device */ 2517 if (pjsua_var.snd_port) { 2518 pjmedia_aud_dev_info cap_info, play_info; 2519 pjmedia_aud_stream *strm; 2520 pjmedia_aud_param param; 2521 2522 strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port); 2523 pjmedia_aud_stream_get_param(strm, ¶m); 2524 2525 if (pjmedia_aud_dev_get_info(param.rec_id, &cap_info) != PJ_SUCCESS) 2526 cap_info.name[0] = '\0'; 2527 if (pjmedia_aud_dev_get_info(param.play_id, &play_info) != PJ_SUCCESS) 2528 play_info.name[0] = '\0'; 2529 2530 PJ_LOG(4,(THIS_FILE, "Closing %s sound playback device and " 2531 "%s sound capture device", 2532 play_info.name, cap_info.name)); 2533 2534 pjmedia_snd_port_disconnect(pjsua_var.snd_port); 2535 pjmedia_snd_port_destroy(pjsua_var.snd_port); 2536 pjsua_var.snd_port = NULL; 2537 } 2538 2539 /* Close null sound device */ 2540 if (pjsua_var.null_snd) { 2541 PJ_LOG(4,(THIS_FILE, "Closing null sound device..")); 2542 pjmedia_master_port_destroy(pjsua_var.null_snd, PJ_FALSE); 2543 pjsua_var.null_snd = NULL; 2544 } 2545 2546 if (pjsua_var.snd_pool) 2547 pj_pool_release(pjsua_var.snd_pool); 2548 pjsua_var.snd_pool = NULL; 2549 } 2550 2551 2552 /* 2553 * Select or change sound device. Application may call this function at 2554 * any time to replace current sound device. 2555 */ 2556 PJ_DEF(pj_status_t) pjsua_set_snd_dev( int capture_dev, 2557 int playback_dev) 2558 { 2559 unsigned alt_cr_cnt = 1; 2560 unsigned alt_cr[] = {0, 44100, 48000, 32000, 16000, 8000}; 2561 unsigned i; 2562 pj_status_t status = -1; 2563 2564 /* Set default clock rate */ 2565 alt_cr[0] = pjsua_var.media_cfg.snd_clock_rate; 2566 if (alt_cr[0] == 0) 2567 alt_cr[0] = pjsua_var.media_cfg.clock_rate; 2568 2569 /* Allow retrying of different clock rate if we're using conference 2570 * bridge (meaning audio format is always PCM), otherwise lock on 2571 * to one clock rate. 2572 */ 2573 if (pjsua_var.is_mswitch) { 2574 alt_cr_cnt = 1; 2297 2575 } else { 2298 pjmedia_conf_set_port0_name(pjsua_var.mconf, 2299 pj_cstr(&tmp, play_info->name)); 2576 alt_cr_cnt = PJ_ARRAY_SIZE(alt_cr); 2577 } 2578 2579 /* Attempts to open the sound device with different clock rates */ 2580 for (i=0; i<alt_cr_cnt; ++i) { 2581 pjmedia_aud_param param; 2582 unsigned samples_per_frame; 2583 2584 /* Create the default audio param */ 2585 samples_per_frame = alt_cr[i] * 2586 pjsua_var.media_cfg.audio_frame_ptime * 2587 pjsua_var.media_cfg.channel_count / 1000; 2588 status = create_aud_param(¶m, capture_dev, playback_dev, 2589 alt_cr[i], pjsua_var.media_cfg.channel_count, 2590 samples_per_frame, 16); 2591 if (status != PJ_SUCCESS) 2592 return status; 2593 2594 /* Open! */ 2595 status = open_snd_dev(¶m); 2596 if (status == PJ_SUCCESS) 2597 break; 2598 } 2599 2600 if (status != PJ_SUCCESS) { 2601 pjsua_perror(THIS_FILE, "Unable to open sound device", status); 2602 return status; 2300 2603 } 2301 2604 … … 2405 2708 2406 2709 2710 /* 2711 * Check whether the sound device is currently active. 2712 */ 2713 PJ_DEF(pj_bool_t) pjsua_snd_is_active(void) 2714 { 2715 return pjsua_var.snd_port != NULL; 2716 } 2717 2718 2719 /* 2720 * Configure sound device setting to the sound device being used. 2721 */ 2722 PJ_DEF(pj_status_t) pjsua_snd_set_setting( pjmedia_aud_dev_cap cap, 2723 const void *pval, 2724 pj_bool_t keep) 2725 { 2726 pj_status_t status; 2727 2728 /* Check if we are allowed to set the cap */ 2729 if ((cap & pjsua_var.aud_svmask) == 0) { 2730 return PJMEDIA_EAUD_INVCAP; 2731 } 2732 2733 /* If sound is active, set it immediately */ 2734 if (pjsua_snd_is_active()) { 2735 pjmedia_aud_stream *strm; 2736 2737 strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port); 2738 status = pjmedia_aud_stream_set_cap(strm, cap, pval); 2739 } else { 2740 status = PJ_SUCCESS; 2741 } 2742 2743 if (status != PJ_SUCCESS) 2744 return status; 2745 2746 /* Save in internal param for later device open */ 2747 if (keep) { 2748 status = pjmedia_aud_param_set_cap(&pjsua_var.aud_param, 2749 cap, pval); 2750 } 2751 2752 return status; 2753 } 2754 2755 /* 2756 * Retrieve a sound device setting. 2757 */ 2758 PJ_DEF(pj_status_t) pjsua_snd_get_setting( pjmedia_aud_dev_cap cap, 2759 void *pval) 2760 { 2761 /* If sound device has never been opened before, open it to 2762 * retrieve the initial setting from the device (e.g. audio 2763 * volume) 2764 */ 2765 if (pjsua_var.aud_open_cnt==0) { 2766 PJ_LOG(4,(THIS_FILE, "Opening sound device to get initial settings")); 2767 pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev); 2768 close_snd_dev(); 2769 } 2770 2771 if (pjsua_snd_is_active()) { 2772 /* Sound is active, retrieve from device directly */ 2773 pjmedia_aud_stream *strm; 2774 2775 strm = pjmedia_snd_port_get_snd_stream(pjsua_var.snd_port); 2776 return pjmedia_aud_stream_get_cap(strm, cap, pval); 2777 } else { 2778 /* Otherwise retrieve from internal param */ 2779 return pjmedia_aud_param_get_cap(&pjsua_var.aud_param, 2780 cap, pval); 2781 } 2782 } 2783 2784 2407 2785 /***************************************************************************** 2408 2786 * Codecs.
Note: See TracChangeset
for help on using the changeset viewer.