OSDN Git Service

Add MS7619SE
[uclinux-h8/uClinux-dist.git] / lib / libopenh323 / ReadMe.txt
1                           OpenH323 Library
2                           ================
3
4
5
6 The OpenH323 project aims to create a full featured, interoperable, Open
7 Source implementation of the ITU H.323 teleconferencing protocol that can be
8 used by personal developers and commercial users without charge.
9
10 OpenH323 development is coordinated by an Australian company, Equivalence Pty
11 Ltd (http://www.equival.com), but is open to any interested party. Commercial
12 and private use of the OpenH323 code, including use in commercial products
13 and resale,  is enouraged through use of the MPL (Mozilla Public license).
14
15
16 For more details see http://www.openh323.org
17
18 You can subscribe to the mailing list at http://www.openh323.org/mailman/listinfo
19
20 Frequently asked questions are answered at http://www.openh323.org/faq.html
21
22
23
24 Building the OpenH323 Code
25 ==========================
26
27 This page describes how to compile the OpenH323 code release. Note these
28 instructions will always refer to the latest snapshot available on the
29 download page.
30
31 The OpenH323 source will have been compiled and tested under Linux x86, and
32 Windows NT. If it does not compile for you then the problem is likely to be a
33 setup/configuration problem with your system and not a problem with the
34 source code itself.
35
36 The libraries and applications should also compile on Windows 95/98, BeOS
37 (thanks Yuri!), Linux PPC, FreeBSD x86, OpenBSD x86 (thanks Roger!) and
38 Solaris Sparc & x86. They are not automatically compiled on every release
39 however so there could be problems, but the chances are that there aren't.
40 Note also that not all of these platforms may have ports of the sound
41 interface.
42
43 We are also happy to port it to other Unix flavours providing people out
44 there can provide an account and a fair bit of disk space!
45
46 These instructions should contain all of the steps need. If you have a problem,
47 please double check that you have performed ALL of the steps below,
48 particularly setting the include file paths under MSVC. Some of the more
49 common errors are described below.
50
51 If you get a lot of compile or link errors, then the chances are that you
52 have missed something in the list. If you are positive that something is
53 wrong and you have followed the instructions, then send an e-mail to the
54 mailing list, and we'll answer it for everyone to see. Bear in mind that the
55 first question asked will be "did you follow the instructions".
56
57
58
59
60 Windows
61 -------
62
63 1.  Download the pwlib_1.xx.zip and openh323_1.x.zip files from the OpenH323
64     download page. 
65
66 2.  Follow the instructions for building PWLib. 
67
68 3.  Start MSVC (v5 or v6). If you have another compiler you are on your own!
69     Go into the Tools menu, Options item, Directories tab and add to the
70     beginning of the Include files path (note the order is important!):
71
72         C:\OpenH323\Include
73
74     and add to the Lib Files path and the Executable Files path the following:
75
76         C:\OpenH323\Lib
77
78     Also make sure the last directory is in your PATH environment variable.
79
80     Note this is in addition to the ones in PWLib!!
81  
82 4.  Use the OpenH323.dsw file to build the sample code, eg SimpH323.
83
84     The build should automatically create a file openh323/include/openh323buildopts.h
85     via the configure.exe program that should be in the openh323 directory. If
86     you have any problems try running the program directly from a command
87     line. Use ".\configure --help" to get information on options such as
88     forcing a feature or library dependency.
89
90     Note there are additional notes in the "Platform Specific Issues" on how
91     to compile the various libraries in a manner suitable for use by OpenH323
92     under Windows.
93
94 5.  Run the program, and you are on your own! 
95
96
97
98 Unix
99 ----
100
101 1.  Download the pwlib_min_1.xx.tar.gz and openh323_1.xx.tar.gz files from
102     the OpenH323 download page. 
103
104 2.  Follow the instructions for building PWLib. 
105
106 3.  Extract the contents of the openh323_1.x.tar.gz file somewhere, eg:
107
108       cd
109       tar -xzvf openh323_1.1alpha1.tar.gz
110  
111 4.  If you have not installed OpenH323 in your home directory (~/openh323)
112     then you will have to define the environment variable OPENH323DIR to
113     point to the correct directory.
114
115     Also make sure you have added the $OPENH323DIR/lib directory to your
116     LD_LIBRARY_PATH environment variable if you intend to use shared libraries
117     (the default under Linux).
118
119     There are examples for sh/bash and csh/tcsh below.
120  
121 5.  Build the H323 bootstrap code. Enter:
122
123         cd $(OPENH323DIR)
124         ./configure
125         make opt
126
127     This may take some time, especially with the h245_*.cxx and h225.cxx
128     files. You may also need to add more swap space - 64M of real memory and
129     64M of swap might just be enough, if your machine does nothing else! Some
130     people have reported needing as much as 256M of swap - if your compiler
131     bombs out with a "virtual memory exhausted" error compiling h245_*.cxx
132     and h225.cxx, then increase your swap space.
133  
134     Less space is required if you build the debug version - Debug builds on 64M ram are
135     very achievable. Opt builds on 164M ram are doable, but only just.
136
137 6.  The result should be an executable called simph323, which will be located
138     in a directory dependent on the platform, eg sample/simple/obj_linux_x86_d.
139     To run it, use the following command:
140
141         ./sample/simple/obj_linux_x86_r/simph323
142
143     and you should get the usage help text.
144
145 9.  Now you're on your own! 
146
147
148
149 Voice Age G.729 Codec
150 =====================
151
152 For the Windows system it is possible to also have a G.729 codec
153 for non-commercial use by adding the Voice Age G.729A library to the system.
154 To do this:
155
156 1.  Get the Voice Age G.729 library from http://www.voiceage.com/g729/
157
158 2.  Unpack it somewhere, preferably at teh same level as OpenH323, eg if
159     c:\work\openh323, then c:\work\va_g729a
160
161 3.  Re-run the configure program.
162
163 4.  Recompile your project.
164
165
166
167 H263 Codec
168 ==========
169
170   H263 is a video compression format which is especially suited for low
171   bandwidth situations, such as a dial up link. By adding the requisite
172   library, recompiling openh323 and ohphone applications, H263 support is
173   available.
174
175   Three H.263 codecs are available in the Openh323 codebase:
176
177     1) A fully RFC2190 compliant version using FFMPEG
178     2) An older non-RFC2190 compliant version also using FFMPEG
179     3) A non-RFC2190 compliant version using vich263
180
181   1) Fully RFC2190 compliant using FFMPEG.
182   This is the only H.263 codec currently interoperable with other RFC2190 compliant
183   applications like NetMeeting. As such, it is the recommended H.263 codec for use
184   in all future applications based on OpenH323.
185
186   2) Non-RFC2190 compliant using FFMPEG.
187   This H263 codec was labelled as non standard. Some hacks were added to the packets
188   generated by ffmpeg to get it working in a voip environment.
189
190   1) + 2) FFMPEG license issue
191   FFMPEG is licensed as either LGPL or GPL, depending on which components were used
192   at built time. Please check the configure script for further information.
193   OpenH323 assumes a LGPL license, and dynamically loads the FFMPEG library at run-time
194   in accordance with those terms.
195
196   3) VICH263
197    Andrew Morrow who did the hard part of the implementation reports that:
198     I got something working using vic's H.263 (not plus) in OpenH323.
199
200    It does not interoperate with NetMeeting, but it does interoperate with
201    IBM's J323/JMF.
202
203
204 Unix
205 ----
206     The library was built with
207
208       cd external/ffmpeg
209       ./configure --enable-shared --disable-a52 --disable-pp --disable-ffserver --disable-ffplay
210       cd libavcodec
211       make 
212       
213     The code is in the CVS, external/ffmpeg directory at sourceforge.
214     Instructions on using the cvs are at http://sourceforge.net/cvs/?group_id=80674
215
216       cd external/vich263
217       make
218
219     If you have the external directory on your box, with vich263 and ffmpeg, but do
220     not wish to enable ffmpeg or vich263, you can
221         
222       cd openh323
223       ./configure
224       make
225
226     On recompiling the openh323 directory, you will not do configure again, so
227     your ffmpeg and vich263 settings will remain.
228
229     Should you wish to build in support for all H263 codecs, do:
230
231       export H323_VICH263=1
232       export H323_AVCODEC=1
233       cd openh323
234       ./configure --avcodec-dir=<<dir>> --enable-rfc2190avcodec=<<dir>>
235       make
236
237     Now, if you just want one of the codecs, just have the appropriate export statement.
238     Note that when you do ./configure, there is a clear statement what codec is on.
239     If you wish to remove both codecs, (after doing a configure with them on), do
240
241       export H323_VICH263=""
242       export H323_AVCODEC=""
243       cd openh323
244       ./configure
245       make
246
247     Now, these settings are fixed, and remain in place on subsequent makes. Thus,
248     on recompiling the openh323 dir, you don't need to rerun configure.
249
250     Now, to test the operation of the H263 codec. I used the command below in
251     the ohphone directory:
252      
253       ./obj_linux_x86_r/ohphone -ln --videotest --videolocal \
254             --videoreceive sdl --videodevice fake --videoinput 1 \
255             --videobitrate 24
256
257     This brings up a SDL display window with two copies of the same image. The
258     image on the right is generated by the fake video device, on channel 1.
259     The image on the left is the decoded form of an image that has been
260     encoded with H263.
261
262     Wait a while, and then type q, the display will tell you what bit rate
263     was achieved, and the frame rate. The achieved bit rate should always be
264     less than that specified in the --videobitrate option
265
266     Now, you can try the H261 codec instead. To use H261, add to the command
267     line -D 263, so your command line becomes:
268
269       ./obj_linux_x86_r/ohphone -ln --videotest --videolocal \
270             --videoreceive sdl --videodevice fake --videoinput 1 \
271             --videobitrate 24 -D 263
272
273     Get mean, set a bit rate of 12 Kilobits/sec
274
275     Now, you might have a problem with it not finding the libavcodec.so library.
276     In this case, you need to extend your LD_LIBRARY_PATH
277
278       export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
279
280     or append to /etc/ld.so.conf the directory /usr/local/lib and rerun ldconfig
281
282       ldconfig -C /etc/ld.so.conf   Do this command as root.
283
284     Alternatively, append to the configure command above the phrase
285     --prefix=/usr. This will cause all the ffmpeg stuff to go in system
286     directories, where it will be found guaranteed.
287
288
289 Windows
290 -------
291     The ffmpeg codec is built with MinGW and MSys.
292
293     Move ffmpeg directory from c:\external to c:\msys\1.0\home\administrator
294
295     Start msys
296
297       cd ffmpeg
298       ./configure --extra-cflags="-mno-cygwin -mms-bitfields" --extra-ldflags="-Wl,--add-stdcall-alias" --enable-mingw32 --enable-shared --disable-a52 --disable-pp --disable-ffserver --disable-ffplay
299       cd libavcodec
300       make
301
302     Move ffmpeg back to c:\external
303
304     Move c:\external\ffmpeg\libavcodec.dll to c:\openh323\lib
305
306     Compile libvich263
307     Go to external\vich263
308     Open the libvich263 workspace.
309     Select batch build, buld release and debug.
310     Leave libvich263.lib where it puts this library.
311
312     Open up a dos terminal, and go to c:\openh323
313
314       configure
315
316     Check that options are set correctly in c:\openh323\include\openh323buildopts.h
317
318     If it fails to build openh323buildopts.h, well, it is OK.
319     Copy from pwlib/tools/configure the files configure.cpp and configure.dsp to the directory c:\openh323
320     Open configure.dsp project in msvc, build and run configure.exe
321
322     Recompile the OpenH323Lib and OpenH323DLL projects to create new OpenH323 libraries.
323
324
325 More information
326 ----------------
327     License details and a precompiled FFMPEG library:
328       http://www.voxgratia.org/h263_codec.html
329
330     MinGW/MSys and FFMPEG library building instructions:
331       http://www.salyens.com/?page=ffcodec
332
333
334
335 Common errors
336 =============
337
338 Here are common errors you might encounter for both Windows and Unix builds.
339
340   An error like:
341     "Makefile", line 175: Missing dependency operator
342     "Makefile", line 177: Need an operator
343     "Makefile", line 179: Missing dependency operator
344     "Makefile", line 181: Need an operator
345     "Makefile", line 183: Missing dependency operator
346     "Makefile", line 185: Need an operator
347
348         Indicates you are using BSD Unix's Make command. You need to use
349         gmake (GNU Make).
350
351   Thinking there are missing files.
352
353         A number of files, eg h235.h, h225.h etc, are generated files that are
354         created during the build process. If they are missing then something
355         probably went wrong with installation of flex/bison.
356
357   An error like:
358     Linking...
359     LINK : fatal error LNK1181: cannot open input file "ptlib.lib"
360     Error executing link.exe.
361
362         Indicates you have not set the paths in MSVC directories.
363
364   An error like:
365     Performing Bison Step
366     c:\tools\share\bison.simple: No such file or directory
367
368         Indicates you have not installed bison correctly. In particular the
369         bison.simple file must be available to bison. Check the bison
370         documentation for details on this.
371
372   Attempting to compile GUI systems under Unix.
373
374         There are a number of partial implementations of the GUI code in the
375         $PWLIBDIR/src/pwlib directory tree. These are not required to get the
376         OhPhone application compiled. If you get those systems from the CVS
377         then you are basically on your own. Do not ask for support unless you
378         intend to help with the implementation!
379
380
381 See the FAQ at http://www.openh323.org/~openh323/fom.cgi for more.
382
383
384
385 Example environment for sh/bash
386 -------------------------------
387
388 PWLIBDIR=$HOME/pwlib
389 export PWLIBDIR
390 OPENH323DIR=$HOME/openh323
391 export OPENH323DIR
392 LD_LIBRARY_PATH=$PWLIBDIR/lib:$OPENH323DIR/lib
393 export LD_LIBRARY_PATH
394 Example environment for csh/tcsh:
395
396 setenv PWLIBDIR $HOME/pwlib
397 setenv OPENH323DIR $HOME/openh323
398 setenv LD_LIBRARY_PATH $PWLIBDIR/lib:$OPENH323DIR/lib
399
400
401
402
403 Bison problem under Unix
404 ------------------------
405
406 The bison.simple file on many releases will not compile with the options used
407 by the PWLib getdate.y grammar. The options are required to make the date
408 parser thread safe so it is necessary to edit the bison.simple file to fix
409 the problem.
410
411 The file is usually at /usr/lib/bison.simple but in the tradition of unix
412 could actually be anywhere. We leave it up to you to find it.
413
414 The code:
415
416 /* Prevent warning if -Wstrict-prototypes. */
417 #ifdef __GNUC__
418 int yyparse (void);
419 #endif
420 should be changed to
421
422 /* Prevent warning if -Wstrict-prototypes. */
423 #ifdef __GNUC__
424 #ifndef YYPARSE_PARAM
425 int yyparse (void);
426 #endif
427 #endif
428
429 To prevent the incorrect function prototype from being defined. The getdate.y
430 should then produce a getdate.tab.c file that will actually compile.
431
432
433
434
435 Licensing
436 ---------
437
438 The bulk of this library is licensed under the MPL (Mozilla Public License)
439 version 1.0. In simple terms this license allows you to use the library for
440 any purpose, commercial or otherwise, provided the library is kept in tact
441 as a separate entity and any changes made to the library are made publicly
442 available under the same (MPL) license. It is important to realise that that
443 refers to changes to the library and not your application that is merely
444 linked to the library.
445
446 Note that due to a restriction in the GPL, any application you write that
447 uses anything another than GPL, eg our library with MPL, is technically in
448 breach of the GPL license. However, it should be noted that MPL does not
449 care about the license of the final application, and as only the author of
450 the GPL application is in breach of his own license and is unlikely to sue
451 themselves for that breach, in practice there is no problem with a GPL
452 application using an MPL or any other commercial library.
453
454
455
456 Portions of this library are derived from TOAST, using the copyright:
457
458 Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann,
459 Technische Universitaet Berlin
460
461 Any use of this software is permitted provided that this notice is not
462 removed and that neither the authors nor the Technische Universitaet Berlin
463 are deemed to have made any representations as to the suitability of this
464 software for any purpose nor are held responsible for any defects of
465 this software.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
466
467 As a matter of courtesy, the authors request to be informed about uses
468 this software has found, about bugs in this software, and about any
469 improvements that may be of general interest.
470
471
472
473 Portions of this library is derived from vic, http://www-nrg.ee.lbl.gov/vic/
474 Their copyright notice is below.
475
476  * Copyright (c) 1993-1995 The Regents of the University of California.
477  * All rights reserved.
478  * 
479  * Redistribution and use in source and binary forms, with or without
480  * modification, are permitted provided that the following conditions
481  * are met:
482  * 1. Redistributions of source code must retain the above copyright
483  *    notice, this list of conditions and the following disclaimer.
484  * 2. Redistributions in binary form must reproduce the above copyright
485  *    notice, this list of conditions and the following disclaimer in the
486  *    documentation and/or other materials provided with the distribution.
487  * 3. All advertising materials mentioning features or use of this software
488  *    must display the following acknowledgement:
489  *      This product includes software developed by the Network Research
490  *      Group at Lawrence Berkeley National Laboratory.
491  * 4. Neither the name of the University nor of the Laboratory may be used
492  *    to endorse or promote products derived from this software without
493  *    specific prior written permission.
494  * 
495  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
496  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
497  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
498  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
499  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
500  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
501  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
502  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
503  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
504  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
505  * SUCH DAMAGE.
506
507
508 Building on a unix box - how do I use the CVS - quick start - with all H263 codecs
509 ---------------------------------------------------------------------------------
510 1)Remove all pwlib/openh323 from system directories.
511    (like /usr/local/src/   or /usr/include  etc)
512
513 2)create a directory, (call it cvs_h323)
514
515 3)cd cvs_h323
516
517 4)In cvs_h323, create a file called environment.
518
519 The contents of the file are::::: export PWLIBDIR=~/cvs_h323/pwlib
520 export OPENH323DIR=~/cvs_h323/openh323
521
522 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/cvs_h323/pwlib/lib 
523 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/cvs_h323/openh323/lib: 
524 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/cvs_h323/external/ffmpeg/libavcodec:
525 export CVSROOT=:pserver:anonymous@cvs.sourceforge.net:/cvsroot/openh323
526
527 5) source environment
528
529 6) cvs login (For the password, just press enter)
530
531 7) cvs -z3 co ptlib_unix openh323 contrib external
532
533 8) cd pwlib
534
535 9) ./configure
536
537 10) make all
538
539 11) cd ../external/ffmpeg (Now, read above for building and installing ffmpeg
540                      & vich263) If you don't want h263 codecs, skip this line.
541
542 12) cd ../openh323
543
544 13) export H323_VICH263=1; export H323_AVCODEC=1 (If you don't want h263 codecs, skip this line.)
545
546 14) ./configure --enable-rfc2190avcodec=~/cvs_h323/external/ffmpeg/libavcodec 
547          (((There should be messages about finding vic & ffmpeg)))
548
549 15) make all
550
551 16) cd ../contrib/openmcu   (or ../contrib/ohphone, or whereever)
552
553 17) make all
554
555                           __oo^oo__