T某时刻电容两端的电压压:Vt=V0+(V1-V0)*[1-exp(-t/RC)],既然知道V1了,还求什么Vt 啊,V1 是什么电压?

最近在做android手机电池管理相关的项目,其中有一个需求是计算手机充电时间的。翻阅了一些资料和一些相关的竞品,发现每个产品的在手机充电时长的计算上多不是很统一,后来翻阅了物理学的一些知识和文章,总...
最近在做android手机电池管理相关的项目,其中有一个需求是计算手机充电时间的。翻阅了一些资料和一些相关的竞品,发现每个产品的在手机充电时长的计算上多不是很统一,后来翻阅了物理学的一些知识和文章,总...
并发用户数、吞吐量、思考时间的计算公式
一、软件性能的关注点
对一个软件做性能测试时需要关注那些性能呢?
我们想想在软件设计、部署、使用、维护中一共有哪些角色的参与,然后再考虑这些角...
二、软件性能的几个主要术语
  1、响应时间:对请求作出响应所需要的时间
  网络传输时间:N1+N2+N3+N4
  应用服务器处理时间:A1+A3
  数据库服务器处理时间:A2
...
例子:一个高速路有10个入口,每个入口每秒钟只能进1辆车
1、请问1秒钟最多能进几辆车?
2、每辆车需要多长时间进行响应?
reponse time ...
进入正题前,我们先来回顾下电容的充放电时间计算公式,假设有电源Vu通过电阻R给电容C充电,V0为电容上的初始电压值,Vu为电容充满电后的电压值,Vt为任意时刻t时电容上的电压值,那么便可以得到如下的计...
C语言根据日期判断星期几(使用基姆拉尔森计算公式)
算法如下:
基姆拉尔森计算公式
W= (d+2*m+3*(m+1)/5+y+y/4-y/100+y/400) mod 7
在公式中d表示日...
他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)电容充电_中国百科网
    
超级电容充电电路 AAT4620,pdf datasheet ...
超级电容充电电路 AAT4620,pdf datasheet http://dx1.soft.elecfans.com/dm/elec/elecfans.com%20AAT4620.pdf ...
没有示波器没关系啊,你有万用表吧?注意看你测量的值变化是否大就行啦,当然这个办法误差很大!如果不行的话就多加几个电容啦,电解电容后多并联几个瓷介电容就好啦!基本上我们在+5V直流电压后加上一个16V,1000uF电解电容,后面并上几个...
)/(V1-Vt)]   例如,电压为E的电池通过R向初值为0的电容C充电   V0=0,V1=E,故充到t时刻电容上的电压为:   Vt='E'*[1-exp(-t/RC)]   再如,初始电压为E的电容C通过R放电   V0=E,V1...
[(V1-V0)/(V1-Vt)]   例如,电压为E的电池通过R向初值为0的电容C充电   V0=0,V1=E,故充到t时刻电容上的电压为:   Vt="E"*[1-exp(-t/RC)]   再如,初始电压为E的电容C通过R放电   V0=E...
电机的所能承受的状态,在不同的风速条件下设定其合适的变桨角度,以满足发电机所处的工作状态在最优状态。 风力发电变桨用超级电容器储能电源的基本工作原理为:平时,由风机产生的电能输入充电机,充电机为超级电容器储能电源充电,直至超级电容器储能电源...
,u=U【1-e^ -t/(RC)】。从得到的公式看,只有当时间t趋向无穷大时,极板上的电荷和电压才达到稳定,充电才算结束。但在实际问题中,由于1-e ^-t/(RC)很快趋向1,故经过很短的一段时间后,电容器极板间电荷和电压的变化已经...
该文章讲述了简答介绍电容充电放电时间计算公式. 设,V0 为电容上的初始电压值; V1 为电容最终可充到或放到的电压值; Vt 为t时刻电容上的电压值。 则, Vt="V0"+(V1-V0)* [1-exp(-t/RC)] 或, t...
有限的激励源,所以在任何两个导体之间的电压将在有限的时间内建立一个稳定状态值。随着能量的注入,电压会很快地建立或衰减,其中对电压的阻力称为电容。例如两个平等金属板的结构,在低电压下包含了大量电荷,所以电容就很大。 电容充电放电时间和充电电流...
(转 )电容充电放电工妇计算公式 设,V0 为电容上的初初电压值; V1 为电容终极可充到或放到的电压值; Vt 为t时候电容上的电压值。 则, Vt="V0"+(V1-V0)* [1-exp(-t/RC)] 或, t = RC*Ln...
  1 引言   该充电电源为某科研项目,要求充电电容为3000uF,电压范围4000V--14000V,充电精度AU=|30V+U* 2000ppm|,电源供电电压为380V/50Hz,能量变换器的工作频率f大于等于15KHz,能量...
[(V1-V0)/(V1-Vt)]   例如,电压为E的电池通过R向初值为0的电容C充电   V0=0,V1=E,故充到t时刻电容上的电压为:   Vt="E"*[1-exp(-t/RC)]   再如,初始电压为E的电容C通过R放电   V0=E,V1...
,来看给电容充电的电路。电源还是像抽水机一样在工作,电子就从负极一直跑,跑到电容器下面那个极板,断了没路了,就聚集在那里。这多电子那里来?从正极。正极的呢?从正极附近。附近的呢?从更远处……最远就是电容器的上面的极板。电子跑了,只剩带正电的粒子...
你是说电容么?电容的电压由电源决定,也就是说多大的电压都能充,充满后电容电压等于电源电压。比如用5v电源给电容充电,充满电容就是5v。电流由电路的电阻决定,电阻越小充电越快,这个电阻还包括电源内阻。保持时间得看电容的自放电参数了,这个得...
V0 为电容上的初始电压值; V1 为电容最终可充到或放到的电压值; Vt 为t时刻电容上的电压值。 则, Vt="V0"+(V1-V0)* [1-exp(-t/RC)] 或, t = RC*Ln[(V1-V0)/(V1-Vt)] 求充电...
电流经过电子镇流器的桥式整流电路,给滤波电容充电。当电容上电压达到电子镇流器振荡起振电压时,电路起振,产生高频电压使灯管内气体击穿而发光。由于滤波电容贮能有限,电路一旦起振,滤波电容上电能很快会释放掉,电路停振,灯熄灭。再经过几分钟后,以上...
LTC3642 - 高效率、高电压、50mA 同步降压型转换器 特点 宽输入电压范围:4.5V 至 45V 能够承受 60V 的输入瞬态电压 具内部高端和低端电源开关 无需进行补偿 50mA 输出电流 低压差操作:100% 占空比 低静态...
该文章讲述了电容的充电和放电 自制简易的电容的电路原理和应用 自制 电容 充电 放电 两 块靠得很近的导体就会形成电容┨┠ 找两块铝箔纸分别接上电极,铝箔中间用绝缘纸隔开,纸越薄越好,这样容量就大。 把两电极接到直流电源的正负极,电源就...
不会,因为电压不够。充电完成后,相当于二个电势相等的电源正极对正极,没有电流,不会再充电。 1.只有瞬间电流,电容充电完成后,电路就没有电流了。 2.连接在电源正极的为电容正极,积累的是正电荷。 3.肖特基二极管 基本原理是:在金属(例如...
冲电的话,就用超级电容标称电压,电流根据需要而定,恒压给超级电容充电就好了,想好点的话就用:先恒电流后恒压方式,不过比较复杂难度较大,再有就是恒功率充电了。看你需要了,是快速充呢还是稳定充,我最近在靠超级电容快速重放电测试装置,有问题可以...
收录时间:日 04:26:11 来 源:?プ髡:垮
上一篇: &(&&)
创建分享人
Copyright by ;All rights reserved.Getting Started: Building and Using PJSIP and PJMEDIA
[Last Update: $Date:
05:17:55 +0100 (Mon, 30 Jul 2007) $]
This article is now outdated and not maintained. For the latest, please see
This article describes how to download, customize, build, and use
the open source PJSIP and PJMEDIA SIP and media stack. The online (and
HTML) version of this file can be downloaded from
Quick Info
Building with GNU tools (Linux, *BSD, MacOS X, mingw, etc.)
Generally these should be all that are needed to build the libraries, applications, and samples:
$ ./configure
$ make dep && make clean && make
Building Win32 Target with Microsoft Visual Studio
Generally we can just do these steps:
Visual Studio 6: open pjproject.dsw workspace,
Visual Studio 8/2005: open pjproject-vs8.sln solution,
Create an empty pjlib/include/pj/config_site.h, and
build the pjsua application.
Building for Windows Mobile (for pjproject releases&1.2 and over)
Generally these are all that are needed:
Using Visual Studio 8/2005: open pjproject-vs8.sln solution,Select the correct target, such as Windows Mobile 6 Professional,Create an empty pjlib/include/pj/config_site.h, andbuild the pjsua_wince or PocketPJ application.
Building for Windows Mobile (for pjproject releases pre-1.2)
Generally these are all that are needed:
Open pjsip-apps/build/wince-evc4/wince_demos.vcw EVC4 workspace,
Create an empty pjlib/include/pj/config_site.h, and
build the pjsua_wince application.
Invoking Older Build System (e.g. for RTEMS)
Generally these should be all that are needed to build the libraries, applications, and samples:
$ ./configure-legacy
$ make dep && make clean && make
Locating Output Binaries/Libraries
Libraries will be put in lib directory, and binaries will be put in bin directory, under each projects.
Running the Applications
After successful build, you can try running pjsua application on pjsip-apps/bin directory. PJSUA manual can be found in
Table of Contents:
1. Getting the Source Code Distribution
All libraries (PJLIB, PJLIB-UTIL, PJSIP, PJMEDIA, and PJMEDIA-CODEC)
are currently distributed under a single source tree, collectively
named as PJPROJECT or just PJ libraries. These libraries can be obtained by either downloading the release tarball or getting them from the Subversion trunk.
1.1 Getting the Release tarball
Getting the released tarball, in ZIP or TGZ format, is a convenient way
to obtain stable version of PJPROJECT. The tarball may not contain the
latest features or bug-fixes, but normally it is considered more stable
as each will be tested more rigorously before released.
The latest released tarball can be downloaded from the .
1.2 Getting from Subversion trunk
PJPROJECT Subversion repository will always contain the latest/most
up-to-date version of the sources. Normally the Subversion repository
is always kept in a "good" state. However, there's always a chance that
things break and the tree doesn't build correctly (particularly for the
"not-so-popular" targets), so please consult the mailing list should
there be any problems.
Using Subversion also has benefits of keeping the local copy of the
source up to date with the main PJ source tree and to easily track the
changes made to the local copy, if any.
What is Subversion
Subversion (SVN) is Open Source version control system similar to CVS. Subversion homepage is in
Getting Subversion Client
A Subversion (SVN) client is needed to download the PJ source files
from pjsip.org SVN tree. SVN client binaries can be downloaded from , and the program should be available for Windows, Linux, MacOS X, and many more platforms.
Getting the Source for The First Time
Once Subversion client is installed, the following commands can be
used to initially retrieve the latest sources from the Subversion trunk:
$ svn co http://svn.pjsip.org/repos/pjproject/trunk pjproject
$ cd pjproject
Keeping The Local Copy Up-to-Date
Once sources have been downloaded, we can keep the local copy up to
date by periodically synchronizing the local source with the latest
revision from the PJ's Subversion trunk. The mailing list provides best
source of information about the availability of new updates in the
To update the local copy with the latest changes in the main PJ's repository:
$ cd pjproject
$ svn update
Tracking Local and Remote Changes
To see what files have been changed locally:
$ cd pjproject
$ svn status
The above command only compares local file against the original
local copy, so it doesn't require Internet connection while performing
the check.
To see both what files have been changed locally and what files have been updated in the PJ's Subversion repository:
$ cd pjproject
$ svn status -u
Note that this command requires active Internet connection to query the status of PJPROJECT's source repository.
1.3 Source Directories Layout
Top-Level Directory Layout
The top-level directories (denoted as $TOP here) in the source distribution contains the following sub-directories:
$TOP/build
Contains makefiles that are common for all projects.
$TOP/build.symbian
Contains MMP files for building Symbian target.
$TOP/pjlib
Contains header and source files of PJLIB. PJLIB is the
base portability and framework library which is used by all other
$TOP/pjlib-util
Contains PJLIB-UTIL header and source files. PJLIB-UTIL is
an auxiliary library that contains utility functions such as scanner,
XML, STUN, MD5 algorithm, getopt() implementation, etc.
$TOP/pjnath
Contains PJNATH header and source files. PJNATH contains STUN, TURN, and ICE implementation.
$TOP/pjmedia
Contains PJMEDIA and PJMEDIA-CODEC header and source files.
The sources of various codecs (such as GSM, Speex, and iLBC) can be
found under this directory.
$TOP/pjsip
Contains PJSIP header and source files. This library is the SIP protocol stack implementation.
$TOP/pjsip-apps
Contains source code for PJSUA and various sample applications, including the Python wrapper.
$TOP/third_party
Contains source code for various third party libraries, such as Speex, iLBC, and GSM codecs.
Individual Directory Inside Each Project
Each library directory further contains these sub-directories:
Contains binaries produced by the build process.
Contains build scripts/makefiles, project files, project workspace, etc. to build the project. In particular, it contains one Makefile file to build the project with GNU build systems, and a *.dsw workspace file to build the library with Microsoft Visual Studio 6 or later.
build/output
The build/output directory contains the object
files and other files generated by the build process. To support
building multiple targets with a single source tree, each build target
will occupy a different subdirectory under this directory.
build/wince-evc4
This directory contains the project/workspace files to
build Windows CE/WinCE version of the project using Microsoft Embedded
Visual C++ 4.
build/wince-evc4/output
This directory contains the library, executable, and object files generated by Windows Mobile build process.
Contains Doxygen configuration file (doxygen.cfg) to
generate online documentation from the source files. The output
documentation will be put in this directory as well (for example,
docs/html directory for the HTML files).
(to generate Doxygen documentation from the source tree, just run "doxygen docs/doxygen.cfg" in the individual project directory. The generated files will reside in docs directory).
Contains the header files for the project.
Contains libraries produced by the build process.
Contains the source files of the project.
2. Build Preparation
2.1 Create config_site.h file
Before source files can be built, the pjlib/include/pj/config_site.h file must be created (it can just be an empty file).
When the Makefile based build system is used, this process
is taken care by the Makefiles. But when non-Makefile based build
system (such as Visual Studio) is used, the config_site.h file must be created manually.
What is config_site.h File
The pjlib/include/pj/config_site.h contains local customizations to the libraries.
All customizations should be put in this file instead of modifying
PJ's files, because if PJ's files get modified, then those modified
files will not be updated the next time the source is synchronized. Or
in other case, the local modification may be overwritten with the fresh
copy from the SVN.
Putting the local customization to the config_site.h solves
this problem, because this file is not included in the version control,
so it will never be overwritten by "svn update" command.
Please find list of configuration macros that can be overriden from these files:
A sample config_site.h file is also available in .
Creating config_site.h file
The simplest way is just to create an empty file, to use whetever default values set by the libraries.
Another way to create the config_site.h file is to write something like the following:
// Uncomment to get minimum footprint (suitable for 1-2 concurrent calls only)
//#define PJ_CONFIG_MINIMAL_SIZE
// Uncomment to get maximum performance
//#define PJ_CONFIG_MAXIMUM_SPEED
#include &pj/config_site_sample.h&
2.2 Disk Space Requirements
The building process needs:
about 50-60 MB of disk space to store the uncompressed source files, and
another 30-50 MB of additional space for building each target
(Visual Studio Debug and Release are considered as separate targets)
3. Building Linux, *nix, *BSD, and MacOS X Targets with GNU Build Systems
3.1 Supported Targets
The new, autoconf based GNU build system can be used to build the libraries/applications for the following targets:
Linux/uC-Linux (i386, Opteron, Itanium, MIPS, PowerPC, etc.),
MacOS X (PowerPC),
mingw (i386),
FreeBSD and maybe other BSD's (i386, Opteron, etc.),
RTEMS with cross compilation (ARM, powerpc),
3.2 Requirements
In order to use PJ's GNU build system, these typical GNU tools are needed:
GNU make (other make will not work),
GNU binutils for the target, and
GNU gcc for the target.
In addition, the following libraries are optional, but they will be used if they are present:
ALSA header files/libraries (optional) if ALSA support is wanted.
OpenSSL header files/libraries (optional) if TLS support is wanted.
The build system is known to work on the following hosts:
Linux, many types of distributions.
MacOS X 10.2
mingw (Win2K, XP)
FreeBSD (must use gmake instead of make)
Building Win32 applications with Cygwin is currently not
supported by the autoconf script (there are some conflicts with Windows
headers), but one can still use the old configure script by calling ./configure-legacy. More over, cross-compilations might also work with Cygwin using this build system.
3.3 Running configure
Using Default Settings
Run "./configure" without any options to let the script detect the appropriate settings for the host:
$ cd pjproject
$ ./configure
The default settings build the libraries in "release" mode, with default CFLAGS set to "-O2". To change the default CFLAGS, we can use the usual "./configure CFLAGS='-g'" construct.
Features Customization
With the new autoconf based build system, most configuration/customization can be specified as configure arguments. The list of customizable features can be viewed by running "./configure --help" command:
$ cd pjproject
$ ./configure --help
Optional Features:
--disable-floating-point&&Disable floating point where possible
--disable-sound
Exclude sound (i.e. use null sound)
--disable-small-filter
Exclude small filter in resampling
--disable-large-filter
Exclude large filter in resampling
--disable-g711-plc
Exclude G.711 Annex A PLC
--disable-speex-aec
Exclude Speex Acoustic Echo Canceller/AEC
--disable-g711-codec
Exclude G.711 codecs from the build
--disable-l16-codec
Exclude Linear/L16 codec family from the build
--disable-gsm-codec
Exclude GSM codec in the build
--disable-speex-codec
Exclude Speex codecs in the build
--disable-ilbc-codec
Exclude iLBC codec in the build
--disable-tls
Force excluding TLS support (default is autodetected based on OpenSSL availability)
Configuring Debug Version and Other Customizations
The configure script accepts standard customization, which details can be obtained by executing ./configure --help.
Below is an example of specifying CFLAGS in configure:
$ ./configure CFLAGS="-O3 -DNDEBUG -msoft-float -fno-builtin"
Configuring TLS Support
By default, TLS support is configured based on the availability of OpenSSL
header files and libraries. If OpenSSL is available at the default
include and library path locations, TLS will be enabled by the configure script.
You can explicitly disable TLS support by giving the configure script --disable-tls option.
3.4 Cross Compilation
Cross compilation should be supported, using the usual autoconf syntax:
$ ./configure --host=arm-elf-linux
Since cross-compilation is not tested as often as the "normal" build,
please watch for the ./configure output for incorrect settings (well
ideally this should be done for normal build too).
Please refer to
for further information about porting PJ software.
3.5 Running make
Once the configure script completes successfully, start the build process by invoking these commands:
$ cd pjproject
$ make dep
gmake may need to be specified instead of make for some hosts, to invoke GNU make instead of the native make.
Description of all make targets supported by the Makefile's:
The default (or first) target to build the libraries/binaries.
dep, depend
Build dependencies rule from the source files.
Clean the object files for current target, but keep the output library/binary files intact.
distclean, realclean
Remove all generated files (object, libraries, binaries, and dependency files) for current target.
make can be invoked either in the top-level PJ directory or in build directory under each project to build only the particular project.
3.6 Build Customizations
Build features can be customized by specifying the options when running ./configure as described in
In addition, additional CFLAGS and LDFLAGS options can be put in user.mak file in PJ root directory (this file may need to be created if it doesn't exist). Below is a sample of user.mak file contents:
export CFLAGS += -msoft-float -fno-builtin
export LDFLAGS +=
4. Building for Windows Targets with Microsoft Visual Studio
4.1 Requirements
The Visual Studio based project files can be used with one of the following tools:
Microsoft Visual Studio 6,
Microsoft Visual Studio .NET 2002,
Microsoft Visual Studio .NET 2003,
Microsoft Visual C++ 2005 (including Express edition),
In addition, the following SDK's are needed:
Platform SDK (tested with Platform SDK for Windows Server 2003 SP1).
DirectX SDK (tested with DirectX version 8 and 9),
OpenSSL development kit (optional) is needed if TLS support is wanted.
new Platform SDK is still needed for Visual Studio 6, although VS6
comes with its own Platform SDK. The new Platform SDK is needed for
Iphlpapi.[h|lib] for the new PJNATH library.
For the host, the following are required:
Windows NT, 2000, XP, 2003, or later ,
Windows 95/98 should work too, but this has not been tested,
Sufficient amount of RAM for the build process.
Installing OpenSSL Library
If TLS support is wanted, then OpenSSL SDK must be installed in the development host.
To install OpenSSL SDK from the Win32 binary distribution:
Install OpenSSL SDK to any folder (e.g. C:\OpenSSL)
Add OpenSSL DLL location to the system PATH.
Add OpenSSL include path to Visual Studio includes search
directory. Make sure that OpenSSL header files can be accessed from the
program with #include &openssl/ssl.h& construct.
Add OpenSSL library path to Visual Studio library search directory. Make sure the following libraries are accessible:
For Debug build: libeay32MTd and ssleay32MTd.
For Release build: libeay32MT and ssleay32MT.
Then to enable TLS transport support in PJSIP, just add
&&#define PJSIP_HAS_TLS_TRANSPORT 1
in your pj/config_site.h. When this macro is defined, OpenSSL libraries will be automatically linked to the application via the #pragma construct in sip_transport_tls_ossl.c file.
4.2 Building the Projects
Follow the steps below to build the libraries/application using Visual Studio:
For Visual Studio 6: open pjproject.dsw workspace file.
For Visual Studio 8 (VS 2005): open pjproject-vs8.sln solution file.
Set pjsua as Active Project.
Select Debug or Release build as appropriate.
Build the project. This will build pjsua application and all libraries needed by pjsua.
After successful build, the pjsua application will be placed in pjsip-apps/bin directory, and the libraries in lib directory under each projects.
To build the samples:
(Still using the same workspace)
Set samples project as Active Project
Select Debug or Release build as appropriate.
Build the project. This will build all sample applications and all libraries needed.
After successful build, the sample applications will be placed in pjsip-apps/bin/samples directory, and the libraries in lib directory under each projects.
4.3 Debugging Sample Applications
Sample applications are built using Samples.mak makefile,
therefore it is difficult to setup debugging session in Visual Studio
for these applications. To solve this issue, the pjsip_apps workspace contain one project called sample_debug which can be used to debug a sample application.
To setup debugging using sample_debug project:
Set sample_debug project as Active Project
Edit debug.c file inside this project.
Modify the #include line to include the particular sample application to debug
Select Debug build.
Build and debug the project.
5. Building for Windows Mobile Targets (Windows CE/WinCE/PDA/SmartPhone)
PJ supports building SIP and media stacks and applications for
Windows Mobile targets. A very simple WinCE SIP user agent (with media)
application is provided just as proof of concept that the port works.
5.1 Requirements
The following development tools is needed to build SIP and media components for Windows Mobile:
Microsoft Visual Studio 2005 with appropriate SDKs for Windows Mobile.
Note that VS2005 Express Edition is not supported because the Windows Mobile SDKs is not supported there.
5.2 Building the Projects
The Windows Mobile port is included in the main source distribution.
Please follow the following steps to build the WinCE libraries and
sample application:
Open&pjproject-vs8.sln solution file.
For Windows Mobile Standard/Smartphone, select pjsua_wince&project as the Active Project.For Windows Mobile Professional/Pocket PC, both pjsua_wince and&PocketPJ can be chosen.
Select the appropriate SDK (for example Pocket PC 2003 SDK or SmartPhone 2003 SDK)
Select the appropriate configuration (for example, Win32 (WCE
Emulator Debug) to debug the program in emulator, or other
configurations such as ARMV4, MIPS, SH3, SH4, or whatever suitable for
the device)
Select the appropriate device (Emulator or the actual Device).
Build the project. This will build the sample WinCE application and all libraries (SIP, Media, etc.) needed by this application.
config_site_sample.h file, then there are certain configuration in
config_site_sample.h that get activated for Windows CE targets. Please
make sure that these configurations are suitable for the application.
The libraries, binaries and object files produced by the build process are located under build/wince-evc4/output directory of each projects.
6. Building for Other Targets
6.1. Symbian
The process for building PJ libraries for Symbian target is described in
6.2. Older PJLIB Build System for Non-Autoconf Targets (e.g. RTEMS)
The old PJLIB build system can still be used for building PJ libraries, for example for RTEMS target. Please see the
page in PJLIB Reference documentation for information on how to support new target using this build system.
Supported Targets
The older build system supports building PJ libraries for the following operating systems:
Cygwin and Mingw
And it supports the following target architectures:
i386, x86_64, itanium
For other targets, specific files need to be added to the build system, please see the
page in PJLIB Reference documentation for details.
Invoking the Build System
To invoke the older build system, run the following:
$ cd pjproject
$ ./configure-legacy
$ make dep && make clean && make
7. Running the Applications
Upon successful build, the output libraries (PJLIB, PJLIB-UTIL, PJMEDIA, PJSIP, etc.) are put under ./lib
sub-directory under each project directory. In addition, some
applications may also be built, and such applications will be put in ./bin sub-directory under each project directory.
pjsua is the reference implementation for both PJSIP and
PJMEDIA stack, and is the main target of the build system. Upon
successful build, pjsua application will be put in pjsip-apps/bin directory.
pjsua manual can be found in .
7.2 Sample Applications
Sample applications will be built with the Makefile build system.
For Visual Studio, you have to build the samples manually by selecting
and building the Samples project inside pjsip-apps/build/pjsip_apps.dsw project workspace.
Upon successful build, the sample applications are put in pjsip-apps/bin/samples directory.
The sample applications are described in
in the website.
7.3 pjlib-test
pjlib-test contains comprehensive tests for testing PJLIB
functionality. This application will only be built when the Makefile
with Visual Studio, one has to open pjlib.dsw project in pjlib/build directory to build this application.
If you're porting PJLIB to new target, it is recommended to run this application to make sure that all functionalities works as expected.
7.4 pjsip-test
pjsip-test contains codes for testing various SIP
functionalities in PJSIP and also to benchmark static performance
metrics such as message parsing per second.
8. Using PJPROJECT with Applications
Regardless of the build system being used, the following tasks are
normally needed to be done in order to build application to use PJSIP
and PJMEDIA:
Put these include directories in the include search path:
pjlib/include
pjlib-util/include
pjnath/include
pjmedia/include
pjsip/include
Put these library directories in the library search path:
pjlib-util/lib
pjnath/lib
pjmedia/lib
Include the relevant PJ header files in the application source
file. For example, using these would include ALL APIs exported by PJ:
&&&#include &pjlib.h&
&&&#include &pjlib-util.h&
&&&#include &pjnath.h&
&&&#include &pjsip.h&
&&&#include &pjsip_ua.h&
&&&#include &pjsip_simple.h&
&&&#include &pjsua-lib/pjsua.h&
&&&#include &pjmedia.h&
&&&#include &pjmedia-codec.h&
(Note: the documentation of the relevant libraries should say which header files should be
included to get the declaration of the APIs).
Declare the OS macros.
For Windows applications built with Visual Studio, we need to declare PJ_WIN32=1 macro in the project settings (declaring the macro in the source file may not be sufficient).
For Windows Mobile applications build with Visual C++, we need to declare PJ_WIN32_WINCE=1 macro in the project settings.
For GNU build system/autoconf based build system, we need to declare PJ_AUTOCONF=1 macro when compiling the applications.
the old PJ build system requires declaring the target processor with
PJ_M_XXX=1 macro, but this has been made obsolete. The target processor
will be detected from compiler's predefined macro by pjlib/config.h
Link with the appropriate PJ libraries. The following libraries will need to be included in the library link specifications:
Base library used by all libraries.
pjlib-util
Auxiliary library containing scanner, XML, STUN, MD5, getopt, etc, used by the SIP and media stack.
NAT helper library (STUN, TURN, ICE).
SIP core stack library.
SIP user agent library containing INVITE session, call transfer, client registration, etc.
pjsip-simple
SIP SIMPLE library for base event framework, presence, instant messaging, etc.
High level SIP UA library, combining SIP and media stack into high-level easy to use API.
The media framework.
pjmedia-codec
Container library for various codecs such as GSM, Speex, and iLBC.
Note: the actual library names will be appended with the target name and the build configuration. For example:
For Visual Studio builds
The actual library names will look like pjlib-i386-win32-vc6-debug.lib, pjlib-i386-win32-vc6-release.lib, etc., depending on whether we are building the Debug or Release version of the library.
easier way to link with the libraries is to include PJ project files in
the workspace, and to configure project dependencies so that the
application depends on the PJ libraries. This way, we don't need to
manually add each PJ libraries to the input library file specification,
since VS will automatically link the dependency libraries with the
application.
For Windows Mobile builds
Unfortunately the PJ libraries built for Windows Mobile will not be placed in the usual lib directory, but rather under the output directory under build/wince-evc4 project directory.
easier way to link with the libraries is to include PJ project files in
the workspace, and to configure project dependencies so that the
application depends on the PJ libraries. This way, we don't need to
manually add each PJ libraries to the input library file specification,
since VS will automatically link the dependency libraries with the
application.
For GNU builds
Use the template Makefile below (as described in ):
# Modify this to point to the PJSIP location.
PJBASE=/home/myself/pjproject-0.5.10.2
include $(PJBASE)/build.mak
&&&&&= $(APP_CC)
LDFLAGS = $(APP_LDFLAGS)
&= $(APP_LDLIBS)
&= $(APP_CFLAGS)
CPPFLAGS= ${CFLAGS}
# If your application is in a file named myapp.cpp or myapp.c
# this is the line you will need to build the binary.
all: myapp
myapp: myapp.cpp
$(CC) -o $@ $& $(CPPFLAGS) $(LDFLAGS) $(LDLIBS)
&&&&&&&&rm -f myapp.o myapp
Link with system spesific libraries:
Add (among other things): wsock32.lib, ws2_32.lib, ole32.lib, dsound.lib
Linux, *nix, *BSD
Add (among other things): '-lpthread -lm' (at least). If you use the template Makefile above, these would have been added by PJ.
Add (among other things): '-framework CoreAudio -lpthread -lm'. If you use the template Makefile above, these would have been added by PJ.
Appendix I: Common Problems/Frequently Asked Question (FAQ)
I.1 fatal error C1083: Cannot open include file: 'pj/config_site.h': No such file or directory
This error normally occurs when the config_site.h file has not been created. This file needs to be created manually (an empty file is sufficient). Please follow the
instructions above to create this file.
Thanks for using PJ libraries and for reading this document.
Please send feedbacks or general comments to &bennylp at pjsip dot}

我要回帖

更多关于 美国电压 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信