📄 main.cxx
字号:
/*
* main.cxx
*
* PWLib application source file for OhPhone
*
* A H.323 "net telephone" application.
*
* Copyright (c) 1998-2000 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Open H323 Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Portions of this code were written with the assisance of funding from
* Vovida Networks, Inc. http://www.vovida.com.
*
* Contributor(s): ______________________________________.
* Derek J Smithies (derek@indranet.co.nz)
* Walter H Whitlock (twohives@nc.rr.com)
*
* $Log: main.cxx,v $
* Revision 1.315 2003/08/04 04:07:54 dereksmithies
* Put H261 Capability back in the source
*
* Revision 1.314 2003/07/24 05:14:52 dereksmithies
* Support for vich263 added
*
* Revision 1.313 2003/06/12 19:39:11 shawn
* Added shared memory video input/output devices. Video frames of these two
* devices are stored in a named shared memory region and can be accessed by
* other applications.
*
* Revision 1.312 2003/06/04 19:03:58 shawn
* realtime scheduling for OSX is replaced by fixed priority scheduling in pwlib
*
* Revision 1.311 2003/05/23 05:19:03 rjongbloed
* Added extra #define for H263 codec
*
* Revision 1.310 2003/05/15 01:00:14 rjongbloed
* Fixed use of correct autoconf variable to include H.263 codec
*
* Revision 1.309 2003/05/14 13:58:39 rjongbloed
* Removed hack of using special payload type for H.263 for a method which
* would be less prone to failure in the future.
*
* Revision 1.308 2003/05/14 02:49:52 dereksmithies
* Add videolose option, so X percentage of video packets are dropped when in --videotest mode
*
* Revision 1.307 2003/05/07 02:45:58 dereks
* Alter ohphone to use the PSDLVideoOutputDevice class, which is now part of pwlib.
*
* Revision 1.306 2003/04/16 04:31:22 dereks
* Initial release of h263 video codec, which utilises the ffmpeg library.
* Thanks to Guilhem Tardy, and to AliceStreet
*
* Revision 1.305 2003/04/15 21:16:53 dereks
* Patch for firewire video applied - thanks to Goergi Georgiev.
*
* Revision 1.304 2003/04/04 02:14:34 robertj
* Fixed IPv6 support for ports on interfaces, pointed out by Kostas Stamos
*
* Revision 1.303 2003/03/31 00:22:32 dereks
* Can now read 20 digits, instead of 10, from the IXJ card. Thanks Jorge Minassian.
*
* Revision 1.302 2003/03/28 15:10:52 rogerh
* Add 127.0.0.1 to IP addresses which are not translated in NAT mode.
*
* Revision 1.301 2003/03/24 23:15:25 robertj
* Fixed change of variable name
*
* Revision 1.300 2003/03/21 04:21:30 robertj
* Fixed missing set of colour format in video output device.
*
* Revision 1.299 2003/03/20 23:49:14 dereks
* Improve formatting.
*
* Revision 1.298 2003/03/17 10:07:20 robertj
* Removed openh323 versions of videoio.h classes as PVideoOutputDevice
* descendants for NULL and PPM files added to PWLib.
* Moved window PVideoOutputDevice descendant to PWlib.
*
* Revision 1.297 2003/03/12 23:14:49 rogerh
* Changes to Mac OS X scheduling.
* Move Speex mode 2 codec to the end of the list (as it is poor quality).
* Changes to console to ignore new lines.
*
* Revision 1.296 2003/03/05 20:29:21 rogerh
* Enable realtime priority on Mac OS X. Submitted by Shawn.
*
* Revision 1.295 2003/02/28 08:48:44 rogerh
* Change the few instances of cerr to cout. This helps Shawn's Mac OS X
* XMeeting application (Approved by Robert).
*
* Revision 1.294 2003/02/25 03:49:09 dereks
* Fix spelling error.
*
* Revision 1.293 2003/02/18 03:58:55 dereks
* IEEE1394 AVC patch from Georgi Georgiev. Thanks!
*
* Revision 1.292 2003/01/11 05:35:43 robertj
* Added support for IEEE 1394 AV/C cameras, thanks Georgi Georgiev
*
* Revision 1.291 2003/01/06 21:23:54 rogerh
* Add NetBSD changes
* Submitted by Andreas Wrede (taken in part from NetBSD's package system)
*
* Revision 1.290 2002/12/16 09:27:38 robertj
* Added new video bit rate control, thanks Walter H. Whitlock
*
* Revision 1.289 2002/11/13 10:18:03 rogerh
* Speex is included by default. So remove the HAS_SPEEX test.
*
* Revision 1.288 2002/11/10 08:12:42 robertj
* Moved constants for "well known" ports to better place (OPAL change).
*
* Revision 1.287 2002/11/05 04:54:48 robertj
* Fixed test for jitter buffer size adjustment
*
* Revision 1.286 2002/10/31 00:54:13 robertj
* Enhanced jitter buffer system so operates dynamically between minimum and
* maximum values. Altered API to assure app writers note the change!
*
* Revision 1.285 2002/10/25 01:58:21 dereks
* Tidy up capability setting for Cu30
*
* Revision 1.284 2002/10/23 17:55:01 rogerh
* Check for all RFC1918 private IP addresses in the NAT transslation code
*
* Revision 1.283 2002/10/15 10:46:43 rogerh
* Add tweak by Sahai to support operation behind a NAT that forwards ports.
* This uses TranslateTCPAddress to change the address reported to connections
* that occur from outside the 192.x.x.x subnet. Copied from OpenMCU.
*
* Revision 1.282 2002/09/16 23:43:37 robertj
* Fixed typo in setting user input capabilities, thanks Simon Heron
*
* Revision 1.281 2002/08/29 00:22:27 craigs
* Fixed cut and past error PR#78, thanks to zbyszek@mazurkiewicz.org
*
* Revision 1.280 2002/08/15 02:30:39 craigs
* Added G726 codec capabilities
*
* Revision 1.279 2002/08/14 04:24:16 craigs
* Added Speex codecs
*
* Revision 1.278 2002/08/07 00:46:42 dereks
* Report statistics for video RTP packets. (No output if no video session)
*
* Revision 1.277 2002/08/05 01:33:13 robertj
* Fixed incorrect override of the SetupTransfer() function that stopped the
* ability to do H.250 call transfer, thanks Vladimir Toncar
*
* Revision 1.276 2002/07/18 03:04:34 robertj
* Use function interface for port setting.
*
* Revision 1.275 2002/07/16 04:53:57 dereks
* Fix type in setting port ranges.
*
* Revision 1.274 2002/07/04 07:57:30 robertj
* Removed the strange #ifdef which prevented OhPhone from using H.235 RAS.
*
* Revision 1.273 2002/05/30 22:50:28 dereks
* All available video input devices are now reported in the trace file, level 1.
*
* Revision 1.272 2002/05/26 23:28:38 rogerh
* Fix videobitrate comment.
*
* Revision 1.271 2002/05/20 08:49:30 rogerh
* Add note that for NetMeeting use --videotxquality 4
*
* Revision 1.270 2002/05/06 02:55:47 dereks
* Fix operation of --autodisconnect n , so works when video enabled.
*
* Revision 1.269 2002/05/03 05:39:31 robertj
* Added Q.931 Keypad IE mechanism for user indications (DTMF).
*
* Revision 1.268 2002/04/26 03:33:32 dereks
* Major upgrade. All calls to SDL library are now done by one thread.
*
* Revision 1.267 2002/04/18 07:46:28 craigs
* Added new functions to remove H245 in SETUP, and to allow removal of
* user input indication capabilities
*
* Revision 1.266 2002/04/05 01:39:56 dereks
* Format change of output from TestVideoGrabber routine.
*
* Revision 1.265 2002/04/05 00:55:02 dereks
* Modify TestVideoGrabber so it displays the raw image, and the decoded
* form of the encoded raw image. Thanks to Walter Whitlock - good work.
*
* Revision 1.264 2002/04/01 18:40:30 robertj
* Fixed MSVC warnings.
*
* Revision 1.263 2002/03/27 06:17:28 robertj
* Added ability to set base of dynamic TCP/UDP ports, thanks Mark Cooke.
*
* Revision 1.262 2002/03/14 07:07:58 robertj
* Fixed missing new line if call time not printed.
*
* Revision 1.261 2002/03/05 05:44:48 robertj
* Fixed lincorrect message on bandwidth, thanks Ryutaroh Matsumoto
*
* Revision 1.260 2002/02/27 14:28:45 rogerh
* Fix typo in error report. Thanks to Andreas Wrede <awrede@mac.com>
*
* Revision 1.259 2002/02/25 08:05:32 robertj
* Changed to utilise preferred colour format, thanks Martijn Roest
*
* Revision 1.258 2002/02/21 01:26:38 dereks
* With --videotest, there is now no need to select --videotransmit
*
* Revision 1.257 2002/02/20 02:41:26 dereks
* Remove a PTRACE statement, as it is not needed.
*
* Revision 1.256 2002/02/20 02:39:37 dereks
* Initial release of Firewire camera support for linux.
* Many thanks to Ryutaroh Matsumoto <ryutaroh@rmatsumoto.org>.
*
* Revision 1.255 2002/02/14 22:36:30 robertj
* Added display of user input send mode.
*
* Revision 1.254 2002/01/28 10:43:57 rogerh
* Wrap some code with HAS_LIDDEVICE so it compiles on systems without
* IxJ and VPBlaster
*
* Revision 1.253 2002/01/26 00:13:40 robertj
* Fixed MSVC warning
*
* Revision 1.252 2002/01/24 13:19:08 rogerh
* Gnomemeeting is using UserInputStrings to send text messages between users.
* Strings are sent with a "MSG" header to identify them. Add 'M' menu
* option to send text message. Received messages are displayed on screen.
*
* Revision 1.251 2002/01/24 07:42:37 robertj
* Added ability to turn off H.245 negotiations in SETUP option
*
* Revision 1.250 2002/01/23 14:18:31 rogerh
* Allow * and # user input indications from the menu
*
* Revision 1.249 2002/01/20 23:41:34 craigs
* Fix crash if UserInputIndication received when not using LID device
*
* Revision 1.248 2002/01/18 03:05:59 robertj
* Added ability to set the mode for sending user input (DTMF)
*
* Revision 1.247 2002/01/16 00:47:49 craigs
* Changed to remove PCM-based capabilities when device cannot do PCM
*
* Revision 1.246 2002/01/15 05:50:07 craigs
* Added support for VoIPBlaster
*
* Revision 1.245 2002/01/14 04:43:00 robertj
* Added preferred colour format selection, thanks Walter Whitlock (really!)
*
* Revision 1.244 2002/01/14 03:21:12 robertj
* Added ability to set capture caolour format, thanks Walter Whitlock
*
* Revision 1.243 2002/01/11 03:09:31 robertj
* Fixed display of call duration, now only "charged" part of call (from the
* CONNECT pdu) and does not include ringing time.
*
* Revision 1.242 2002/01/04 04:17:52 dereks
* Add code from Walter Whitlock to flip video, and improve the
* --videotest mode, which displays local video (without a call). Many thanks.
*
* Revision 1.241 2001/12/04 03:03:51 dereks
* Copy command line to log file.
*
* Revision 1.240 2001/11/28 22:55:32 robertj
* Fixed setting of silence detect from command line parameter.
*
* Revision 1.239 2001/11/28 00:11:31 dereks
* Update to cope with revised video frame rate code
* Additional debug information when run in --videotest mode.
*
* Revision 1.238 2001/10/27 07:04:46 rogerh
* Fix a bug which prevented ohphone exiting after a call in --disable-menu
* mode and which prevented autorepeat mode from working.
*
* Revision 1.237 2001/10/23 02:40:46 dereks
* Fix bracket problem in Cu30 release of code.
*
* Revision 1.236 2001/10/23 02:21:39 dereks
* Initial release CU30 video codec.
* Add --videotest option, to display raw video, but not invoke a call.
*
* Revision 1.235 2001/09/25 03:18:09 dereks
* Add code from Tiziano Morganti to set bitrate for H261 video codec.
* Use --videobitrate n Thanks for your code - good work!!
*
* Revision 1.234 2001/09/14 06:02:40 robertj
* Added ability for number that does not match a speed dial to be passed
* to the gatekeeper for processing, thanks Chih-Wei Huang
*
* Revision 1.233 2001/08/24 13:57:37 rogerh
* Delete the listener if StartListener() fails.
*
* Revision 1.232 2001/08/22 01:30:21 robertj
* Resolved confusion with YUV411P and YUV420P video formats, thanks Mark Cooke.
*
* Revision 1.231 2001/08/10 10:06:10 robertj
* No longer need SSL to have H.235 security.
*
* Revision 1.230 2001/08/08 05:09:09 dereks
* Add test for presence/absence of SDL if the --videoreceive sdl option is used.
* Thanks for the suggestion Greg Hosler
* Break up the creation of the video grabber into individual components.
* Add PTRACE commands to report on failures.
*
* Revision 1.229 2001/08/07 05:02:58 robertj
* Added command line argument for H.235 gatekeeper password.
*
* Revision 1.228 2001/07/12 06:25:08 rogerh
* create seperate variables for ulaw and alaw codecs
*
* Revision 1.227 2001/07/06 01:50:10 robertj
* Changed memory check code to be conditionally compiled by
* PMEMORY_CHECK and not just _DEBUG.
*
* Revision 1.226 2001/05/17 07:11:29 robertj
* Added more call end types for common transport failure modes.
*
* Revision 1.225 2001/05/10 23:47:45 robertj
* Added trim to transfer command so can have leading spaces.
*
* Revision 1.224 2001/05/09 04:59:02 robertj
* Bug fixes in H.450.2, thanks Klein Stefan.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -