├── Configuration.md ├── Configuration_AVPF_tail_length.md ├── Configuration_Audio.md ├── Configuration_Audio_Video_codecs.md ├── Configuration_Bridge_configuration.md ├── Configuration_Debugging_the_system.md ├── Configuration_NAT_Firewall_traversal.md ├── Configuration_Presentation_sharing.md ├── Configuration_RTP_buffer_size.md ├── Configuration_Recording_conference_to_a_file.md ├── Configuration_SIP_network_transports.md ├── Configuration_SIP_registration.md ├── Configuration_Security.md ├── Configuration_Video.md ├── Makefile.am ├── README.md ├── SSL_CA.der ├── SSL_CA.pem ├── SSL_Priv.pem ├── SSL_Pub.der ├── SSL_Pub.pem ├── Support_BuildingSourceCode.md ├── Support_FAQ.md ├── Support_Known_issues.md ├── Support_Roadmap.md ├── Support_Testing_the_system.md ├── Support_Tips.md ├── Technical_Audio_mixer_design.md ├── Technical_Bandwidth_management_and_congestion_control.md ├── Technical_Call_session_management.md ├── Technical_NAT_and_firewall_traversal.md ├── Technical_Presentation_sharing.md ├── Technical_Protecting_a_bridge_with_password.md ├── Technical_Recording_conference_to_a_file.md ├── Technical_SA_versus_AS_modes.md ├── Technical_Security.md ├── Technical_Stereoscopic_spatial_3D_audio.md ├── Technical_Video_mixer_design.md ├── Technical_Video_quality.md ├── autogen.sh ├── configure.ac ├── documentation ├── technical-guide.doc └── technical-guide.pdf ├── doubango ├── tinyBFCP.vcproj ├── tinyDAV.vcproj ├── tinyHTTP.vcproj ├── tinyIPSec.vcproj ├── tinyMEDIA.vcproj ├── tinyMSRP.vcproj ├── tinyNET.vcproj ├── tinyRTP.vcproj ├── tinySAK.vcproj ├── tinySDP.vcproj ├── tinySIGCOMP.vcproj ├── tinySIP.vcproj ├── tinySMS.vcproj └── tinyXCAP.vcproj ├── fonts └── truetype │ └── freefont │ ├── AUTHORS │ ├── COPYING │ ├── CREDITS │ ├── ChangeLog │ ├── FreeMonoBold.ttf │ ├── FreeSerif.ttf │ ├── INSTALL │ ├── README │ ├── TROUBLESHOOTING │ └── USAGE ├── images ├── audio_mixer_resampler.png ├── logo.jpg ├── logo.png ├── logo35x34.jpg └── presentation_sharing.png ├── include ├── OpenTelepresenceAPI.h ├── OpenTelepresenceConfig.h └── opentelepresence │ ├── OTBridge.h │ ├── OTBridgeInfo.h │ ├── OTCodec.h │ ├── OTCodecAudio.h │ ├── OTCodecVideo.h │ ├── OTCommon.h │ ├── OTEngine.h │ ├── OTFrame.h │ ├── OTFrameAudio.h │ ├── OTFrameVideo.h │ ├── OTMixerMgr.h │ ├── OTMixerMgrAudio.h │ ├── OTMixerMgrMgr.h │ ├── OTMixerMgrVideo.h │ ├── OTMutex.h │ ├── OTObject.h │ ├── OTProcess.h │ ├── OTProxyPlugin.h │ ├── OTProxyPluginConsumer.h │ ├── OTProxyPluginConsumerAudio.h │ ├── OTProxyPluginConsumerVideo.h │ ├── OTProxyPluginMgr.h │ ├── OTProxyPluginProducer.h │ ├── OTProxyPluginProducerAudio.h │ ├── OTProxyPluginProducerVideo.h │ ├── OTResampler.h │ ├── OTRole.h │ ├── OTSessionInfo.h │ ├── OTWrap.h │ ├── cfg │ ├── OTCfg.h │ └── OTCfgParser.h │ ├── docstreamer │ ├── OTDocStreamer.h │ └── OTDocStreamerOpenOffice.h │ ├── filters │ ├── OTFilter.h │ └── OTOverlay.h │ ├── jsoncpp │ ├── json-forwards.h │ └── json.h │ ├── mixers │ ├── OTMixer.h │ ├── OTMixerAudio.h │ ├── OTMixerAudio2D.h │ ├── OTMixerAudio3D.h │ ├── OTMixerVideo.h │ ├── OTMixerVideo2D.h │ └── OTMixerVideo3D.h │ ├── nettransport │ ├── OTHttpTransport.h │ └── OTNetTransport.h │ ├── patterns │ ├── OTPattern.h │ ├── OTPatternVideo.h │ ├── OTPatternVideoHangout.h │ └── OTPatternVideoWebEx.h │ ├── platforms │ ├── generic │ │ └── OTEngineGen.h │ ├── osx │ │ └── OTEngineOSX.h │ └── win32 │ │ └── OTEngineWin32.h │ ├── presence │ ├── OTPresenceNotifer.h │ └── OTPresenceParser.h │ └── recorder │ ├── OTRecorder.h │ └── OTWebM.h ├── opentelepresence.sln ├── ragel ├── cfg.rl └── ragel.sh ├── self-signed-certs.sh ├── source ├── OTBridge.cc ├── OTBridgeInfo.cc ├── OTCodec.cc ├── OTCodecAudio.cc ├── OTCodecVideo.cc ├── OTEngine.cc ├── OTFrame.cc ├── OTFrameAudio.cc ├── OTFrameVideo.cc ├── OTMixerMgr.cc ├── OTMixerMgrAudio.cc ├── OTMixerMgrMgr.cc ├── OTMixerMgrVideo.cc ├── OTMutex.cc ├── OTObject.cc ├── OTProcess.cc ├── OTProxyPlugin.cc ├── OTProxyPluginConsumer.cc ├── OTProxyPluginConsumerAudio.cc ├── OTProxyPluginConsumerVideo.cc ├── OTProxyPluginMgr.cc ├── OTProxyPluginProducer.cc ├── OTProxyPluginProducerAudio.cc ├── OTProxyPluginProducerVideo.cc ├── OTResampler.cc ├── OTSessionInfo.cc ├── OTWrap.cc ├── cfg │ ├── OTCfg.cc │ └── OTCfgParser.cc ├── docstreamer │ ├── OTDocStreamer.cc │ └── OTDocStreamerOpenOffice.cc ├── filters │ ├── OTFilter.cc │ └── OTOverlay.cc ├── jsoncpp │ └── jsoncpp.cc ├── main.cc ├── mixers │ ├── OTMixer.cc │ ├── OTMixerAudio.cc │ ├── OTMixerAudio2D.cc │ ├── OTMixerAudio3D.cc │ ├── OTMixerVideo.cc │ ├── OTMixerVideo2D.cc │ └── OTMixerVideo3D.cc ├── nettransport │ ├── OTHttpTransport.cc │ └── OTNetTransport.cc ├── patterns │ ├── OTPattern.cc │ ├── OTPatternVideo.cc │ ├── OTPatternVideoHangout.cc │ └── OTPatternVideoWebEx.cc ├── platforms │ ├── generic │ │ └── OTEngineGen.cc │ ├── osx │ │ └── OTEngineOSX.cc │ └── win32 │ │ └── OTEngineWin32.cc ├── presence │ ├── OTPresenceNotifer.cc │ └── OTPresenceParser.cc └── recorder │ ├── OTRecorder.cc │ └── OTWebM.cc ├── telepresence.cfg ├── telepresence.vcproj ├── thirdparties ├── common │ └── include │ │ └── AL │ │ ├── al.h │ │ ├── alc.h │ │ ├── alext.h │ │ ├── efx-creative.h │ │ ├── efx-presets.h │ │ └── efx.h └── win32 │ └── lib │ ├── OpenAL-patched │ ├── OpenAL32.dll │ └── readme.txt │ ├── OpenAL-unpatched │ └── OpenAL32.dll │ └── OpenAL32.lib └── website ├── assets ├── css │ ├── bootstrap-responsive.css │ ├── bootstrap.css │ └── docs.css ├── ico │ ├── apple-touch-icon-114-precomposed.png │ ├── apple-touch-icon-144-precomposed.png │ ├── apple-touch-icon-57-precomposed.png │ ├── apple-touch-icon-72-precomposed.png │ ├── favicon.ico │ └── favicon.png ├── img │ ├── bootstrap-docs-readme.png │ ├── bs-docs-bootstrap-features.png │ ├── bs-docs-masthead-pattern.png │ ├── bs-docs-responsive-illustrations.png │ ├── bs-docs-twitter-github.png │ ├── glyphicons-halflings-white.png │ ├── glyphicons-halflings.png │ ├── grid-baseline-20px.png │ ├── less-logo-large.png │ ├── responsive-illustrations.png │ ├── tp-logo.jpg │ └── webrtc-logo.png └── js │ ├── application.js │ ├── bootstrap-affix.js │ ├── bootstrap-alert.js │ ├── bootstrap-button.js │ ├── bootstrap-carousel.js │ ├── bootstrap-collapse.js │ ├── bootstrap-dropdown.js │ ├── bootstrap-modal.js │ ├── bootstrap-popover.js │ ├── bootstrap-scrollspy.js │ ├── bootstrap-tab.js │ ├── bootstrap-tooltip.js │ ├── bootstrap-transition.js │ ├── bootstrap-typeahead.js │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── google-code-prettify │ ├── prettify.css │ └── prettify.js │ ├── holder │ └── holder.js │ ├── html5shiv.js │ └── jquery.js ├── contact.htm ├── index.html ├── settings.htm └── sounds └── ringbacktone.wav /Configuration.md: -------------------------------------------------------------------------------- 1 | The Telepresence system is configured using **cfg** files. The main cfg file is named **telepresence.cfg** and should be on the same directory where the binary is installed unless you run the app with _"--config=PATH"_ argument. The source code contains a sample configuration file to use to get started. The sample configuration is installed after successfully building the system and running _"make samples"_. 2 | 3 | The configuration files are parsed using code generated with [Ragel tool](http://www.complang.org/ragel/). 4 | A configuration file contains comments, sections and entries: 5 | 6 | 7 | 8 | ## Comments ## 9 | A comment starts with **#** 10 | ``` 11 | # I’m a comment 12 | Age = 25 # I’m another comment 13 | ``` 14 | 15 | ## Sections ## 16 | A section name must be enclosed by square brackets. The section name is case insensitive. 17 | ``` 18 | # this is a bridge section 19 | [bridge] 20 | ``` 21 | 22 | ## Entries ## 23 | An entry is a key-value-pair and must be tied to a section. Both the key and the value are case insensitive. **The key must not start with a SPACE**. 24 | ``` 25 | [product] # I’m the section 26 | version = 1.2 # I’m an entry with floating number value 27 | name = telepresence # I’m an entry with a string value 28 | ``` -------------------------------------------------------------------------------- /Configuration_AVPF_tail_length.md: -------------------------------------------------------------------------------- 1 | **avpf-tail-length** configuration entry defines the maximum and minimum queue length used to store the outgoing RTP packets. The stored packets are used to honor incoming **RTCP-NACK** requests. See [here](Technical_Video_quality#AVPF_tail_length.md) for more technical information. 2 | ``` 3 | avpf-tail-length = 200;500 # min;max 4 | ``` 5 | _Configuration 8: Setting AVPF tail length_ -------------------------------------------------------------------------------- /Configuration_Audio.md: -------------------------------------------------------------------------------- 1 | This section explains how to use settings related to the audio. 2 | 3 | 4 | 5 | # Pivot settings # 6 | The notion of **pivot settings** is explained [here](Technical_Audio_mixer_design.md). 7 | ``` 8 | audio-channels = 1 9 | audio-bits-per-sample = 16 10 | audio-sample-rate = 8000 11 | audio-ptime = 20 12 | audio-volume = 1.0f 13 | audio-dim = 2d 14 | audio-max-latency = 200 15 | ``` 16 | _Configuration 11: Audio settings_ 17 | 18 | * **audio-channels** - number of audio channels to use. Supported values are 1 and 2. 19 | * **audio-bits-per-sample** - number of bits for each audio sample. Supported values are 8, 16 and 32. 20 | * **audio-sample-rate**: - audio sample rate. Almost any value is supported: http://en.wikipedia.org/wiki/Sampling_rate. Unit: Hz. 21 | * **audio-ptime** - number of milliseconds for each audio frame. The value should be multiple of 10. Supported values: [1 - 255] 22 | * **audio-volume** - attenuation (or gain) to apply to the mixed audio. Supported values: [0.0f - 1.0f]. 23 | * **audio-dim** - mixer dimensions. The value must be 2d (Linear) or 3d (Spatial). 3d requires building the system with [OpenAL Soft](Support_BuildingSourceCode#Building_OpenAL_Soft.md). 24 | * **audio-max-latecncy** - maximum audio delay (because of clock drift) before resetting the jitter buffer. The value could be any positive value. Unit: milliseconds. -------------------------------------------------------------------------------- /Configuration_Audio_Video_codecs.md: -------------------------------------------------------------------------------- 1 | **codecs** configuration entry defines the list of all supported codecs. Only **G.711** and **G.722** are natively supported and all other codecs have to be enabled when building the Doubango VoIP framework source code. 2 | Each codec priority is equal to its position in the list. First codecs have highest priority. 3 | Supported values are: 4 | * opus 5 | * pcma 6 | * pcmu 7 | * amr-nb-be 8 | * amr-nb-oa 9 | * speex-nb 10 | * speex-wb 11 | * speex-uwb 12 | * g729 13 | * gsm 14 | * g722 15 | * ilbc 16 | * h264-bp 17 | * h264-mp 18 | * vp8 19 | * h263 20 | * h263+ 21 | * theora 22 | * mp4v-es. 23 | 24 | ``` 25 | codecs = pcma;pcmu;vp8;h264-bp;h264-mp 26 | ``` 27 | _Configuration 9: Setting audio/video codecs_ -------------------------------------------------------------------------------- /Configuration_Bridge_configuration.md: -------------------------------------------------------------------------------- 1 | In this beta version, global configuration entries are ignored when reused with a [bridge] section. For example, setting the audio sample rate at global scoop applies to all bridges but redefining it for a [bridge](bridge.md) section will be ignored. In the release version, it will be possible to override almost any configuration entry. 2 | It’s not required to add a bridge in order to be able to make conference calls. 3 | You can add as many [bridge] sections as you want. 4 | 5 | Supported entries are: **id** and **pin-code**. 6 | ``` 7 | [bridge] 8 | id=10060 9 | pin-code=1234 10 | 11 | [bridge] 12 | id=10061 13 | pin-code=0000 14 | ``` 15 | _Configuration 17: Bride settings_ 16 | 17 | * **id** - defines the bridge identifier (a SIP client would call _"sip:@domain"_ to connect to this bridge). 18 | * **pin-code** – A 4-digit code used to protect the bridge. 19 | For information on how a client authenticates to a bridge, check [here](Technical_Protecting_a_bridge_with_password.md). -------------------------------------------------------------------------------- /Configuration_Debugging_the_system.md: -------------------------------------------------------------------------------- 1 | As a developer, the first action is to edit your configuration file to change the debug-level from **ERROR** to **INFO**. 2 | 3 | When you connect to the MCU you always have video stream back (you see yourself) but your audio stream is never sent back. For debugging purposes, it could be useful to ask your audio stream back. Hearing your own sound helps testing that everything work. Without loopback audio, you must connect at least two endpoints to test audio (encoding, decoding, streaming, resampling…). 4 | ``` 5 | debug-level = INFO 6 | debug-audio-loopback = yes 7 | ``` 8 | _Configuration 1: Useful debug settings_ 9 | 10 | **debug-level** - defines the minimum debug level to display. Supported values: INFO, WARN, ERROR and FATAL. 11 | 12 | **debug-level-loopack** - whether to enable audio loopback for testing (see above for more information). 13 | 14 | We require having your **debug-level** equal to **INFO** when reporting/sharing issues. -------------------------------------------------------------------------------- /Configuration_NAT_Firewall_traversal.md: -------------------------------------------------------------------------------- 1 | This section shows how to enable or disable symmetric RTP (technical details [here](Technical_NAT_and_firewall_traversal#Symmetric_RTP.md)), ICE (technical details [here](Technical_NAT_and_firewall_traversal#ICE.md)) and RTCP-MUX (technical details [here](Technical_NAT_and_firewall_traversal#RTCP-MUX.md)). 2 | ``` 3 | rtp-symmetric-enabled = yes # no to disable 4 | ice-enabled = yes # no to disable 5 | icestun-enabled = yes 6 | stun-server = stun.l.google.com;19302;stun-user;stun-password 7 | rtcp-mux-enabled = yes # no to disable 8 | ``` 9 | _Configuration 6: Enabling/disabling NAT traversal features_ 10 | 11 | * **rtp-symmetric-enabled** - whether to enable symmetric RTP ([RFC 4961](http://tools.ietf.org/html/rfc4961)) for NAT and firewall traversal 12 | * **ice-enabled** - whether to enable ICE ([RFC 5245](http://tools.ietf.org/html/rfc5245)) for NAT and firewall traversal. 13 | * **icestun-enabled** - whether to use STUN to gather reflexive addresses or not. This option is useful when the server is on a public network or all peers are on the same local network. In these cases, disabling STUN for ICE will speed up the call setup. Disabling icestun is also useful when the system is installed on a PC without access to internet. 14 | * **stun-server** - defines the STUN/TURN server to use to gather reflexive addresses for the ICE candidates. If no server is defined then, a default one will be used. The default STUN/TURN server is **numb.viagenie.ca:3478**. 15 | * Format: server-fqdn-value; server-port-value; user-name-value; user-password-value 16 | * server-fqdn-value: A valid IPv4/v6 address or host name. 17 | * server-port: A valid port number. 18 | * user-name-value: The login to use for TURN authentication. Use star (`*`) to ignore. 19 | * user-password-value: The password to use for TURN authentication. Use star (`*`) to ignore. 20 | * **rtcp-mux-enabled** - whether to enable RTC-MUX ([RFC 5761](http://tools.ietf.org/html/rfc5761)). -------------------------------------------------------------------------------- /Configuration_Presentation_sharing.md: -------------------------------------------------------------------------------- 1 | A presentation is any **PowerPoint** document and it could be shared from any SIP client running on any device. The presentation is uploaded to the TelePresence system using **HTTP(S) POST** request which means a http (or https) transport must be configured as explained [here](Configuration_SIP_network_transports.md). More technical details could be found [here](Technical_Presentation_sharing.md). 2 | ``` 3 | presentation-sharing-enabled = yes 4 | presentation-sharing-process-local-port = 2083 5 | presentation-sharing-base-folder = ./presentations 6 | presentation-sharing-app = soffice 7 | ``` 8 | _Configuration 11: Presentation sharing_ 9 | 10 | * **presentation-sharing-enabled** - whether to enable presentation sharing. Default is **yes**. The application must be built with [OpenOffice](Support_BuildingSourceCode#Building_openOffice.md) (recommended) or [LibreOffice](Support_BuildingSourceCode#Building_openOffice.md) SDK to support this feature. This feature will be silently disabled if both SDKs are missing. 11 | * **presentation-sharing-process-local-port** - some implementations requires a third-party application (e.g. OpenOffice or LibreOffice) to export the presentation. The third-party application will be forked to run in the background and the local port ([1024-65535]) is used to communicate with the TelePresence system. For example, if the third-party application is OpenOffice and the local port is equal to **2083** then: 12 | * command string would be: `soffice -norestore –headless -nofirststartwizard -invisible "-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager"` 13 | * and the connection string would be: `uno:socket,host=localhost,port=2083;urp;StarOffice.ServiceManager`. **soffice** is the OpenOffice application binary. Your **$PATH** environment variable must reference the folder containing the binary or **presentation-sharing-app** must contain a full path (e.g. _/opt/openoffice4/program/soffice_). 14 | * **presentation-sharing-base-folder** - base folder where to store uploaded presentations and temporary exported jpeg images. For example, a document named _mypres.ppt_ uploaded by _bob_ who is connected to a bridge with number equal to _100600_ would have a path equal to `/100600/bob/mypres.ppt`. 15 | * **presentation-sharing-app** - third-party application name. Could be full (e.g. _"/opt/openoffice4/program/soffice"_) or relative (e.g. _"soffice"_) path. Relative path requires having the folder containing the application in your **$PATH** environment variable. -------------------------------------------------------------------------------- /Configuration_RTP_buffer_size.md: -------------------------------------------------------------------------------- 1 | **rtp-buffersize** configuration entry is used to define the internal buffer size to use for RTP sockets. The higher this value is the lower will be the RTP packet loss. Please note that the maximum value depends on your system (e.g. 65535 on Windows). A very high value could introduce delay on video stream and it’s highly recommended to also [enable video jitter buffer option](Technical_Video_quality#Jitter_buffer.md). 2 | 3 | Code usage: 4 | ``` 5 | setsockopt(SOL_SOCKET, SO_RCVBUF, rtp-buffsize-value); 6 | setsockopt(SOL_SOCKET, SO_SNDBUF, rtp-buffsize-value); 7 | ``` 8 | Configuration: 9 | ``` 10 | rtp-buffersize = 65535 11 | ``` 12 | _Configuration 7: Setting RTP buffer size_ -------------------------------------------------------------------------------- /Configuration_Recording_conference_to_a_file.md: -------------------------------------------------------------------------------- 1 | The configuration file is used to specify whether to record the sessions, which container to use and where to store the output file. 2 | ``` 3 | record = yes 4 | record-file-ext = mp4 5 | ``` 6 | _Configuration 10: Recording conference to a file_ 7 | 8 | * **record** - whether to record the sessions. 9 | * **record-file-ext** - defines the container to use. Almost any container (avi, mp4, webm, mkv …) could be used but this depends on how you built FFmpeg. For more technical information, please check [here](Technical_Recording_conference_to_a_file.md). 10 | We highly recommend using [VLC](http://www.videolan.org/vlc/index.html) to play the output file. -------------------------------------------------------------------------------- /Configuration_SIP_network_transports.md: -------------------------------------------------------------------------------- 1 | The system supports many network transports for the SIP signaling protocol and content sharing. The network connections are declared using **transport** configuration entries. 2 | ``` 3 | transport = udp;*;20060;* 4 | transport = ws;*;20060;4 5 | transport = wss;*;20062;* 6 | transport = tcp;*;20063 7 | transport = tls;*;20064;* 8 | transport = http;*;20065 9 | transport = https;*;20066 10 | 11 | ``` 12 | _Configuration 2: Signaling (SIP) transports_ 13 | 14 | **Format**: protocol-value;ip-address-value;port-value;ip-version-value. 15 | 16 | * protocol-value must be **udp** , **tcp** , **tls** , **ws**, **wss**, **http** or **https**. **ws** protocol defines WebSocket and **wss** the secure version (requires OpenSSL). At least one WebSocket transport must be added to allow a web browser (WebRTC SIP client) to connect to the system. The other protocols (tcp, tls and udp) are used for SIP-legacy devices or PSTN. 17 | * local-ip-value is any valid IPv4/IPv6 address or FQDN. Use star (`*`) to let the system choose the best local IP address to bind to. Examples: udp;`*`;5060 or ws;`*`;5061 or wss;192.168.0.10;5062 18 | * local-port-value is any unused local port to bind to. Use star (`*`) to let the system choose the best unused port to bind to. Examples: udp;`*`;`*` or ws;`*`;`*` or wss;`*`;5062 19 | * ip-version-value defines the IP version to use. Must be **4**, **6** or *. Star (`*`) is used to let the system choose the best one. Using star (`*`) only make sense if local-ip-value is a FQDN instead of IP address. 20 | A transport configuration entry must have at least a protocol, IP address (or star) and port (or star). The IP version is optional.
21 | **udp** , **tcp** , **tls** , **ws** and **wss** protocols are used to transport SIP messages while **http** and **https** are used to upload presentations. -------------------------------------------------------------------------------- /Configuration_SIP_registration.md: -------------------------------------------------------------------------------- 1 | Many SIP clients require to be registered (logged in) before being able to make calls. By default, any **REGISTER** request to the gateway will be rejected. 2 | 3 | **accept-sip-reg** entry defines whether to accept incoming SIP REGISTER requests or not (acting as SIP registrar). 4 | ``` 5 | accept-sip-reg = yes # no to disable 6 | ``` 7 | _Configuration 5: Enabling/disabling SIP registration_ 8 | 9 | When the Telepresence system is behind a SIP registrar (e.g. **Asterisk**) then, this configuration entry is useless as the REGISTER requests will not be forwarded to the MCU. 10 | 11 | See also: 12 | * [SA versus AS modes](Technical_SA_versus_AS_modes.md) -------------------------------------------------------------------------------- /Configuration_Security.md: -------------------------------------------------------------------------------- 1 | The configuration file allows setting the SSL certificate files to be used for TLS and WSS signaling protocols. The certificates are also used for DTLS-SRTP. The Doubango framework must be built with [OpenSSL](https://code.google.com/p/telepresence/wiki/Support_BuildingSourceCode#Building_OpenSSL) enabled as explained [here](Support_BuildingSourceCode#Building_OpenSSL.md). 2 | ``` 3 | ssl-private-key = /tmp/ssl.pem 4 | ssl-public-key = /tmp/ssl.pem 5 | ssl-ca = /tmp/ssl.pem 6 | ssl-mutual-auth = no 7 | ``` 8 | _Configuration 3: Setting SSL certificates_ 9 | 10 | * **ssl-private-key** - the full path to the PEM file. 11 | * **ssl-public-key** - the full path to the PEM file. 12 | * **ssl-ca** - the full path to the PEM file. 13 | * **ssl-mutual-auth** - whether the incoming connection requests must fail if the remote peer certificates are missing or do not match the local ones. This only applies to **TLS** or **WSS** and is useless for **DTLS-SRTP** as certificates are always required. 14 | 15 | The configuration file also allows setting the _SRTP_ type. 16 | ``` 17 | srtp-mode = optional 18 | srtp-type = sdes;dtls 19 | ``` 20 | _Configuration 4: SRTP settings_ 21 | 22 | **srtp-mode** – defines the SRTP mode to use for negotiation. Supported values are none, optional and mandatory. Only optional and mandatory modes will work if the SIP client is a WebRTC browser as SRTP is required. 23 | Based on the mode, the SDP on the outgoing INVITEs will be formed like this: 24 | * none: 25 | * profile will be equal to _RTP/AVP_ 26 | * no crypto lines or certificate fingerprints will be added 27 | * optional: 28 | * profile will be equal to _RTP/AVP_ 29 | * two crypto lines will be added if **srtp-type** includes sdes, plus certificate fingerprints if **srtp-type** also includes ‘dts’. 30 | * mandatory: 31 | * profile will be equal to _RTP/SAVP_ if **srtp-type** is equal to SDES or _UDP/TLS/RTP/SAVP_ if **srtp-type** is equal to dtls 32 | * two crypto lines will be added if **srtp-type** is equal to sdes or certificate fingerprints if **srtp-type** is equal to dtls 33 | 34 | **srtp-type** - defines the list of all supported SRTP types. Defining multiple values only make sense if the srtp-mode value is equal to optional which means we want to negotiate the best one. Supported values are sdes and dtls. 35 | 36 | _DTLS-SRTP_ requires valid SSL certificates and Doubango source code must be compiled with [OpenSSL](https://code.google.com/p/telepresence/wiki/Support_BuildingSourceCode#Building_OpenSSL) version 1.0.1 or later. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Source code freely provided to you by Doubango Telecom ®. This is a good and viable **open source** alternative to Google Hangouts. 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
DemonstrationPresentation sharing
15 | 16 | ## Main features ## 17 | This is a short but not exhaustive list of supported features on this beta version: 18 | 19 | * Powerful [MCU (Multipoint Control Unit)](http://en.wikipedia.org/wiki/Multipoint_control_unit) for audio and video mixing 20 | * **Stereoscopic** (spatial) 3D and stereophonic audio 21 | * Full (**1080p**) and Ultra (**2160p**) HD video up to **120fps** 22 | * Conference **recording** to a file (containers: **.mp4**, **.avi**, **.mkv** or **.webm**) 23 | * Revolutionary way to **share presentations**: documents are "streamed" in the video channel to allow any SIP client running on any device to participate 24 | * Smart adaptive audio and video bandwidth management 25 | * Congestion control mechanism 26 | * SIP registrar 27 | * 4 SIP transports (**WebSocket**, **TCP**, **TLS** and **UDP**) 28 | * SA (direct connection to SIP clients) and AS (behind a server, such as [Asterisk](http://www.asterisk.org/), [reSIProcate](http://www.resiprocate.org/Main_Page), [openSIPS](http://www.opensips.org/), [Kamailio](http://www.kamailio.org/w/)…) modes 29 | * Support for any [WebRTC](http://www.webrtc.org/)-capable browser ([WebRTC demo client](https://www.doubango.org/conf-call/) at [https://www.doubango.org/conf-call/](https://www.doubango.org/conf-call/)) 30 | * Mixing different audio and video codecs on a single bridge (**h264**, **vp8**, h263, mp4v-es, theora, **opus**, **g711**, speex, **g722**, gsm, **g729**, amr, ilbc) 31 | * **Protecting** a bridge with PIN code 32 | * **Unlimited** number of bridges and participants 33 | * Connecting **any SIP client** (Mobiles, Tablets, Desktops, Set-top-boxes, Smart TVs...) 34 | * Easy interconnection with **PSTN** 35 | * **NAT traversal** (Symmetric RTP, RTCP-MUX, ICE, STUN and TURN) 36 | * **RTCP Feedbacks** (NACK, PLI, FIR, TMMBN, REMB…) for better video experience 37 | * Secure signalling (WSS, TLS) and media (SDES-SRTP and DTLS-SRTP) 38 | * Continuous presence 39 | * Smart algorithm to detect speakers and listeners 40 | * Different video patterns/layouts 41 | * Multiple operating systems (**Linux**, **OS X**, **Windows** …) 42 | * 100% open source and free (no locked features) 43 | * [Full documentation](https://www.doubango.org/conf-call/technical-guide.pdf) 44 | * …and many others 45 | 46 | This short list is a good starting point to help you to understand what you could expect from our Telepresence system. 47 | 48 | ## Getting started ## 49 | 1. Read the [technical guide](https://www.doubango.org/conf-call/technical-guide.pdf?svn=2) for more information on how to [build](Support_BuildingSourceCode.md), [install](Support_BuildingSourceCode#Installing_the_configuration_and_fonts_files.md) and run the system 50 | 1. Test the system as explained [here](Support_Testing_the_system.md) 51 | 1. Share issues and technical questions on our [developer group](https://groups.google.com/group/opentelepresence) 52 | 1. Find our roadmap [here](Support_Roadmap.md) 53 | 54 | Even if any SIP client could be used we highly recommend for this beta version to use our [WebRTC demo client](https://www.doubango.org/conf-call) to ease debugging. 55 | 56 | ## Technical help ## 57 | Please check our [issue tracker](https://github.com/DoubangoTelecom/telepresence/issues) or [developer group](https://groups.google.com/group/opentelepresence) if you have any problem.
58 | We highly recommend reading our [Technical guide](https://www.doubango.org/conf-call/technical-guide.pdf?svn=2).
59 | Please check the list of [known issues](Support_Known_issues.md) before reporting. 60 | -------------------------------------------------------------------------------- /SSL_CA.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/SSL_CA.der -------------------------------------------------------------------------------- /SSL_CA.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEITCCAwmgAwIBAgIJAPItJ/nUv/rKMA0GCSqGSIb3DQEBBQUAMIGmMQswCQYD 3 | VQQGEwJGUjEWMBQGA1UECAwNSWxlLWRlLUZyYW5jZTEOMAwGA1UEBwwFUGFyaXMx 4 | HjAcBgNVBAoMFURvdWJhbmdvIFRlbGVjb20gRVVSTDENMAsGA1UECwwEVm9JUDEe 5 | MBwGA1UEAwwVRG91YmFuZ28gVGVsZWNvbSBFVVJMMSAwHgYJKoZIhvcNAQkBFhFp 6 | bmZvQGRvdWJhbmdvLm9yZzAeFw0xNTAzMDQwMTUwNDNaFw0yNTAzMDEwMTUwNDNa 7 | MIGmMQswCQYDVQQGEwJGUjEWMBQGA1UECAwNSWxlLWRlLUZyYW5jZTEOMAwGA1UE 8 | BwwFUGFyaXMxHjAcBgNVBAoMFURvdWJhbmdvIFRlbGVjb20gRVVSTDENMAsGA1UE 9 | CwwEVm9JUDEeMBwGA1UEAwwVRG91YmFuZ28gVGVsZWNvbSBFVVJMMSAwHgYJKoZI 10 | hvcNAQkBFhFpbmZvQGRvdWJhbmdvLm9yZzCCASIwDQYJKoZIhvcNAQEBBQADggEP 11 | ADCCAQoCggEBAKzwFx7dj50Zcyruel9wgLhVbNIDV7jmnYglUbydSjZ9TPOfM8Zp 12 | 7bT2rrIl6DK4tnnjdB9OOCRpSm8tOfPsUGSG3ivkheNU2P2lrdn7MM6L9kFiiyZQ 13 | n3ROlvoeyIA4MkoYDOwE26CmXqNQY8f/4eaKwRtaWdT1Iddv+vFAqWycoL0MD9vA 14 | PO7K2TKyVvzSIiGMCMCj2WHhW58871kwl517fMIB//8vqa8MqXRGzLJ/uHm7xHbJ 15 | NPJAac6JIjOZEI7GdLgPnNldE92VnralWokIc9GhZEkOxIIez4lf4XE2aYiGiVAi 16 | NAjrw0QMif+eV89z5B/k66RkjlkzCPPpxOMCAwEAAaNQME4wHQYDVR0OBBYEFHyh 17 | mn70KRaiZfDVFIP00JcDBZ9xMB8GA1UdIwQYMBaAFHyhmn70KRaiZfDVFIP00JcD 18 | BZ9xMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAFjL3MRC/UIT6PfV 19 | 49DxZi06yyJMdcV+Q4eq63PScUIKO+MH2QvTd4Pxs6ZKPPfDVNZ5Wu8B/EvydIp6 20 | ohMKtEXbi6zJOVi11BZy8+DJYSLoHU45ZpmQM6tmbRWu9x4h87uuB3j9dQdewpk3 21 | z38t/CotfkOz/xW+bAnK0xcq+9ejt/RJK/HTj03W7TfE+Vg4DoXC/QDOFyda8c15 22 | 9kkXqnil7QlBo4Eh0dFlDuYTEHVJNTaBoYZXS38MlthPuvWnR8BSMmGpejIvT2R9 23 | cTDjQYenY2FSgRZQwhlFIVLSQh/2MSJmyDm+N2puUJvExTx0QYDzkGXMxZ5t5GWT 24 | PR+M1Yk= 25 | -----END CERTIFICATE----- 26 | -------------------------------------------------------------------------------- /SSL_Priv.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIICXQIBAAKBgQDoamwwk2XO7zmBoot4SQ8Gq6wP504lolg3hITfW7Q2Eu+NpDLe 3 | ItM+NsnbbMn89Zbul1MYD+UIMBa+w5R7bBnFPD7bGqfsLAs5czxLranIEg0ri9L1 4 | gBHWKRCSSSWjXBvESB6jE1k28DV4/j7+q7Ka9W8bNDI1/eRVAs3m7v1WYwIDAQAB 5 | AoGAEa2upw8/KjtmG2c6xp6ABxjd0KPefNxZa3eoB7lY/tf34sU/nUf223+dYRRo 6 | VNZ1cZaPGoBzAmluAXqs+6pgV0w5RYBR9pbTahD+VwM1PTOjawl68Hc45y3h3PTz 7 | qYMWeLM34JTgndzOjgUF7FymEP2Ecu26FGzw7On4XU06X/ECQQD8rvu9gY53Bs0X 8 | qBOS0VDqc5qShYINxq+oi6+Jk7HTgL573eFxVeMzflHs0XJrc4d9kYv6k154rdE0 9 | BTuZfSeZAkEA63dW4r/RDyS7At6hgbHgpGjmOg+sv9G6kRqxnKs8upLravVuJM02 10 | mQDAe/2Tg4ywyX7xQD6l3CMpbhHi3mA7WwJAAq38X3MbRqnczO5sXrc3i3T0Y69k 11 | xK6huEDa+LOHRD3uRzQAKwqFIUuqpL9H3lnYSv2bJWogq1j0if+wNR19qQJBANBW 12 | HPgvg8gEVbsqRHg+bGbLsbh5mf12kb5FghT+pZLm34kZcsT5FW+27JhIOrbQSrNd 13 | sBOJ2rK2IbgT90mOl7UCQQC3UsS2SJt6cFLBWvjS5Q8ZEcGX/Jpe/pgKqtSHWSGR 14 | t3X69kDEe9lpounth65WSq6t76GwCRRWNnuQcCbwwv39 15 | -----END RSA PRIVATE KEY----- 16 | -------------------------------------------------------------------------------- /SSL_Pub.der: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/SSL_Pub.der -------------------------------------------------------------------------------- /SSL_Pub.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDPjCCAiYCAQEwDQYJKoZIhvcNAQEFBQAwgaYxCzAJBgNVBAYTAkZSMRYwFAYD 3 | VQQIDA1JbGUtZGUtRnJhbmNlMQ4wDAYDVQQHDAVQYXJpczEeMBwGA1UECgwVRG91 4 | YmFuZ28gVGVsZWNvbSBFVVJMMQ0wCwYDVQQLDARWb0lQMR4wHAYDVQQDDBVEb3Vi 5 | YW5nbyBUZWxlY29tIEVVUkwxIDAeBgkqhkiG9w0BCQEWEWluZm9AZG91YmFuZ28u 6 | b3JnMB4XDTE1MDMwNDAxNTUxMloXDTI1MDMwMTAxNTUxMlowgaYxCzAJBgNVBAYT 7 | AkZSMRYwFAYDVQQIDA1JbGUtZGUtRnJhbmNlMQ4wDAYDVQQHDAVQYXJpczEWMBQG 8 | A1UECgwNRG91YmFuZ28gVGVzdDEdMBsGA1UECwwURG91YmFuZ28gVGVzdCAoVm9J 9 | UCkxFjAUBgNVBAMMDURvdWJhbmdvIFRlc3QxIDAeBgkqhkiG9w0BCQEWEWluZm9A 10 | ZG91YmFuZ28ub3JnMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDoamwwk2XO 11 | 7zmBoot4SQ8Gq6wP504lolg3hITfW7Q2Eu+NpDLeItM+NsnbbMn89Zbul1MYD+UI 12 | MBa+w5R7bBnFPD7bGqfsLAs5czxLranIEg0ri9L1gBHWKRCSSSWjXBvESB6jE1k2 13 | 8DV4/j7+q7Ka9W8bNDI1/eRVAs3m7v1WYwIDAQABMA0GCSqGSIb3DQEBBQUAA4IB 14 | AQCK2ovrf0MVFnhXw+EZHFuBrBjguLGxitlnTqDswSmJnnoVhllI6TWSTANX9Yhe 15 | dxx0Z7mlYTxZ6dFW9JLvISHG/9uJghQQLGEzM1ZVb5sK8HKKoQFRW7plY8IUQqtk 16 | Zzh/OZ/nOnUR8mSi2ms9CcQZHskXCppgPgpSlUV+TJpH5MqxF8iwFzgDd1N1Buxc 17 | YDWhkiGi3vwx/7rv1yCwxcvxENcecQVfaCJNMOLzUP4wI6tHhrwj8+A5yTKZ6vRM 18 | TFu7QIdd61GRnAhleNpc7Tc1K0XjdbB6o5BneM6KGb2Aa59btb1HaBS5z2HC6ZgC 19 | GW8ZYgRxU9o+YONxhaK6mlcn 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /Support_FAQ.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## How to report issue? ## 4 | We receive tens of messages on our dev-groups and private mailboxes every day. Without a commercial license, we only provide a best-effort support on [opentelepresence group](http://groups.google.com/group/opentelepresence).
**We're happy to help you to fix your issues** but we'll not spend hours on them to understand what's wrong. If you want help, you **must**: 5 | * Provide clear technical description of the issue. 6 | * Change you _telepresence.cfg_ to use INFO debug level. See [here](Configuration_Debugging_the_system.md) for more information. 7 | * Attach the **full** logs to the message. 8 | * Provide information about the SVN revisions (both Doubango and TelePresence). 9 | If the report is about building issues: 10 | * Attach config.log files for both Doubango and TelePresence 11 | If the report is about video issues: 12 | * Attach results from http://www.speedtest.net/ 13 | you _should_ also: 14 | * Provide the network (Wireshark) capture at the server-side 15 | * Provide the client logs. 16 | 17 | ## How to create self-signed SSL certificates? ## 18 | We'd recommend reading [this thread](https://groups.google.com/forum/#!topic/doubango/asAfP5ZCgdI). 19 | 20 | ## I see "error while loading shared libraries: XXX.so.y: cannot open shared object file: No such file or directory" when I run the server. How can I fix this? ## 21 | When a program is started the loader search for all dependencies (shared libraries) in a predefined list of folders. You're getting this error because the folder containing _XXX.so.y_ is not in the list. To fix the issue, run: 22 | ``` 23 | # /!\IMPORTANT: change 24 | echo "" >> /etc/ld.so.conf.d/telepresence.conf 25 | ldconfig 26 | ``` 27 | To find __: 28 | ``` 29 | find / -name 'XXX.so.y' 30 | ``` 31 | 32 | 33 | ## I see "Remote party requesting DTLS-DTLS (UDP/TLS/RTP/SAVPF) but this option is not enabled". How can I fix this ## 34 | DTLS-SRTP is required by some WebRTC implementations (e.g. Firefox). You MUST: 35 | 1. use a new OpenSSL version with support for DTLS-SRTP as explained [here](Support_BuildingSourceCode#Building_OpenSSL.md). Linux almost always comes with OpenSSL pre-installed which means building and installing OpenSSL by yourself will most likely duplicate it. 36 | 1. make sure you don't have more than one OpenSSL version installed (look for libssl). 37 | 1. rebuild TelePresence and make sure the "CONGRATULATIONS" message says that you have DTLS-SRTP enabled. 38 | 1. make sure you're using SSL certificates in your configuration (see [here](Configuration_Security.md) for more information). DTLS-SRTP requires at least a valid Public Key (could be self signed). -------------------------------------------------------------------------------- /Support_Known_issues.md: -------------------------------------------------------------------------------- 1 | This is a short list with all **known issues** (to be fixed before the end of the beta phase). 2 | 1. The audio quality on the recorded files is not as good as we expect. This looks like an issue on the PTS and DTS. 3 | 1. Sometimes, the recorded file cannot be played. **Fixed in [r118](https://code.google.com/p/telepresence/source/detail?r=118)**. 4 | 1. Mixed video looks stretched when the SIP clients is a mobile in portrait (e.g. iDoubs and IMSDroid). No issue when device is in landscape or using our WebRTC demo client. **Fixed in [r118](https://code.google.com/p/telepresence/source/detail?r=118)**. 5 | 1. The algorithm to detect the current speaker and listeners is buggy. 6 | 1. 3D (spatial) mixed audio quality is not as good as we expect. 7 | 1. Mixer fails to negotiate H.263. **Fixed in [r118](https://code.google.com/p/telepresence/source/detail?r=118)**. 8 | 1. "error while loading shared libraries: libtinySAK.so.0: cannot open shared object file: No such file or directory". You can find a temporary workaround at https://groups.google.com/forum/#!topic/opentelepresence/qR7OdJGAcAE. **Fixed in [r118](https://code.google.com/p/telepresence/source/detail?r=118)**. -------------------------------------------------------------------------------- /Support_Roadmap.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # Roadmap # 4 | 1. Fix [known issues](Support_Known_issues.md) 5 | 1. Adds support for more video layouts/patterns (Only Hangout-like pattern is supported for now) 6 | 1. Adds support for live slides sharing (or any other format). **Fixed in [r118](https://code.google.com/p/telepresence/source/detail?r=118)**. 7 | 1. Adds support for desktop sharing 8 | 1. Adds support for whiteboard 9 | 1. Allows setting bridge manager 10 | 1. Adds support for keepAlive (SIP OPTIONS) 11 | 1. Allows interconnection with Skype, Lync, Cisco.... 12 | 1. JSON API to get information on the call (participants, statues, positions, volume level...) and manage the bridge (invite user, mute participant, kick off...). **Started in [r118](https://code.google.com/p/telepresence/source/detail?r=118). Check [here](Technical_Call_session_management.md)**. 13 | 1. Add a beep sound when new participant join 14 | 1. Add support for file broadcasting (e.g. .mp4 or .webm). -------------------------------------------------------------------------------- /Support_Testing_the_system.md: -------------------------------------------------------------------------------- 1 | This section explains how to test the Telepresence system. 2 | 3 | As already explained on this document, any SIP client can be used to connect to the Telepresence system but we highly recommend using our WebRTC client. The WebRTC client is hosted at [http://conf-call.org/](http://conf-call.org/). 4 | 5 | Few steps to get started (we assume you have successfully built and installed the system): 6 | 1. Build, install and run the system as explained [here](Support_BuildingSourceCode.md). 7 | 1. Change (in your configuration file) the _debug level_ value to _INFO_ as explained [here](Configuration_Debugging_the_system.md) (not required). 8 | 1. The default configuration already has a WebSocket transport listening on port 20060 but the IP address is automatically retrieve at the startup (because of the star (`*`) in the transport configuration entry). To bind to a specific IP address, change your settings as explained [here](Configuration_SIP_network_transports.md). 9 | 1. Starts the system and check the console logs to be sure that all is ok. The logs also show which IP addresses and port are used for each protocol (WS, WSS, TCP, TLS and UDP). 10 | 1. Go to [http://conf-call.org/settings.htm](http://conf-call.org/settings.htm) and enter your Private Identity and the WebSocket connection URL. The Private Identity is a SIP authentication name (**without special characters or SPACEs**). The connection URL must be the same the transport entry defined in the configuration file (the star (`*`) after the protocol name -scheme- must be replaced with a valid IP address or host name). Save your settings. 11 | 1. Go back to the home page, enter a bridge identifier (any number would work) and press **"join"** button. If a bridge with this identifier doesn’t exist then, it will be created automatically. Any person calling the same identifier will be part of the conference. No pin code is required unless one is defined in the configuration file. 12 | 13 | * To report issues: [https://groups.google.com/group/opentelepresence](https://groups.google.com/group/opentelepresence). 14 | * For issues related to bandwidth, please attach results from [http://www.speedtest.net/](http://www.speedtest.net/). -------------------------------------------------------------------------------- /Support_Tips.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## 1. Lowering CPU ## 4 | ### 1.1 Avoid audio resampling ### 5 | To avoid audio resampling, the SIP clients connecting to a bridge have to use a codec with the sample rate, channels and bits per sample as the ["pivot settings"](Technical_Audio_mixer_design.md). For more information, check [here](Technical_Audio_mixer_design.md).
6 | tip: In you configuration file, enable codecs with same settings as the pivot. 7 | 8 | ### 1.2 Only record sessions if needed ### 9 | Do not enable recording if it’s not important to you or use `*`.avi container which consume less CPU than `*`.mp4 (because of AAC encoder from [libfaac](Support_BuildingSourceCode#Building_libfaac.md)). 10 | 11 | ### 1.3 Use common video codec ### 12 | All SIP clients with the same video codec will share a single encoder. Try to use common video codec for all clients. For example, if you have two clients, A and B, with A supporting both H.264 and VP8 and B only H.264 then, you should make sure that A will offer H.264 with highest priority. For more information, check [here](Technical_Video_mixer_design#Encoders_and_decoders.md).
13 | tip: In your configuration file, enable a single video codec if you cannot control the SIP clients. 14 | 15 | ### 1.4 Use 2d audio mixing ### 16 | Enable 2D audio mixing instead of 3D. 17 | 18 | ### 1.5 Lower mixed video size and fps ### 19 | If you have a weak CPU then, consider using a reasonable video size (e.g. VGA) and fps ([- 30](15.md)). 20 | 21 | ### 1.5 Multi-threading and ASM ### 22 | Make sure to enable [YASM](Support_BuildingSourceCode#Building_YASM.md) and pthread when building [FFmpeg](Support_BuildingSourceCode#Building_FFmpeg.md), [x264](Support_BuildingSourceCode#Building_x264.md) and [VP8](Support_BuildingSourceCode#Building_libvpx.md). 23 | 24 | ## 2. Lowering bandwidth ## 25 | * Use "slow" motion rank (see [here](Configuration_Video#Bandwidth_and_congestion_control.md)) 26 | * Use small mixed video size (see [here](Configuration_Video#Output_mixed_size.md)) 27 | * Set the maximum upload and download bandwidth (see [here](Configuration_Video#Bandwidth_and_congestion_control.md)) 28 | * Use small video frame rate (see [here](Configuration_Video#Bandwidth_and_congestion_control.md)) 29 | 30 | tip: To test your available bandwidth, we recommend http://www.speedtest.net/.
31 | tip: To check bandwidth usage, we recommend iftop. 32 | 33 | ## 3. Improving audio quality ## 34 | * Use [Opus](Support_BuildingSourceCode#Building_libopus.md) (or G.722) audio codec if supported by the SIP clients (see [here](Configuration_Audio_Video_codecs.md)). 35 | * Avoid audio up-sampling and down-sampling (see [here](Technical_Audio_mixer_design.md)). 36 | * If the ["pivot settings"](Technical_Audio_mixer_design.md) use a sample rate (SR) equal to S then, try to use codecs with a SR equal to "S << n" or "S >> n". 37 | 38 | ## 4. Improving video quality ## 39 | * Use Google Chrome as SIP client (check our WebRTC demo client at [http://conf-call.org/](http://conf-call.org/)). 40 | * Enable "Zero-Artifacts" feature (see [here](Technical_Video_quality#Zero-artifacts.md) and [here](Configuration_Video#Zero-artifacts.md)) 41 | * Use a client supporting something close to 16/9 video size to avoid stretching issues 42 | * Avoid video up-sampling and down-sampling 43 | 44 | ## 5. Lowering recorded video file size ## 45 | 46 | _--This section intentionally left blank--_ -------------------------------------------------------------------------------- /Technical_Audio_mixer_design.md: -------------------------------------------------------------------------------- 1 | The audio mixer is part of the [MCU](http://en.wikipedia.org/wiki/Multipoint_control_unit) engine. 2 | 3 | The audio mixer supports mixing several streams with different settings (rate, channels, bits per sample or ptime). For example, a bridge can host a conference with two endpoints, one using g711 (8khz, mono, 20ms) and the other using opus (48khz, stereo, 30ms). As you may expect, it’s not technically possible to mix two streams with different settings without resampling. 4 | 5 | In the audio mixer there is a notion of "pivot settings". "pivot settings" is the audio parameters to which any stream is resampled to, before mixing. The pivot settings are defined using the configuration file as explained [here](Configuration_Audio#Pivot_settings.md). 6 | 7 | The Doubango framework use [libspeexdsp](https://code.google.com/p/telepresence/wiki/Support_BuildingSourceCode#Building_libspeex_and_libspeexdsp) for the resampling while the [MCU](http://en.wikipedia.org/wiki/Multipoint_control_unit) uses libswresample (from FFmpeg). Both libraries are required. 8 | It’s very important to understand the notion of "pivot settings" because using wrong values could lead to poor audio quality and high CPU usage. 9 | 10 | 11 | ![https://telepresence.googlecode.com/svn/trunk/images/audio_mixer_resampler.png](https://telepresence.googlecode.com/svn/trunk/images/audio_mixer_resampler.png)
12 | Figure 1: Audio resampling 13 | 14 | From the above figure, you can easily see that the incoming audio samples from an endpoint to the MCU could be resampled up to two times if your pivot and negotiated codec settings mismatch. To minimize the number of audio resampling processes your codec settings have to be as close as possible to those used as pivot. If the settings (pivot, codecs) match, then no resampling will be done. 15 | 16 | In this beta version, we support 2d and 3d mixing types. The type of mixing is defined using the configuration file as explained [here](Configuration_Audio#Pivot_settings.md). 17 | 18 | The 2d mixing is linear (monophonic or stereophonic) and very basic. No additional thirdparties library is required for this. 19 | 20 | The 3d mixing is stereoscopic (spatial) and requires [OpenAL Soft](https://code.google.com/p/telepresence/wiki/Support_BuildingSourceCode#Building_OpenAL_Soft). -------------------------------------------------------------------------------- /Technical_Bandwidth_management_and_congestion_control.md: -------------------------------------------------------------------------------- 1 | In this current beta version we only focus on video bandwidth. 2 | 3 | The upload and download video bandwidth settings have to be defined using the configuration file as explained [here](Configuration_Video#Bandwidth_and_congestion_control.md). The maximum download bandwidth is signaled to the remote endpoints using the SDP (b=AS:X attribute as per RFC [3556](http://tools.ietf.org/html/rfc3556)) and **RTCP-REMB** packets (as per [draft-alvestrand-rmcat-remb-02](http://tools.ietf.org/html/draft-alvestrand-rmcat-remb-02)). In this beta version, **RTCP-TMMBN** ([RFC 5104](http://tools.ietf.org/html/rfc5104)) packets are deserialized but not processed by the system. 4 | 5 | The congestion control manager could be enabled using the configuration file as explained [here](Configuration_Video#Bandwidth_and_congestion_control.md). In this beta version, [draft-alvestrand-rtcweb-congestion-03](http://tools.ietf.org/html/draft-alvestrand-rtcweb-congestion-03) is not fully implemented yet and we’re using our own algorithms to compute the bandwidth usage. The computed maximum bandwidth (periodically) when the congestion control is enabled will never be higher than the maximum allowed values defined in your configuration file (this is kind of safe guard). -------------------------------------------------------------------------------- /Technical_Call_session_management.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | A call session is managed using **SIP INFO** messages with **JSON** content. For now only muting/unmuting the session is supported. Next versions will add support for ejecting a participant, getting the list of participants, getting the call state (packet loss, RTT, audio/video quality, etc etc
4 | ## Muting/unmuting ## 5 | The MCU could detect that a session is muted based on the RTP packets but it’s highly recommended to also send a **SIP INFO** message for confirmation. For audio-only sessions, muting a session without sending a **SIP INFO** could be interpreted as a crash or network issue which automatically disconnects the call.
6 | When the _“hangout”_ video pattern is selected the MCU renders the speaker's video with the highest quality and size. Detecting a speaker could be problematic when the participants are in a noisy environment. Manually muting/unmuting your session is a way to avoid such issues.
7 | JSON content: 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 |
Field nameField valueTypeAvailability
action“req_call_mute”StringMandatory
enabled< user defined >BooleanMandatory
28 | 29 | ## Ejecting a participant ## 30 | _--This section intentionally left blank--_ 31 | 32 | ## Getting the list of participants ## 33 | _--This section intentionally left blank--_ 34 | 35 | ## Getting the call state ## 36 | _--This section intentionally left blank--_ -------------------------------------------------------------------------------- /Technical_NAT_and_firewall_traversal.md: -------------------------------------------------------------------------------- 1 | This section explains how to tackle NAT and firewall traversal issues. 2 | 3 | 4 | 5 | # Symmetric RTP # 6 | This feature is enabled or disabled as explained [here](Configuration_NAT_Firewall_traversal.md). 7 | 8 | The Telepresence system fully supports [RFC 4961](http://tools.ietf.org/html/rfc4961). 9 | 10 | An RTP/RTCP stream is symmetric if the same port is used to send and receive packets. This helps for NAT and firewall traversal as the outgoing packets open a pinhole for the ongoing ones. 11 | 12 | The local/outgoing stream (MCU → endpoints) is always symmetric. 13 | 14 | If both parties (remote and local) have successfully negotiated ICE candidates then, none will be forced to use symmetric RTP/RTCP. 15 | 16 | Let’s imagine your Telepresence instance is on a public network and the SIP client/endpoint on private network: 17 | 1. Telepresence: Public IP address is **1.1.1.1** 18 | 1. Client: Private IP address is **2.2.2.2** and public IP address is 1.1.1.2 19 | 1. The SDP from the client to the Telepresence system will contain client’s private IP address (**2.2.2.2**) which is not reachable 20 | 1. The RTP/RTCP packets from the client to the server will be received with source IP address equal to the client’s public IP address (**1.1.1.2**) 21 | 1. If [rtp-symetric-enabled](Configuration_NAT_Firewall_traversal.md) option is used then, the Telepresence system will send RTP/RTCP packets to **1.1.1.2** (learnt from the received packets) instead of **2.2.2.2** which is private and unreachable. 22 | 23 | # ICE # 24 | This feature is enabled or disabled as explained [here](Configuration_NAT_Firewall_traversal.md). 25 | 26 | The Telepresence system fully supports [RFC 5245](http://tools.ietf.org/html/rfc5245). 27 | 28 | ICE is negotiated only if this feature is enabled and incoming SDP (SIP endpoint → MCU) contains candidates. 29 | 30 | **ICE is mandatory for WebRTC endpoints**. 31 | 32 | # RTCP-MUX # 33 | This feature is enabled or disabled as explained [here](Configuration_NAT_Firewall_traversal.md). 34 | 35 | The Telepresence system fully supports [RFC 5761](http://tools.ietf.org/html/rfc5761). 36 | 37 | RTCP-MUX is used to minimize the number of ports and help for NAT traversal and administration. -------------------------------------------------------------------------------- /Technical_Protecting_a_bridge_with_password.md: -------------------------------------------------------------------------------- 1 | This feature is configured as explained [here](Configuration_Bridge_configuration.md). 2 | 3 | There are two ways for a SIP client to authenticate to a protected bridge: DTMF or **TP-BridgePin** SIP header. If authentication fails, a SIP 403 response will be returned with a short description. 4 | 5 | The **DTMF** method doesn’t require changing your SIP client but is not supported yet in this beta version (on the roadmap for the release version). The second method (using the SIP header) requires some modifications on you SIP client to include this new header. If you are using our [WebRTC SIP telepresence demo client](http://conf-call.org/) then, no modification is needed. -------------------------------------------------------------------------------- /Technical_Recording_conference_to_a_file.md: -------------------------------------------------------------------------------- 1 | This feature is configured as explained [here](Configuration_Recording_conference_to_a_file.md). 2 | 3 | We support almost any container depending on how you built _FFmpeg_ and which codecs are enabled. Right now we recommend only **.avi** and **.mp4** as they are fully tested. **.mkv** and **.webm** will also work but not fully tested yet. The audio and video mixing is done using _libavformat_ from FFmpeg. 4 | 5 | * _**.avi**_ (recommended) requires FFmpeg with **MPEG4** video codec and **AC3** audio codec 6 | * _**.mp4**_ requires FFmpeg with **H.264** ([libx264](https://code.google.com/p/telepresence/wiki/Support_BuildingSourceCode#Building_x264) thirdparty library) video codec and AAC audio codec. There is a built-in experimental **AAC** codec in FFmpeg but the code is intentionally designed to not accept such codec because of random crashes. For AAC audio codec, you’ll need to build FFmpeg with [libfaac](https://code.google.com/p/telepresence/wiki/Support_BuildingSourceCode#Building_libfaac) or any other [third-party AAC library](http://ffmpeg.org/trac/ffmpeg/wiki/AACEncodingGuide). Please note that all AAC libraries are not free. 7 | * _**.avi**_ is recommended instead of **.mp4** for the simple reason that the first one consume less CPU. 8 | The output file will have the bridge identifier as name and container type as extension, e.g. _+336000000.avi_. The file is locked and invalid until the last user quit the bridge. 9 | 10 | We highly recommend using [VLC](http://www.videolan.org/vlc/index.html) to play the output files. -------------------------------------------------------------------------------- /Technical_SA_versus_AS_modes.md: -------------------------------------------------------------------------------- 1 | The server supports two modes: **SA** (stand-alone) and **AS** (application server). These modes are not exclusive and no special configuration is needed. 2 | 3 | The **SA** mode allows any SIP client to directly connect to the system without any intermediate node. If the client requires to be registered then, you can enable this option as explained [here](Configuration_SIP_registration.md) because the SIP registrar mode is OFF by default. 4 | 5 | The **AS** mode is useful if you already have your own SIP network/server and want to integrate the Telepresence system as an application server. This mode has been tested against [Asterisk](http://www.asterisk.org/), [reSIProcate](http://www.resiprocate.org/Main_Page), [openSIPS](http://www.opensips.org/) and [Kamailio](http://www.kamailio.org/w/). This is as easy as forwarding any INVITE (based on some criterias, e.g. _[name equal to @conf-call.org](domain.md)_) received by the SIP registrar to the Telepresence system. -------------------------------------------------------------------------------- /Technical_Security.md: -------------------------------------------------------------------------------- 1 | This section explains how to secure both signaling and media plans. 2 | 3 | 4 | 5 | # Signaling # 6 | Two secure signaling protocols are supported: **TLS** and **WSS**. **WSS** is WebSocket secured using **TLS**. For more information on how to enable these transport protocols using the configuration file, please refer to [this wiki page](Configuration_SIP_network_transports.md). 7 | 8 | Both transports require [OpenSSL](https://code.google.com/p/telepresence/wiki/Support_BuildingSourceCode#Building_OpenSSL) which have to be enabled when building the Doubango framework only. 9 | 10 | More information on how to configure the SSL certificates could be found [here](Configuration_Security.md). 11 | 12 | # Media # 13 | Both **SRTP-SDES** ([RFC 4568](http://tools.ietf.org/html/rfc4568)) and **SRTP-DTLS** ([RFC 5763](http://tools.ietf.org/html/rfc5763), [RFC 5764](http://tools.ietf.org/html/rfc5764)) are supported. 14 | 15 | Check [here](Configuration_Security.md) for more information on how these features have to be configured. 16 | 17 | _--This section intentionally left blank--_ -------------------------------------------------------------------------------- /Technical_Stereoscopic_spatial_3D_audio.md: -------------------------------------------------------------------------------- 1 | Our 3D audio mixer is based on [OpenAL Soft](http://kcat.strangesoft.net/openal.html) and supports up to 256 sources. Your OpenAL version must be at least 1.15.1 and implements [ALC\_SOFT\_loopback](http://kcat.strangesoft.net/openal-extensions/SOFT_loopback.txt) extension. 2 | 3 | To have a 3D audio, each SIP client should signal its position in the virtual room. The signaling is done using two SIP headers: TP-AudioPosition and TP-AudioVelocity. These two SIP headers must contain an array of three floating numbers. 4 | ``` 5 | TP-AudioPosition: [0.0f, 0.0f, 0.0f] 6 | TP-AudioVelocity: [0.0f, 0.0f, 0.0f] 7 | ``` 8 | Using our [WebRTC TelePresence client](http://conf-call.org/contact.htm), the 3D settings could be defined at [http://conf-call.org/settings.htm](http://conf-call.org/settings.htm). 9 | 10 | From OpenAL documentation, "AL_POSITION specifies the current location of the object in the world coordinate system. Any 3-tuple of valid float values is allowed. Implementation behavior on encountering NaN and infinity is not defined. The object position is always defined in the world coordinate system." 11 | 12 | From OpenAL documentation, AL_VELOCITY specifies the current velocity (speed and direction) of the object, in the world coordinate system. Any 3-tuple of valid float/double values is allowed. The object AL_VELOCITY does not affect the source's position. OpenAL does not calculate the velocity from subsequent position updates, nor does it adjust the position over time based on the specified velocity. Any such calculation is left to the application. For the purposes of sound processing, position and velocity are independent parameters affecting different aspects of the sounds.” -------------------------------------------------------------------------------- /Technical_Video_mixer_design.md: -------------------------------------------------------------------------------- 1 | The video mixing and scaling is completely managed using FFmpeg. In this beta version, only 2D mixing is supported. We’ll consider support for [libyuv](https://code.google.com/p/libyuv/) in the next versions. 2 | 3 | 4 | 5 | # Encoders and decoders # 6 | To minimize CPU utilization, all endpoints with the same video codec use the same encoder but different decoders. For example, if you have 7 endpoints using VP8 codec then, the MCU will have 1 encoder and 7 decoders. Using a single encoder gives better CPU performances but more bandwidth than what’s needed because if one endpoint requests an IDR then, the prediction chain is restarted for all other peers. 7 | 8 | # Overlays # 9 | The overlays are configured as explained [here](Configuration_Video#Overlays.md). 10 | 11 | The mixed video contains many overlays displayed using [FFmpeg filters](http://www.ffmpeg.org/ffmpeg-filters.html). There are two kinds of overlays: texts and images. The text overlays use [drawtext filter](http://www.ffmpeg.org/ffmpeg-filters.html#drawtext-1) which requires [libfreetype](https://code.google.com/p/telepresence/wiki/Support_BuildingSourceCode#Building_libfreetype) to be enabled when building FFmpeg. The image overlays (watermarks) use [movie filter](http://www.ffmpeg.org/ffmpeg-filters.html#movie-1) and accept any PNG or JPEG file as input. JPEG images are natively supported by FFmpeg (thanks to MPEG4) while PNG requires [zlib](http://zlib.net/) to be enabled. 12 | 13 | The configuration file could be used to define custom font types for the text overlays. The font types must be [TrueType](https://en.wikipedia.org/wiki/TrueType)-compatible. The default fonts come from [ftp://ftp.gnu.org/pub/gnu/freefont](ftp://ftp.gnu.org/pub/gnu/freefont). -------------------------------------------------------------------------------- /Technical_Video_quality.md: -------------------------------------------------------------------------------- 1 | This section explains how to make sure to have a good video quality when using the system. 2 | 3 | 4 | 5 | # Packet loss recovery # 6 | This feature requires the jitter buffer to be enabled. 7 | When a RTP packet is lost then, we request the remote party to send it again using RTCP-NACKs as per [RFC 5104](http://tools.ietf.org/html/rfc5104). Support for this feature is indicated using the SDP (attribute _a=rtcp-fb: `*` nack_). If the remote peer cannot honor the request in a reasonable delay then, the packet is considered as definitely lost. If we’re very lucky then, losing a packet would just introduce artifacts. Otherwise (not lucky), this will break the prediction chain and any attempt to decode the video would fail until the next IDR frame. Enabling zero-artifacts feature would fix artifact and prediction issues. 8 | Increasing the internal RTP buffer size as explained [here](Configuration_RTP_buffer_size.md) could also help to lower packet loss. 9 | 10 | # Jitter buffer # 11 | The video jitter buffer could be enabled as explained [here](Configuration_Video#Jitter_Buffer.md). 12 | Enabling the video jitter buffer introduce small delay (~100ms) but worth it. Buffering the video packets allows requesting missing packets using RTCP-NACK ([RFC 5104](http://tools.ietf.org/html/rfc5104)) and reordering them based on the RTP sequence numbers. It’s also up to the jitter buffer to consume any delay or burst to have smooth video according to the frame rate. The video frame rate is negotiated using the SDP but this value will be updated based on the RTP timestamps. 13 | 14 | # Zero-artifacts # 15 | This feature is enabled or disabled as explained [here](Configuration_Video#Zero-artifacts.md). 16 | A video stream contains artifacts when some RTP packets are lost. The MCU try its best to avoid packet loss (see [here](Technical_Video_quality#Packet_loss_recovery.md)) but sometimes it fails and this leads to visual artifacts. As the video streams are mixed then, the artifacts will be propagated to all endpoints. When ‘zero-artifact’ is enabled then, the MCU pauses the rendering on the stream and sends RTCP-FIR ([RFC 5104](http://tools.ietf.org/html/rfc5104)) to request new IDR frame to repair the prediction chain. Only the stream with the missing RTP packets is paused until the next IDR frame is received. Support for RTCP-FIR is signaled to the remote endpoints using the SDP (attribute _a=rtcp-fb: `*` fir_). The MCU sends IDR frames when it receives RTCP-FIR or RTCP-PLI from one of the endpoints. 17 | 18 | # AVPF tail length # 19 | As already explained, RTCP-NACKs are used to ask a peer to send a packet again. In order to be able to honor these requests we need to save the outgoing RTP packets in a queue. The AVPF tail length option defines the minimum and maximum lengths for the queue. The higher these values are the better will be the video quality. The default queue length will be equal to the minimum value and it’s up to the MCU to increase this value depending on the number of unrecoverable packet loss. The final value will be at most equal to the maximum defined in the configuration file. Unrecoverable packet loss occurs when the MCU receives an RTCP-NACK for an already removed sequence number (very common when network RTT is very high or bandwidth very low). 20 | Setting the AVPF tail length (min, max) is done as explained [here](Configuration_AVPF_tail_length.md). 21 | 22 | # FEC (Forward Error Correction) # 23 | --This section intentionally left blank-- 24 | 25 | # RED (Redundant video data) # 26 | --This section intentionally left blank-- -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | echo libtoolize 2 | if [ `(uname -s) 2>/dev/null` == 'Darwin' ] 3 | then 4 | glibtoolize --copy --force 5 | else 6 | libtoolize --copy --force 7 | fi 8 | 9 | echo "aclocal" 10 | aclocal 11 | 12 | echo "autoheader" 13 | autoheader 14 | 15 | echo "create NEWS, README, AUTHORS and ChangeLog" 16 | touch NEWS README AUTHORS ChangeLog 17 | 18 | echo "autoreconf" 19 | autoreconf -i 20 | 21 | echo "automake" 22 | automake -a -------------------------------------------------------------------------------- /documentation/technical-guide.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/documentation/technical-guide.doc -------------------------------------------------------------------------------- /documentation/technical-guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/documentation/technical-guide.pdf -------------------------------------------------------------------------------- /fonts/truetype/freefont/FreeMonoBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/fonts/truetype/freefont/FreeMonoBold.ttf -------------------------------------------------------------------------------- /fonts/truetype/freefont/FreeSerif.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/fonts/truetype/freefont/FreeSerif.ttf -------------------------------------------------------------------------------- /fonts/truetype/freefont/INSTALL: -------------------------------------------------------------------------------- 1 | Installing GNU FreeFont 2 | ======================= 3 | 4 | GNU FreeFont can be used in any modern operating system. 5 | 6 | This document explains how to install FreeFont on some common systems. 7 | 8 | UNIX/GNU/Linux/BSD Systems 9 | -------------------------- 10 | 11 | FreeFont works with any system using the free font rasterizer FreeType 12 | . Some features such as glyph substitution and 13 | positioning may be handled by the text layout library 14 | Pango . 15 | 16 | Most recent systems using FreeType2 and Pango handle OpenType fonts well, 17 | but on older systems TrueType may perform better. 18 | 19 | * Debian GNU/Linux 20 | 21 | Users of Debian GNU/Linux system will probably want to use the Debian package, 22 | named 'ttf-freefont', available from the Debian Linux site. 23 | 24 | Install the fonts by issuing the command 25 | apt-get install ttf-freefont 26 | 27 | 28 | * KDE local installation 29 | 30 | Users of KDE can install .ttf files on a per-user basis using the KDE 31 | Control Center module "kcmfontinst", which may appear in the menu as 32 | 33 | Settings -> System Administration -> Font Installer 34 | 35 | This is especially helpful for developers and testers. 36 | 37 | 38 | * Generic X Window systems 39 | 40 | 1) Fetch the freefont-ttf.tar.gz package with Free UCS outline fonts 41 | in the TrueType format. 42 | 43 | 2) Unpack TrueType fonts into a suitable directory, 44 | e.g. /usr/local/share/fonts/default/TrueType/ 45 | 46 | 3) If you have chosen any other directory, make sure the directory you 47 | used to install the fonts is listed in the path searched by the X 48 | Font Server by editing the config file in /etc/X11/. 49 | 50 | In some systems, you list the directory in the item "catalogue=" 51 | in the file /etc/X11/fs/config. 52 | 53 | 4) Run ttmkfdir in the directory where you unpacked the fonts. 54 | 55 | 56 | Microsoft Windows 95/98/NT/2000/XP; Vista/7 57 | ------------------------------------------- 58 | 59 | Note that in at least Windows 7, Vista, XP and 2000, the TrueType versions 60 | perform much better than, and are recommended over, the OpenType ones. 61 | 62 | For good font smoothing in Windows, Microsoft ClearType must be enabled. 63 | The native Windows web browser must be used to install, enable, and configure 64 | ClearType. A web search for "ClearType Tuner" will find the proper web pages. 65 | Recent versions of the browser raise a security block (a yellow bar at the 66 | top of the window), which you must act upon to allow installation. A 67 | checkbox in the window turns ClearType on (in Win-speek, "Turn on ClearType"). 68 | The change happens immediately. 69 | 70 | * Vista, Windows 7: 71 | 1) From the Start menu, open Control Panels 72 | 2) Drag-n-drop font files onto Fonts control panel 73 | You may get a dialog saying 74 | "Windows needs your permission to continue" 75 | a) Click Continue 76 | 77 | * 95/98/NT: 78 | The font installation is similar to Vista. 79 | 80 | In order to use OpenType, users of Windows 95, 98 and NT 4.0 can 81 | install Adobe's 'Type Manager Light', which may be obtained from 82 | the Adobe web site. 83 | 84 | Otherwise, use the TrueType versions. 85 | 86 | Apple Mac OS X 87 | -------------- 88 | 89 | Support for OpenType on MacOS X started with OS 10.4, and has been improved 90 | gradually in later versions. 91 | 92 | Installing on Mac OS X consists of moving the font files to either 93 | /Library/Fonts/ or ~/Library/Fonts/ 94 | depending on whether they should be available to all users on your system 95 | or just to your own user. 96 | 97 | -------------------------------------------------------------------------- 98 | $Id: INSTALL,v 1.11 2011-06-12 07:14:12 Stevan_White Exp $ 99 | -------------------------------------------------------------------------------- /images/audio_mixer_resampler.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/images/audio_mixer_resampler.png -------------------------------------------------------------------------------- /images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/images/logo.jpg -------------------------------------------------------------------------------- /images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/images/logo.png -------------------------------------------------------------------------------- /images/logo35x34.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/images/logo35x34.jpg -------------------------------------------------------------------------------- /images/presentation_sharing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/images/presentation_sharing.png -------------------------------------------------------------------------------- /include/OpenTelepresenceAPI.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_API_H 8 | #define OPENTELEPRESENCE_API_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTCodec.h" 12 | #include "opentelepresence/OTCodecAudio.h" 13 | #include "opentelepresence/OTCodecVideo.h" 14 | #include "opentelepresence/OTEngine.h" 15 | #include "opentelepresence/OTCommon.h" 16 | #include "opentelepresence/OTMixerMgrAudio.h" 17 | #include "opentelepresence/OTMixerMgr.h" 18 | #include "opentelepresence/OTMixerMgrVideo.h" 19 | #include "opentelepresence/OTObject.h" 20 | #include "opentelepresence/OTProxyPlugin.h" 21 | #include "opentelepresence/OTProxyPluginConsumer.h" 22 | #include "opentelepresence/OTProxyPluginConsumerAudio.h" 23 | #include "opentelepresence/OTProxyPluginConsumerVideo.h" 24 | #include "opentelepresence/OTProxyPluginMgr.h" 25 | #include "opentelepresence/OTProxyPluginProducer.h" 26 | #include "opentelepresence/OTProxyPluginProducerAudio.h" 27 | 28 | 29 | #endif /* OPENTELEPRESENCE_API_H */ 30 | -------------------------------------------------------------------------------- /include/opentelepresence/OTBridge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_BRIDGE_H 8 | #define OPENTELEPRESENCE_BRIDGE_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | #include "opentelepresence/OTBridgeInfo.h" 13 | #include "opentelepresence/OTMixerMgrMgr.h" 14 | #include "opentelepresence/cfg/OTCfg.h" 15 | 16 | #include "tinydav/tdav.h" 17 | 18 | #include "tsk_mutex.h" 19 | 20 | #include 21 | #include 22 | 23 | class OTSipSessionAV; 24 | class OTEngineInfo; 25 | 26 | class OTBridge : public OTObject 27 | { 28 | friend class OTSipCallback; 29 | public: 30 | OTBridge(std::string strId, OTObjectWrapper oEngineInfo); 31 | virtual ~OTBridge(); 32 | virtual OT_INLINE const char* getObjectId() { return "OTBridge"; } 33 | 34 | virtual OT_INLINE std::string getId(){ return m_strId; } 35 | virtual int start(); 36 | virtual OT_INLINE bool isRunning(){ return m_bRunning; } 37 | virtual int stop(); 38 | virtual int hangUpSession(uint64_t nSessionId); 39 | virtual int addAVCall(OTObjectWrapper oAVCall); 40 | virtual int removeAVCall(uint64_t nSessionId); 41 | virtual OTObjectWrapper findCallByUserId(std::string strUserId); 42 | virtual OTObjectWrapper findCallBySessionId(uint64_t nSessionId); 43 | virtual size_t getNumberOfActiveAVCalls(); 44 | virtual OT_INLINE OTObjectWrapper getInfo(){ return m_oInfo; } 45 | 46 | protected: 47 | virtual OT_INLINE bool isValid(){ return m_bValid; } 48 | 49 | #if defined(_MSC_VER) 50 | # pragma warning( push ) 51 | # pragma warning( disable : 4251 ) 52 | #endif 53 | 54 | private: 55 | OTObjectWrapper m_oInfo; 56 | std::string m_strId; 57 | bool m_bValid; 58 | bool m_bRunning; 59 | 60 | std::map > m_oAVCalls; 61 | OTObjectWrapper m_oMixerMgrMgr; 62 | OTMapOfCfgParams m_oMapOfCfgParams; 63 | 64 | #if defined(_MSC_VER) 65 | # pragma warning( pop ) 66 | #endif 67 | 68 | }; 69 | 70 | #if defined(_MSC_VER) 71 | template class OTObjectWrapper; 72 | #endif 73 | 74 | #endif /* OPENTELEPRESENCE_BRIDGE_H */ 75 | -------------------------------------------------------------------------------- /include/opentelepresence/OTCodecAudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_CODECAUDIO_H 8 | #define OPENTELEPRESENCE_CODECAUDIO_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | 13 | #endif /* OPENTELEPRESENCE_CODECAUDIO_H */ 14 | -------------------------------------------------------------------------------- /include/opentelepresence/OTCodecVideo.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENTELEPRESENCE_CODECVIDEO_H 2 | #define OPENTELEPRESENCE_CODECVIDEO_H 3 | 4 | #include "OpenTelepresenceConfig.h" 5 | 6 | 7 | #endif /* OPENTELEPRESENCE_CODECVIDEO_H */ 8 | -------------------------------------------------------------------------------- /include/opentelepresence/OTCommon.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENTELEPRESENCE_COMMON_H 2 | #define OPENTELEPRESENCE_COMMON_H 3 | 4 | #include "OpenTelepresenceConfig.h" 5 | 6 | #define OT_CAT_(A, B) A ## B 7 | #define OT_CAT(A, B) OT_CAT_(A, B) 8 | #define OT_STRING_(A) #A 9 | #define OT_STRING(A) OT_STRING_(A) 10 | 11 | #if !defined(OT_SAFE_DELETE_CPP) 12 | # define OT_SAFE_DELETE_CPP(cpp_obj) if(cpp_obj) delete (cpp_obj), (cpp_obj) = NULL; 13 | #endif 14 | 15 | #if defined(NDEBUG) 16 | # define OT_ASSERT(x) (void)(x) 17 | #else 18 | # define OT_ASSERT(x) assert(x) 19 | #endif 20 | 21 | typedef int32_t OTNetFd; 22 | #define OTNetFd_IsValid(self) ((self) > 0) 23 | #define kOTNetFdInvalid -1 24 | 25 | #define kOTMobuleNameCfg "CFG" 26 | #define kOTMobuleNameWebM "WebM" 27 | #define kOTMobuleNameOpenAL "OpenAL Soft" 28 | #define kOTMobuleNameFFmpegRecorder "FFmpegRecorder" 29 | #define kOTMobuleNameFFmpegOverlay "FFmpegOverlay" 30 | #define kOTMobuleNameFFmpegFilter "FFmpegOverlay" 31 | #define kOTMobuleNameFFmpegResampler "FFmpegResampler" 32 | #define kOTMobuleNameDocStreamer "DocStreamer" 33 | #define kOTMobuleNameDocStreamerOpenOffice "DocStreamerOpenOffice" 34 | #define kOTMobuleNameExperimental "Experimental" 35 | #define kOTMobuleNameNetTransport "NetTransport" 36 | #define kOTMobuleNameHttpTransport "HttpTransport" 37 | 38 | #define kJsonContentType "application/json" 39 | #define kFileContentType "application/file" 40 | 41 | #if !defined(kOTSipHeaderServer) 42 | # define kOTSipHeaderServer "Doubango Telepresence " OT_VERSION_STRING 43 | #endif 44 | 45 | typedef enum OTSessionState_e 46 | { 47 | OTSessionState_None, 48 | OTSessionState_Connecting, 49 | OTSessionState_Connected, 50 | OTSessionState_Terminated 51 | } 52 | OTSessionState_t; 53 | 54 | typedef enum OTMediaType_e 55 | { 56 | OTMediaType_None = 0x00, 57 | OTMediaType_Audio = (0x01<<0), 58 | OTMediaType_Video = (0x01<<1), 59 | OTMediaType_AudioVideo = (OTMediaType_Audio | OTMediaType_Video), 60 | 61 | OTMediaType_All = (OTMediaType_AudioVideo), 62 | } 63 | OTMediaType_t; 64 | 65 | typedef enum OTDimension_e 66 | { 67 | OTDimension_None = 0x00, 68 | OTDimension_2D = 0x01<<1, 69 | OTDimension_3D = 0x01<<2 70 | } 71 | OTDimension_t; 72 | 73 | typedef enum OTPatternType_e 74 | { 75 | OTPatternType_None = 0x0000, 76 | 77 | OTPatternType_Hangout, 78 | OTPatternType_WebEx, 79 | } 80 | OTPatternType_t; 81 | 82 | typedef struct OT3f_s 83 | { 84 | float x; 85 | float y; 86 | float z; 87 | } 88 | OT3f_t; 89 | 90 | typedef struct OTRect_s 91 | { 92 | size_t nLeft; 93 | size_t nTop; 94 | size_t nRight; 95 | size_t nBottom; 96 | } 97 | OTRect_t; 98 | #define OTRectWidth(r) ((r).nRight - (r).nLeft) 99 | #define OTRectHeight(r) ((r).nBottom - (r).nTop) 100 | 101 | typedef struct OTRatio_s 102 | { 103 | size_t nNumerator; 104 | size_t nDenominator; 105 | } 106 | OTRatio_t; 107 | 108 | typedef enum OTDocStreamerState_e 109 | { 110 | OTDocStreamerState_None = 0x00, 111 | OTDocStreamerState_Opening = (0x01 << 1), 112 | OTDocStreamerState_Opened = (0x01 << 2), 113 | OTDocStreamerState_Exporting = (0x01 << 3) | OTDocStreamerState_Opened, 114 | OTDocStreamerState_Exported = (0x01 << 4) | OTDocStreamerState_Opened, 115 | OTDocStreamerState_Closed = (0x01 << 5) 116 | } 117 | OTDocStreamerState_t; 118 | 119 | typedef enum OTDocStreamerType_e 120 | { 121 | OTDocStreamerType_None, 122 | OTDocStreamerType_OpenOffice 123 | } 124 | OTDocStreamerType_t; 125 | 126 | typedef enum OTNetTransporType_e 127 | { 128 | OTNetTransporType_None, 129 | OTNetTransporType_TCP, 130 | OTNetTransporType_TLS 131 | } 132 | OTNetTransporType_t; 133 | 134 | static bool OTNetTransporType_isStream(OTNetTransporType_t eType) 135 | { 136 | switch(eType) 137 | { 138 | case OTNetTransporType_TCP: 139 | case OTNetTransporType_TLS: 140 | return true; 141 | default: 142 | return false; 143 | } 144 | } 145 | 146 | typedef enum OTHttpActionType_e 147 | { 148 | OTHttpActionType_None, 149 | OTHttpActionType_UploadPresensation 150 | } 151 | OTHttpActionType_t; 152 | 153 | #endif /* OPENTELEPRESENCE_COMMON_H */ 154 | -------------------------------------------------------------------------------- /include/opentelepresence/OTFrame.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENTELEPRESENCE_FRAME_H 2 | #define OPENTELEPRESENCE_FRAME_H 3 | 4 | #include "OpenTelepresenceConfig.h" 5 | #include "opentelepresence/OTObject.h" 6 | #include "opentelepresence/OTCommon.h" 7 | #include "opentelepresence/patterns/OTPattern.h" 8 | 9 | #include "tsk_mutex.h" 10 | 11 | class OTFrame : public OTObject 12 | { 13 | protected: 14 | OTFrame(OTMediaType_t eMediaType, bool bOwnBuffer, const void *pBufferPtr, uint32_t nBufferSize); 15 | public: 16 | virtual ~OTFrame(); 17 | virtual OT_INLINE const char* getObjectId() { return "OTFrame"; } 18 | 19 | OT_INLINE bool isValid() { return m_pBufferPtr && m_nBufferSize; } 20 | OT_INLINE OTMediaType_t getMediaType() { return m_eMediaType; } 21 | OT_INLINE OTDimension_t getDimension() { return m_eDimension; } 22 | OT_INLINE void* getBufferPtr() { return m_pBufferPtr; } 23 | OT_INLINE uint32_t getBufferSize() { return m_nBufferSize; } 24 | OT_INLINE uint32_t getValidDataSize() { return m_nValidDataSize; } 25 | OT_INLINE OTPatternType_t getPatternType() { return m_ePatternType; } 26 | OT_INLINE void setPatternType(OTPatternType_t ePatternType) { m_ePatternType = ePatternType; } 27 | OT_INLINE void setValidDataSize(uint32_t nValidDataSize) { m_nValidDataSize = TSK_CLAMP(0, nValidDataSize, m_nBufferSize); } 28 | bool copyBuffer(const void *pSrcBufferPtr, uint32_t nSrcBufferSize); 29 | bool resizeBuffer(uint32_t nNewBufferSize); 30 | OT_INLINE void resetValidDataSize(){ m_nValidDataSize = 0; } 31 | 32 | virtual bool prepareLock(); 33 | virtual bool lock(); 34 | virtual bool unlock(); 35 | 36 | static OTObjectWrapper New(OTMediaType_t eMediaType, bool bOwnBuffer, const void *pBufferPtr, uint32_t nBufferSize); 37 | 38 | protected: 39 | OTMediaType_t m_eMediaType; 40 | OTDimension_t m_eDimension; 41 | bool m_bOwnBuffer; 42 | void *m_pBufferPtr; 43 | uint32_t m_nBufferSize; 44 | uint32_t m_nValidDataSize; 45 | OTPatternType_t m_ePatternType; 46 | tsk_mutex_handle_t *m_phMutex; 47 | }; 48 | 49 | #endif /* OPENTELEPRESENCE_FRAME_H */ 50 | -------------------------------------------------------------------------------- /include/opentelepresence/OTFrameAudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_FRAMEAUDIO_H 8 | #define OPENTELEPRESENCE_FRAMEAUDIO_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTFrame.h" 12 | 13 | class OTFrameAudio : public OTFrame 14 | { 15 | protected: 16 | OTFrameAudio(bool bOwnBuffer, const void *pBufferPtr, uint32_t nBufferSize); 17 | public: 18 | virtual ~OTFrameAudio(); 19 | virtual OT_INLINE const char* getObjectId() { return "OTFrameAudio"; } 20 | 21 | virtual OT_INLINE void setVolume(float fVolume) { m_fVolume = fVolume; } 22 | virtual OT_INLINE float getVolume() { return m_fVolume; } 23 | virtual OT_INLINE void setBitsPerSample(uint16_t nBitsPerSample) { m_nBitsPerSample = nBitsPerSample; } 24 | virtual OT_INLINE uint16_t getBitsPerSample() { return m_nBitsPerSample; } 25 | virtual OT_INLINE void setChannels(uint16_t nChannels) { m_nChannels = nChannels; } 26 | virtual OT_INLINE uint16_t getChannels(){ return m_nChannels; } 27 | virtual OT_INLINE void setSampleRate(uint16_t nSampleRate) { m_nSampleRate = nSampleRate; } 28 | virtual OT_INLINE uint16_t getSampleRate(){ return m_nSampleRate; } 29 | 30 | static OTObjectWrapper New(bool bOwnBuffer, const void *pBufferPtr, uint32_t nBufferSize); 31 | 32 | private: 33 | float m_fVolume; 34 | uint16_t m_nBitsPerSample; 35 | uint16_t m_nChannels; 36 | uint16_t m_nSampleRate; 37 | }; 38 | 39 | #endif /* OPENTELEPRESENCE_FRAMEAUDIO_H */ 40 | -------------------------------------------------------------------------------- /include/opentelepresence/OTFrameVideo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_FRAMEVIDEO_H 8 | #define OPENTELEPRESENCE_FRAMEVIDEO_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTFrame.h" 12 | 13 | class OTFrameVideo : public OTFrame 14 | { 15 | protected: 16 | OTFrameVideo(bool bOwnBuffer, const void *pBufferPtr, uint32_t nBufferSize); 17 | public: 18 | virtual ~OTFrameVideo(); 19 | virtual OT_INLINE const char* getObjectId() { return "OTFrameVideo"; } 20 | 21 | virtual OT_INLINE unsigned getWidth() { return m_nWidth; } 22 | virtual OT_INLINE void setWidth(unsigned nWidth) { m_nWidth = nWidth; } 23 | virtual OT_INLINE unsigned getHeight() { return m_nHeight; } 24 | virtual OT_INLINE void setHeight(unsigned nHeight) { m_nHeight = nHeight; } 25 | 26 | static OTObjectWrapper New(bool bOwnBuffer, const void *pBufferPtr, uint32_t nBufferSize); 27 | 28 | private: 29 | unsigned m_nWidth; 30 | unsigned m_nHeight; 31 | }; 32 | 33 | #endif /* OPENTELEPRESENCE_FRAMEVIDEO_H */ 34 | -------------------------------------------------------------------------------- /include/opentelepresence/OTMixerMgr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_MIXERMGR_H 8 | #define OPENTELEPRESENCE_MIXERMGR_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | #include "opentelepresence/OTObject.h" 13 | #include "opentelepresence/OTCommon.h" 14 | #include "opentelepresence/OTSessionInfo.h" 15 | #include "opentelepresence/OTCodec.h" 16 | #include "opentelepresence/OTBridgeInfo.h" 17 | #include "opentelepresence/recorder/OTRecorder.h" 18 | 19 | #include 20 | 21 | class OTMixerMgr : public OTObject 22 | { 23 | public: 24 | OTMixerMgr(OTMediaType_t eMediaType, OTObjectWrapper oBridgeInfo); 25 | ~OTMixerMgr(); 26 | virtual OT_INLINE const char* getObjectId() { return "OTMixerMgr"; } 27 | 28 | virtual OT_INLINE OTMediaType_t getMediaType() { return m_eMediaType; } 29 | virtual OT_INLINE uint64_t getBridgeId() { return m_nBridgeId; } 30 | virtual OT_INLINE void setRecorder(OTObjectWrapper oRecorder){ m_oRecorder = oRecorder; } 31 | 32 | virtual int start()=0; 33 | virtual bool isStarted()=0; 34 | virtual int pause()=0; 35 | virtual bool isPaused()=0; 36 | virtual int flush()=0; 37 | virtual int stop()=0; 38 | virtual int attachMediaPlugins(OTObjectWrapper pOTSessionInfo)=0; 39 | virtual int deAttachMediaPlugins(OTObjectWrapper pOTSessionInfo)=0; 40 | 41 | static OTObjectWrapper New(OTMediaType_t eMediaType, OTObjectWrapper oBridgeInfo); 42 | 43 | protected: 44 | virtual bool isValid()=0; 45 | virtual OTObjectWrapper findBestCodec(OTCodec_Type_t eListOfCodecsToSearchInto); 46 | virtual bool removeCodecs(OTCodec_Type_t eListOfCodecsToSearchInto); 47 | virtual bool addCodec(OTObjectWrapper oCodec); 48 | virtual bool executeActionOnCodecs(OTCodecAction_t eAction); 49 | 50 | protected: 51 | OTMediaType_t m_eMediaType; 52 | uint64_t m_nBridgeId; 53 | std::map > m_OTCodecs; 54 | OTObjectWrapper m_oBridgeInfo; 55 | OTObjectWrapper m_oRecorder; 56 | }; 57 | 58 | #endif /* OPENTELEPRESENCE_MIXERMGR_H */ 59 | -------------------------------------------------------------------------------- /include/opentelepresence/OTMixerMgrAudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_MIXERMGRAUDIO_H 8 | #define OPENTELEPRESENCE_MIXERMGRAUDIO_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | #include "opentelepresence/OTMixerMgr.h" 13 | #include "opentelepresence/mixers/OTMixerAudio.h" 14 | #include "opentelepresence/OTProxyPluginConsumerAudio.h" 15 | #include "opentelepresence/OTProxyPluginProducerAudio.h" 16 | 17 | #include "tsk_mutex.h" 18 | #include "tsk_thread.h" 19 | #include "tsk_condwait.h" 20 | 21 | #include 22 | 23 | class OTMixerMgrAudio : public OTMixerMgr 24 | { 25 | public: 26 | OTMixerMgrAudio(OTObjectWrapper oBridgeInfo); 27 | ~OTMixerMgrAudio(); 28 | virtual OT_INLINE const char* getObjectId() { return "OTMixerMgrAudio"; } 29 | 30 | // OTMixerOTMixerMgr 31 | virtual int start(); 32 | virtual bool isStarted(); 33 | virtual int pause(); 34 | virtual bool isPaused(); 35 | virtual int flush(); 36 | virtual int stop(); 37 | virtual int attachMediaPlugins(OTObjectWrapper pOTSessionInfo); 38 | virtual int deAttachMediaPlugins(OTObjectWrapper pOTSessionInfo); 39 | 40 | protected: 41 | virtual bool isValid(); 42 | 43 | private: 44 | static void* TSK_STDCALL pullThreadFunc(void *arg); 45 | void resetConsumersJitter(); 46 | int mixAndSend(); 47 | 48 | #if defined(_MSC_VER) 49 | # pragma warning( push ) 50 | # pragma warning( disable : 4251 ) 51 | #endif 52 | 53 | private: 54 | bool m_bValid; 55 | bool m_bStarted; 56 | bool m_bPaused; 57 | 58 | tsk_mutex_handle_t *m_phProducersMutex; 59 | tsk_mutex_handle_t *m_phConsumersMutex; 60 | 61 | std::map > m_oConsumers; 62 | std::map > m_oProducers; 63 | 64 | OTObjectWrapper m_oMixerAudio; 65 | 66 | uint64_t m_nLastTimerPull; 67 | tsk_thread_handle_t* m_phPullThread[1]; 68 | tsk_condwait_handle_t* m_phPullCond; 69 | 70 | #if defined(_MSC_VER) 71 | # pragma warning( pop ) 72 | #endif 73 | 74 | }; 75 | 76 | #endif /* OPENTELEPRESENCE_MIXERMGRAUDIO_H */ 77 | -------------------------------------------------------------------------------- /include/opentelepresence/OTMixerMgrMgr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_MIXERMGRMGR_H 8 | #define OPENTELEPRESENCE_MIXERMGRMGR_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | #include "opentelepresence/OTObject.h" 13 | #include "opentelepresence/OTCommon.h" 14 | #include "opentelepresence/OTMixerMgr.h" 15 | #include "opentelepresence/OTSessionInfo.h" 16 | #include "opentelepresence/OTBridgeInfo.h" 17 | #include "opentelepresence/recorder/OTRecorder.h" 18 | 19 | class OTMixerMgrMgr : public OTObject 20 | { 21 | public: 22 | OTMixerMgrMgr(OTMediaType_t eMediaType, OTObjectWrapper oBridgeInfo); 23 | ~OTMixerMgrMgr(); 24 | virtual OT_INLINE const char* getObjectId() { return "OTMixerMgrMgr"; } 25 | 26 | inline OTMediaType_t getMediaType() { return m_eMediaType; } 27 | virtual bool isValid(); 28 | 29 | int start(OTMediaType_t eMediaType); 30 | bool isStarted(OTMediaType_t eMediaType); 31 | int pause(OTMediaType_t eMediaType); 32 | bool isPaused(OTMediaType_t eMediaType); 33 | int flush(OTMediaType_t eMediaType); 34 | int stop(OTMediaType_t eMediaType); 35 | int attachMediaPlugins(OTObjectWrapper pOTSessionInfo); 36 | int deAttachMediaPlugins(OTObjectWrapper pOTSessionInfo); 37 | 38 | static OTObjectWrapper New(OTMediaType_t eMediaType, OTObjectWrapper oBridgeInfo); 39 | 40 | private: 41 | OTObjectWrapper m_pOTMixerMgrAudio; 42 | OTObjectWrapper m_pOTMixerMgrVideo; 43 | OTObjectWrapper m_oRecorder; 44 | OTMediaType_t m_eMediaType; 45 | bool m_bValid; 46 | }; 47 | 48 | #endif /* OPENTELEPRESENCE_MIXERMGRMGR_H */ 49 | -------------------------------------------------------------------------------- /include/opentelepresence/OTMixerMgrVideo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_MIXERMGRVIDEO_H 8 | #define OPENTELEPRESENCE_MIXERMGRVIDEO_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | #include "opentelepresence/OTMixerMgr.h" 13 | #include "opentelepresence/mixers/OTMixerVideo.h" 14 | #include "opentelepresence/OTProxyPluginConsumerVideo.h" 15 | #include "opentelepresence/OTProxyPluginProducerVideo.h" 16 | 17 | #include "tsk_thread.h" 18 | #include "tsk_condwait.h" 19 | 20 | #include 21 | 22 | class OTMixerMgrVideo : public OTMixerMgr 23 | { 24 | public: 25 | OTMixerMgrVideo(OTObjectWrapper oBridgeInfo); 26 | ~OTMixerMgrVideo(); 27 | OT_INLINE virtual const char* getObjectId() { return "OTMixerMgrVideo"; } 28 | 29 | // OTMixerOTMixerMgr 30 | virtual int start(); 31 | virtual bool isStarted(); 32 | virtual int pause(); 33 | virtual bool isPaused(); 34 | virtual int flush(); 35 | virtual int stop(); 36 | virtual int attachMediaPlugins(OTObjectWrapper pOTSessionInfo); 37 | virtual int deAttachMediaPlugins(OTObjectWrapper pOTSessionInfo); 38 | 39 | private: 40 | static int rtcpOnEventCb(const void* pcUsrData, enum tmedia_rtcp_event_type_e eEventType, uint32_t nSsrcMedia); 41 | static void* TSK_STDCALL pullThreadFunc(void *arg); 42 | void resetConsumersJitter(); 43 | int mixAndSend(); 44 | 45 | protected: 46 | virtual bool isValid(); 47 | 48 | #if defined(_MSC_VER) 49 | # pragma warning( push ) 50 | # pragma warning( disable : 4251 ) 51 | #endif 52 | 53 | private: 54 | bool m_bValid; 55 | bool m_bStarted; 56 | bool m_bPaused; 57 | bool m_bRequestedIntraViaRtcp; 58 | 59 | uint64_t m_nLastTimeRTPTimeoutChecked; 60 | 61 | uint64_t m_nLastTimeIdrSent; 62 | 63 | void* m_pMixedBufferPtr; 64 | uint32_t m_nMixedBufferSize; 65 | 66 | 67 | tsk_mutex_handle_t *m_phProducersMutex; 68 | tsk_mutex_handle_t *m_phConsumersMutex; 69 | 70 | std::map > m_oConsumers; 71 | std::map > m_oProducers; 72 | 73 | OTObjectWrapper m_oMixerVideo; 74 | 75 | tsk_thread_handle_t* m_phPullThread[1]; 76 | tsk_condwait_handle_t* m_phPullCond; 77 | 78 | #if defined(_MSC_VER) 79 | # pragma warning( pop ) 80 | #endif 81 | }; 82 | 83 | #endif /* OPENTELEPRESENCE_MIXERMGRVIDEO_H */ 84 | -------------------------------------------------------------------------------- /include/opentelepresence/OTMutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #if !defined(OPENTELEPRESENCE_MUTEX_H) 8 | #define OPENTELEPRESENCE_MUTEX_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | 13 | #include "tsk_mutex.h" 14 | 15 | class OTMutex : public OTObject 16 | { 17 | public: 18 | OTMutex(bool bRecursive = true); 19 | virtual ~OTMutex(); 20 | virtual OT_INLINE const char* getObjectId() { return "OTMutex"; } 21 | bool lock(); 22 | bool unlock(); 23 | 24 | private: 25 | tsk_mutex_handle_t* m_phOTMutex; 26 | }; 27 | 28 | #endif /* OPENTELEPRESENCE_MUTEX_H */ 29 | -------------------------------------------------------------------------------- /include/opentelepresence/OTProcess.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PROCESS_H 8 | #define OPENTELEPRESENCE_PROCESS_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | #include "opentelepresence/OTCommon.h" 13 | 14 | #include 15 | 16 | class OTProcess : public OTObject 17 | { 18 | protected: 19 | OTProcess(std::string strProgram, std::string strArgs); 20 | public: 21 | virtual ~OTProcess(); 22 | virtual OT_INLINE const char* getObjectId() { return "OTProcess"; } 23 | virtual bool isValid() = 0; 24 | virtual bool start() = 0; 25 | virtual bool isStarted() = 0; 26 | virtual bool stop() = 0; 27 | 28 | static OTObjectWrapper New(std::string strProgram, std::string strArgs); 29 | 30 | protected: 31 | 32 | }; 33 | 34 | #endif /* OPENTELEPRESENCE_PROCESS_H */ 35 | -------------------------------------------------------------------------------- /include/opentelepresence/OTProxyPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PLUGIN_H 8 | #define OPENTELEPRESENCE_PLUGIN_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | #include "opentelepresence/OTCommon.h" 13 | #include "opentelepresence/OTSessionInfo.h" 14 | 15 | #include "ProxyPluginMgr.h" 16 | 17 | #include "tsk_mutex.h" 18 | 19 | class OTProxyPlugin : public OTObject 20 | { 21 | protected: 22 | OTProxyPlugin(OTMediaType_t eMediaType, uint64_t nId, const ProxyPlugin* pcProxyPlugin); 23 | 24 | public: 25 | virtual ~OTProxyPlugin(); 26 | OT_INLINE virtual const char* getObjectId() { return "OTProxyPlugin"; } 27 | OT_INLINE bool operator ==(const OTProxyPlugin& other) const{ 28 | return m_nId == other.m_nId; 29 | } 30 | OT_INLINE virtual uint64_t getId() { return m_nId; } 31 | OT_INLINE virtual OTMediaType_t getMediaType() { return m_eMediaType; } 32 | OT_INLINE virtual void invalidate(){ m_bValid = false; } 33 | OT_INLINE virtual bool isValid() { return m_bValid; } 34 | OT_INLINE virtual bool isPrepared() { return m_bPrepared; } 35 | OT_INLINE virtual bool isPaused() { return m_bPaused; } 36 | OT_INLINE virtual bool isStarted() { return m_bStarted; } 37 | 38 | OT_INLINE virtual bool lock() { 39 | if(m_phMutex){ 40 | return (tsk_mutex_lock(m_phMutex) == 0); 41 | } 42 | return false; 43 | } 44 | OT_INLINE virtual bool unLock() { 45 | if(m_phMutex){ 46 | return (tsk_mutex_unlock(m_phMutex) == 0); 47 | } 48 | return false; 49 | } 50 | 51 | OT_INLINE virtual void setSessionInfo(OTObjectWrapper oSessionInfo) { m_oSessionInfo = oSessionInfo; } 52 | OT_INLINE OTObjectWrapper getSessionInfo(){ return m_oSessionInfo; } 53 | 54 | // short path (to avoid using getSessionInfo() which create a copy) 55 | // these functions will be used inside delay-sensitive blocks 56 | OT_INLINE uint64_t getSessionInfoProducerId(OTMediaType_t eMediaType){ return m_oSessionInfo->getProducerId(eMediaType); } 57 | OT_INLINE uint64_t getSessionInfoConsumerId(OTMediaType_t eMediaType){ return m_oSessionInfo->getConsumerId(eMediaType); } 58 | OT_INLINE void setSessionInfoSpeaker(bool bSpeaker) { m_oSessionInfo->setSpeaker(bSpeaker); } 59 | OT_INLINE void setSessionInfoSpeaking(bool bSpeaking) { m_oSessionInfo->setSpeaking(bSpeaking); } 60 | 61 | protected: 62 | OT_INLINE int prepare() { m_bPrepared = true; return 0; } 63 | OT_INLINE int start() { m_bStarted = true; return 0; } 64 | OT_INLINE int pause() { m_bPaused = true; return 0; } 65 | OT_INLINE int stop() { m_bStarted = false; return 0; } 66 | 67 | protected: 68 | bool m_bValid; 69 | bool m_bPrepared; 70 | bool m_bStarted; 71 | bool m_bPaused; 72 | uint64_t m_nId; 73 | OTMediaType_t m_eMediaType; 74 | const ProxyPlugin* m_pcProxyPlugin; 75 | OTObjectWrapper m_oSessionInfo; 76 | tsk_mutex_handle_t *m_phMutex; 77 | 78 | }; 79 | 80 | #endif /* OPENTELEPRESENCE_PLUGIN_H */ 81 | -------------------------------------------------------------------------------- /include/opentelepresence/OTProxyPluginConsumer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PLUGINCONSUMER_H 8 | #define OPENTELEPRESENCE_PLUGINCONSUMER_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | #include "OTProxyPlugin.h" 13 | #include "ProxyConsumer.h" 14 | 15 | 16 | class OTProxyPluginConsumer : public OTProxyPlugin 17 | { 18 | public: 19 | OTProxyPluginConsumer(OTMediaType_t eMediaType, uint64_t nId, const ProxyPlugin* pcConsumer); 20 | virtual ~OTProxyPluginConsumer(); 21 | }; 22 | 23 | #endif /* OPENTELEPRESENCE_PLUGINCONSUMER_H */ 24 | -------------------------------------------------------------------------------- /include/opentelepresence/OTProxyPluginConsumerAudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PLUGINCONSUMERAUDIO_H 8 | #define OPENTELEPRESENCE_PLUGINCONSUMERAUDIO_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTProxyPlugin.h" 12 | 13 | #include "opentelepresence/OTProxyPluginConsumer.h" 14 | 15 | #include "tinydav/audio/tdav_consumer_audio.h" 16 | 17 | class OTProxyPluginConsumerAudioCallback; 18 | 19 | // 20 | // OTProxyPluginConsumerAudio 21 | // 22 | class OTProxyPluginConsumerAudio : public OTProxyPluginConsumer 23 | { 24 | friend class OTProxyPluginConsumerAudioCallback; 25 | public: 26 | OTProxyPluginConsumerAudio(uint64_t nId, const ProxyAudioConsumer* pcConsumer); 27 | virtual ~OTProxyPluginConsumerAudio(); 28 | 29 | OT_INLINE unsigned pull(void* output, unsigned size){ 30 | return (m_pcWrappedConsumer && m_bStarted) ? const_cast(m_pcWrappedConsumer)->pull(output, size) : 0; 31 | } 32 | unsigned pullAndHold(); 33 | unsigned copyFromHeldBuffer(void* output, unsigned size); 34 | OT_INLINE bool reset(){ 35 | m_nRTPPktPullCount = m_nRTPPktPullTime = 0; 36 | return m_pcWrappedConsumer ? const_cast(m_pcWrappedConsumer)->reset() : false; 37 | } 38 | OT_INLINE int getPtime() { return m_nPtime; } 39 | OT_INLINE int getRate() { return m_nRate; } 40 | OT_INLINE int getChannels() { return m_nChannels; } 41 | OT_INLINE double getVolumeAvg() { return m_nVolumeAvg; } 42 | OT_INLINE double getVolumeNow() { return m_nVolumeNow; } 43 | 44 | private: 45 | int prepareCallback(int ptime, int rate, int channels); 46 | int startCallback(); 47 | int pauseCallback(); 48 | int stopCallback(); 49 | 50 | private: 51 | OTProxyPluginConsumerAudioCallback* m_pCallback; 52 | const ProxyAudioConsumer* m_pcWrappedConsumer; 53 | int m_nPtime; 54 | int m_nRate; 55 | int m_nChannels; 56 | int m_nBitsPerSample; 57 | void* m_pHeldBufferPtr; 58 | double m_nVolumeNow; 59 | double m_nVolumeAvg; 60 | uint32_t m_nMaxLatency; 61 | uint32_t m_nVolumeComputeCount; 62 | uint32_t m_nHeldBufferSizeInBytes; 63 | uint32_t m_nHeldBufferSizeInSamples; 64 | uint32_t m_nHeldBufferPos; 65 | 66 | uint64_t m_nRTPPktPullCount; 67 | uint64_t m_nRTPPktPullTime; 68 | 69 | bool m_bSettingsChanged; 70 | }; 71 | 72 | // 73 | // OTProxyPluginConsumerAudioCallback 74 | // 75 | class OTProxyPluginConsumerAudioCallback : public ProxyAudioConsumerCallback { 76 | public: 77 | OTProxyPluginConsumerAudioCallback(OTObjectWrapperpConsumer) 78 | : ProxyAudioConsumerCallback(), m_pConsumer(pConsumer){ 79 | } 80 | virtual ~OTProxyPluginConsumerAudioCallback(){ 81 | OTObjectSafeRelease(m_pConsumer); 82 | } 83 | public: /* Overrides */ 84 | virtual int prepare(int ptime, int rate, int channels) { 85 | return m_pConsumer->prepareCallback(ptime, rate, channels); 86 | } 87 | virtual int start() { 88 | return m_pConsumer->startCallback(); 89 | } 90 | virtual int pause() { 91 | return m_pConsumer->pauseCallback(); 92 | } 93 | virtual int stop() { 94 | return m_pConsumer->stopCallback(); 95 | } 96 | virtual bool isPivotSettings() { 97 | return true; // Do not override PIVOT settings 98 | } 99 | private: 100 | OTObjectWrapper m_pConsumer; 101 | }; 102 | 103 | 104 | #endif /* OPENTELEPRESENCE_PLUGINCONSUMERAUDIO_H */ 105 | -------------------------------------------------------------------------------- /include/opentelepresence/OTProxyPluginConsumerVideo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PLUGINCONSUMERVIDEO_H 8 | #define OPENTELEPRESENCE_PLUGINCONSUMERVIDEO_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTProxyPlugin.h" 12 | #include "opentelepresence/OTFrameVideo.h" 13 | #include "opentelepresence/filters/OTOverlay.h" 14 | 15 | #include "opentelepresence/OTProxyPluginConsumer.h" 16 | 17 | #include "tinydav/video/tdav_consumer_video.h" 18 | 19 | class OTProxyPluginConsumerVideoVideoCallback; 20 | 21 | class OTProxyPluginConsumerVideo : public OTProxyPluginConsumer 22 | { 23 | friend class OTProxyPluginConsumerVideoVideoCallback; 24 | public: 25 | OTProxyPluginConsumerVideo(uint64_t nId, const ProxyVideoConsumer* pcConsumer); 26 | virtual ~OTProxyPluginConsumerVideo(); 27 | OT_INLINE virtual const char* getObjectId() { return "OTProxyPluginConsumerVideo"; } 28 | 29 | public: 30 | OT_INLINE bool setDisplaySize(int nWidth, int nHeight){ 31 | return m_pcWrappedConsumer ? const_cast(m_pcWrappedConsumer)->setDisplaySize(nWidth, nHeight) : false; 32 | } 33 | OT_INLINE bool reset(){ 34 | return m_pcWrappedConsumer ? const_cast(m_pcWrappedConsumer)->reset() : false; 35 | } 36 | OT_INLINE int getFps() { return m_nFPS; } 37 | OT_INLINE int getHeight() { return m_nHeight; } 38 | OT_INLINE int getWidth() { return m_nWidth; } 39 | OT_INLINE uint32_t getHeldBufferSize() { return m_OTHeldFrameVideo ? m_OTHeldFrameVideo->getValidDataSize() : 0; } 40 | OT_INLINE OTObjectWrapper getHeldFrameVideo(){ return m_OTHeldFrameVideo; } 41 | 42 | bool drawOverlay(bool bListener, 43 | const void* pcInBufferPtr, size_t nInBufferSize, size_t nInWidth, size_t nInHeight, 44 | size_t nOutWidth, size_t nOutHeight, void* pOutFrame 45 | ); 46 | 47 | 48 | private: 49 | int prepareCallback(int nWidth, int nHeight, int nFps); 50 | int startCallback(); 51 | int consumeCallback(const ProxyVideoFrame* frame); 52 | int pauseCallback(); 53 | int stopCallback(); 54 | 55 | private: 56 | OTProxyPluginConsumerVideoVideoCallback* m_pCallback; 57 | const ProxyVideoConsumer* m_pcWrappedConsumer; 58 | int32_t m_nWidth, m_nHeight, m_nFPS, m_nPtime; 59 | OTObjectWrapperm_OTHeldFrameVideo; 60 | OTObjectWrapper m_oOverlaySpeakerText; 61 | OTObjectWrapper m_oOverlaySpeakerWatermark; 62 | OTObjectWrapper m_oOverlayListenerText; 63 | }; 64 | 65 | // 66 | // OTProxyPluginConsumerVideoVideoCallback 67 | // 68 | class OTProxyPluginConsumerVideoVideoCallback : public ProxyVideoConsumerCallback { 69 | public: 70 | OTProxyPluginConsumerVideoVideoCallback(OTObjectWrapperpConsumer) 71 | : ProxyVideoConsumerCallback(), m_pConsumer(pConsumer){ 72 | } 73 | virtual ~OTProxyPluginConsumerVideoVideoCallback(){ 74 | OTObjectSafeRelease(m_pConsumer); 75 | } 76 | public: /* Overrides */ 77 | virtual int prepare(int width, int height, int fps) { 78 | return m_pConsumer->prepareCallback(width, height, fps); 79 | } 80 | virtual int start() { 81 | return m_pConsumer->startCallback(); 82 | } 83 | virtual int consume(const ProxyVideoFrame* frame) { 84 | return m_pConsumer->consumeCallback(frame); 85 | } 86 | virtual int pause() { 87 | return m_pConsumer->pauseCallback(); 88 | } 89 | virtual int stop() { 90 | return m_pConsumer->stopCallback(); 91 | } 92 | private: 93 | OTObjectWrapper m_pConsumer; 94 | }; 95 | 96 | 97 | #endif /* OPENTELEPRESENCE_PLUGINCONSUMERVIDEO_H */ 98 | -------------------------------------------------------------------------------- /include/opentelepresence/OTProxyPluginMgr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PROXYPLUGINMGR_H 8 | #define OPENTELEPRESENCE_PROXYPLUGINMGR_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTProxyPlugin.h" 12 | 13 | #include "tsk_mutex.h" 14 | 15 | #include 16 | 17 | class OTProxyPluginMgrCallback; 18 | typedef std::map > OTMapOfPlugins; 19 | 20 | // 21 | // OTProxyPluginMgr 22 | // 23 | class OTProxyPluginMgr 24 | { 25 | private: 26 | static ProxyPluginMgr* g_pPluginMgr; 27 | static OTProxyPluginMgrCallback* g_pPluginMgrCallback; 28 | static OTMapOfPlugins* g_pPlugins; 29 | static tsk_mutex_handle_t* g_phMutex; 30 | static bool g_bInitialized; 31 | 32 | public: 33 | static void initialize(); 34 | static void deInitialize(); 35 | 36 | static inline OTObjectWrapper findPlugin(uint64_t nId) 37 | { 38 | OTMapOfPlugins::iterator it = OTProxyPluginMgr::g_pPlugins->find(nId); 39 | OTObjectWrapper pPlugin = NULL; 40 | if(it != OTProxyPluginMgr::g_pPlugins->end()) 41 | { 42 | pPlugin = it->second; 43 | } 44 | return pPlugin; 45 | } 46 | 47 | static inline void erasePlugin(uint64_t nId){ 48 | OTMapOfPlugins::iterator it; 49 | if((it = OTProxyPluginMgr::g_pPlugins->find(nId)) != OTProxyPluginMgr::g_pPlugins->end()) 50 | { 51 | OTObjectWrapper pPlugin = it->second; 52 | OTProxyPluginMgr::g_pPlugins->erase(it); 53 | pPlugin->invalidate(); 54 | pPlugin->releaseRef(); 55 | } 56 | } 57 | 58 | static inline OTMapOfPlugins* getPlugins() 59 | { 60 | return OTProxyPluginMgr::g_pPlugins; 61 | } 62 | 63 | static inline tsk_mutex_handle_t* getMutex() 64 | { 65 | return OTProxyPluginMgr::g_phMutex; 66 | } 67 | 68 | static inline ProxyPluginMgr* getPluginMgr() 69 | { 70 | return const_cast (OTProxyPluginMgr::g_pPluginMgr); 71 | } 72 | }; 73 | 74 | // 75 | // OTProxyPluginMgrCallback 76 | // 77 | class OTProxyPluginMgrCallback : public ProxyPluginMgrCallback 78 | { 79 | public: 80 | OTProxyPluginMgrCallback(); 81 | virtual ~OTProxyPluginMgrCallback(); 82 | 83 | public: /* override */ 84 | virtual int OnPluginCreated(uint64_t id, enum twrap_proxy_plugin_type_e type); 85 | virtual int OnPluginDestroyed(uint64_t id, enum twrap_proxy_plugin_type_e type); 86 | }; 87 | 88 | #endif /* OPENTELEPRESENCE_PROXYPLUGINMGR_H */ 89 | -------------------------------------------------------------------------------- /include/opentelepresence/OTProxyPluginProducer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PLUGINPRODUCER_H 8 | #define OPENTELEPRESENCE_PLUGINPRODUCER_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | #include "OTProxyPlugin.h" 13 | #include "ProxyProducer.h" 14 | 15 | class Codec; 16 | 17 | class OTProxyPluginProducer : public OTProxyPlugin 18 | { 19 | public: 20 | OTProxyPluginProducer(OTMediaType_t eMediaType, uint64_t nId, const ProxyPlugin* pcProducer); 21 | virtual ~OTProxyPluginProducer(); 22 | 23 | virtual OT_INLINE const Codec* getCodec(){ return m_pCodec; } 24 | virtual void setCodec(Codec* pcCodec); 25 | 26 | private: 27 | Codec* m_pCodec; 28 | }; 29 | 30 | 31 | #endif /* OPENTELEPRESENCE_PLUGINPRODUCER_H */ 32 | -------------------------------------------------------------------------------- /include/opentelepresence/OTProxyPluginProducerAudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PLUGINPRODUCERAUDIO_H 8 | #define OPENTELEPRESENCE_PLUGINPRODUCERAUDIO_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTProxyPluginProducer.h" 12 | #include "opentelepresence/OTFrameAudio.h" 13 | 14 | #include "tsk_semaphore.h" 15 | #include "tsk_mutex.h" 16 | #include "tsk_buffer.h" 17 | 18 | class OTProxyPluginProducerAudioCallback; 19 | 20 | // 21 | // OTProxyPluginProducerAudio 22 | // 23 | class OTProxyPluginProducerAudio : public OTProxyPluginProducer 24 | { 25 | friend class OTProxyPluginProducerAudioCallback; 26 | public: 27 | OTProxyPluginProducerAudio(uint64_t nId, const ProxyAudioProducer* pcProducer); 28 | virtual ~OTProxyPluginProducerAudio(); 29 | int push(const void* buffer, unsigned size); 30 | OT_INLINE int getPtime() { return m_nPtime; } 31 | OT_INLINE int getRate() { return m_nRate; } 32 | OT_INLINE int getChannels() { return m_nChannels; } 33 | 34 | static void* TSK_STDCALL senderThread(void *arg); 35 | 36 | private: 37 | int prepareCallback(int ptime, int rate, int channels); 38 | int startCallback(); 39 | int pauseCallback(); 40 | int stopCallback(); 41 | 42 | private: 43 | OTProxyPluginProducerAudioCallback* m_pCallback; 44 | const ProxyAudioProducer* m_pcWrappedProducer; 45 | void* m_phSenderThread[1]; 46 | tsk_semaphore_handle_t *m_phSenderSemaphore; 47 | OTObjectWrapper m_oFrame; 48 | int m_nPtime; 49 | int m_nRate; 50 | int m_nChannels; 51 | int m_nBitsPerSample; 52 | }; 53 | 54 | 55 | // 56 | // OTProxyPluginProducerAudioCallback 57 | // 58 | class OTProxyPluginProducerAudioCallback : public ProxyAudioProducerCallback { 59 | public: 60 | OTProxyPluginProducerAudioCallback(OTObjectWrapperpOTProducer) 61 | : ProxyAudioProducerCallback(), m_pOTProducer(pOTProducer){ 62 | } 63 | virtual ~OTProxyPluginProducerAudioCallback(){ 64 | OTObjectSafeRelease(m_pOTProducer); 65 | } 66 | public: /* Overrides */ 67 | virtual int prepare(int ptime, int rate, int channels) { 68 | return m_pOTProducer->prepareCallback(ptime, rate, channels); 69 | } 70 | virtual int start() { 71 | return m_pOTProducer->startCallback(); 72 | } 73 | virtual int pause() { 74 | return m_pOTProducer->pauseCallback(); 75 | } 76 | virtual int stop() { 77 | return m_pOTProducer->stopCallback(); 78 | } 79 | private: 80 | OTObjectWrapper m_pOTProducer; 81 | }; 82 | 83 | #endif /* OPENTELEPRESENCE_PLUGINPRODUCERAUDIO_H */ 84 | -------------------------------------------------------------------------------- /include/opentelepresence/OTProxyPluginProducerVideo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PLUGINPRODUCERVIDEO_H 8 | #define OPENTELEPRESENCE_PLUGINPRODUCERVIDEO_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTProxyPlugin.h" 12 | #include "opentelepresence/OTFrameVideo.h" 13 | 14 | #include "opentelepresence/OTProxyPluginProducer.h" 15 | 16 | class OTProxyPluginProducerVideoCallback; 17 | 18 | // 19 | // OTProxyPluginProducerVideo 20 | // 21 | class OTProxyPluginProducerVideo : public OTProxyPluginProducer 22 | { 23 | friend class OTProxyPluginProducerVideoCallback; 24 | public: 25 | OTProxyPluginProducerVideo(uint64_t nId, const ProxyVideoProducer* pcProducer); 26 | virtual ~OTProxyPluginProducerVideo(); 27 | 28 | // Encode then send 29 | int send(OTObjectWrapper pOTOTFrameVideo); 30 | // Send "AS IS" 31 | int sendRaw(const void* pcBuffer, unsigned nSize, unsigned nDuration, bool bMarker){ 32 | return (m_pcWrappedProducer && isStarted()) ? const_cast(m_pcWrappedProducer)->sendRaw(pcBuffer, nSize, nDuration, bMarker) : 0; 33 | } 34 | bool setActualCameraOutputSize(unsigned nWidth, unsigned nHeight){ 35 | return (m_pcWrappedProducer && isStarted()) ? const_cast(m_pcWrappedProducer)->setActualCameraOutputSize(nWidth, nHeight) : 0; 36 | } 37 | 38 | OT_INLINE int getFps() { return m_nFPS; } 39 | OT_INLINE int getHeight() { return m_nHeight; } 40 | OT_INLINE int getWidth() { return m_nWidth; } 41 | 42 | private: 43 | int prepareCallback(int nWidth, int nHeight, int nFps); 44 | int startCallback(); 45 | int pauseCallback(); 46 | int stopCallback(); 47 | 48 | static void* TSK_STDCALL senderThread(void *arg); 49 | 50 | private: 51 | OTProxyPluginProducerVideoCallback* m_pCallback; 52 | const ProxyVideoProducer* m_pcWrappedProducer; 53 | int m_nWidth, m_nHeight, m_nFPS; 54 | void* m_phSenderThread[1]; 55 | tsk_semaphore_handle_t *m_phSenderSemaphore; 56 | tsk_mutex_handle_t *m_phSenderMutex; 57 | tsk_buffer_t *m_pSenderBuffer; 58 | tsk_size_t m_nSenderBufferLimit; 59 | }; 60 | 61 | 62 | // 63 | // OTProxyPluginProducerVideoCallback 64 | // 65 | class OTProxyPluginProducerVideoCallback : public ProxyVideoProducerCallback { 66 | public: 67 | OTProxyPluginProducerVideoCallback(OTObjectWrapperpOTProducer) 68 | : ProxyVideoProducerCallback(), m_pOTProducer(pOTProducer){ 69 | } 70 | virtual ~OTProxyPluginProducerVideoCallback(){ 71 | OTObjectSafeRelease(m_pOTProducer); 72 | } 73 | public: /* Overrides */ 74 | virtual int prepare(int width, int height, int fps) { 75 | return m_pOTProducer->prepareCallback(width, height, fps); 76 | } 77 | virtual int start() { 78 | return m_pOTProducer->startCallback(); 79 | } 80 | virtual int pause() { 81 | return m_pOTProducer->pauseCallback(); 82 | } 83 | virtual int stop() { 84 | return m_pOTProducer->stopCallback(); 85 | } 86 | private: 87 | OTObjectWrapper m_pOTProducer; 88 | }; 89 | 90 | 91 | #endif /* OPENTELEPRESENCE_PLUGINPRODUCERVIDEO_H */ 92 | -------------------------------------------------------------------------------- /include/opentelepresence/OTResampler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_RESAMPLER_AUDIO_H 8 | #define OPENTELEPRESENCE_RESAMPLER_AUDIO_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | #include "opentelepresence/OTCommon.h" 13 | 14 | class OTResamplerAudio : public OTObject 15 | { 16 | protected: 17 | OTResamplerAudio( 18 | size_t nInChannels, size_t nOutChannels, 19 | size_t nInBitsPerSample, size_t nOutBitsPerSample, 20 | size_t nInSampleRate, size_t nOutSampleRate, 21 | size_t nPtime); 22 | public: 23 | virtual ~OTResamplerAudio(); 24 | virtual OT_INLINE const char* getObjectId() { return "OTResamplerAudio"; } 25 | 26 | virtual size_t resample(const void* pInBufferPtr, size_t nInBufferSizeInSamples, void* pOutBufferPtr, size_t nOutBufferSizeInSamples) = 0; 27 | virtual bool isValid() = 0; 28 | 29 | static bool registerPlugin(); 30 | static OTObjectWrapper New(size_t nInChannels, size_t nOutChannels, 31 | size_t nInBitsPerSample, size_t nOutBitsPerSample, 32 | size_t nInSampleRate, size_t nOutSampleRate, 33 | size_t nPtime); 34 | 35 | virtual OT_INLINE size_t getInChannels(){ return m_nInChannels; } 36 | virtual OT_INLINE size_t getOutChannels(){ return m_nOutChannels; } 37 | virtual OT_INLINE size_t getInBitsPerSample(){ return m_nInBitsPerSample; } 38 | virtual OT_INLINE size_t getOutBitsPerSample(){ return m_nOutBitsPerSample; } 39 | virtual OT_INLINE size_t getInSampleRate(){ return m_nInSampleRate; } 40 | virtual OT_INLINE size_t getOutSampleRate(){ return m_nOutSampleRate; } 41 | virtual OT_INLINE size_t getPtime(){ return m_nPtime; } 42 | virtual OT_INLINE size_t getInBytesPerSample(){ return m_nInBytesPerSample; } 43 | virtual OT_INLINE size_t getOutBytesPerSample(){ return m_nOutBytesPerSample; } 44 | virtual OT_INLINE size_t getExpectedInBufferSizeInSamples(){ return m_nExpectedInBufferSizeInSamples; } 45 | virtual OT_INLINE size_t getExpectedOutBufferSizeInSamples(){ return m_nExpectedOutBufferSizeInSamples; } 46 | 47 | protected: 48 | size_t m_nInChannels, m_nOutChannels; 49 | size_t m_nInBitsPerSample, m_nOutBitsPerSample; 50 | size_t m_nInSampleRate, m_nOutSampleRate; 51 | size_t m_nPtime; 52 | size_t m_nInBytesPerSample, m_nOutBytesPerSample; 53 | size_t m_nExpectedInBufferSizeInSamples, m_nExpectedOutBufferSizeInSamples; 54 | }; 55 | 56 | #endif /* OPENTELEPRESENCE_RESAMPLER_AUDIO_H */ 57 | -------------------------------------------------------------------------------- /include/opentelepresence/OTRole.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_ROLE_H 8 | #define OPENTELEPRESENCE_ROLE_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | typedef enum OTRole_e 13 | { 14 | OTRole_None = 0x00, 15 | OTRole_Attendee = (0x01<<0), 16 | OTRole_Participant = (0x01<<1), 17 | OTRole_Speaker = (0x01<<2) | OTRole_Attendee | OTRole_Participant, 18 | OTRole_Presenter = OTRole_Speaker, 19 | } 20 | OTRole_t; 21 | 22 | static bool OTRoleIsAttendee(OTRole_t eRole) 23 | { 24 | return (eRole & OTRole_Attendee) == OTRole_Attendee; 25 | } 26 | 27 | static bool OTRoleIsParticipant(OTRole_t eRole) 28 | { 29 | return (eRole & OTRole_Participant) == OTRole_Participant; 30 | } 31 | 32 | static bool OTRoleIsSpeaker(OTRole_t eRole) 33 | { 34 | return (eRole & OTRole_Speaker) == OTRole_Speaker; 35 | } 36 | 37 | static bool OTRoleIsPresenter(OTRole_t eRole) 38 | { 39 | return (eRole & OTRole_Presenter) == OTRole_Presenter; 40 | } 41 | 42 | #endif /* OPENTELEPRESENCE_ROLE_H */ 43 | -------------------------------------------------------------------------------- /include/opentelepresence/cfg/OTCfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_CFG_H 8 | #define OPENTELEPRESENCE_CFG_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | #include "opentelepresence/OTObject.h" 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | class OTCfgParam; 19 | 20 | typedef std::map > OTMapOfCfgParams; 21 | 22 | typedef enum OTCfgType_e 23 | { 24 | OTCfgType_None, 25 | OTCfgType_Section, 26 | OTCfgType_Param, 27 | OTCfgType_EoF, 28 | } 29 | OTCfgType_t; 30 | 31 | class OTCfg : public OTObject 32 | { 33 | protected: 34 | OTCfg(OTCfgType_t eType); 35 | public: 36 | virtual ~OTCfg(); 37 | virtual OT_INLINE const char* getObjectId() { return "OTCfg"; } 38 | virtual OT_INLINE OTCfgType_t getType() { return m_eType; } 39 | 40 | protected: 41 | OTCfgType_t m_eType; 42 | }; 43 | 44 | class OTCfgEoF : public OTCfg 45 | { 46 | public: 47 | OTCfgEoF() : OTCfg(OTCfgType_EoF){} 48 | virtual ~OTCfgEoF(){ } 49 | OT_INLINE const char* getObjectId() { return "OTCfgEoF"; } 50 | }; 51 | 52 | class OTCfgSection : public OTCfg 53 | { 54 | public: 55 | OTCfgSection(const char* pcName); 56 | virtual ~OTCfgSection(); 57 | OT_INLINE const char* getObjectId() { return "OTCfgSection"; } 58 | OT_INLINE const char* getName() { return m_pName; } 59 | OT_INLINE const std::list >* getParams(){ return &m_oParams; } 60 | bool addParam(OTObjectWrapper oParam); 61 | bool addParam(const char* pcName, const char* pcValue); 62 | private: 63 | char* m_pName; 64 | std::list > m_oParams; 65 | }; 66 | 67 | class OTCfgParam : public OTCfg 68 | { 69 | public: 70 | OTCfgParam(const char* pcName, const char* pcValue); 71 | virtual ~OTCfgParam(); 72 | OT_INLINE const char* getObjectId() { return "OTCfgParam"; } 73 | OT_INLINE const char* getName() { return m_pName; } 74 | OT_INLINE const char* getValue() { return m_pValue; } 75 | private: 76 | char* m_pName; 77 | char* m_pValue; 78 | }; 79 | 80 | #endif /* OPENTELEPRESENCE_CFG_H */ 81 | -------------------------------------------------------------------------------- /include/opentelepresence/cfg/OTCfgParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_CFG_PARSER_H 8 | #define OPENTELEPRESENCE_CFG_PARSER_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "OTCfg.h" 12 | 13 | typedef bool (*OTCfgParserOnNewCfg_f)(OTObjectWrapper oCfg, const void* pcCallbackData); 14 | 15 | class OTCfgParser 16 | { 17 | public: 18 | static bool parse(const char* pcFullFilePath, const void* pcCallbackData, OTCfgParserOnNewCfg_f fnOnNewCfg); 19 | }; 20 | 21 | #endif /* OPENTELEPRESENCE_CFG_PARSER_H */ 22 | -------------------------------------------------------------------------------- /include/opentelepresence/docstreamer/OTDocStreamer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_DOC_STREAMER_H 8 | #define OPENTELEPRESENCE_DOC_STREAMER_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | #include "opentelepresence/OTCommon.h" 13 | #include "opentelepresence/OTBridgeInfo.h" 14 | 15 | #include 16 | #include 17 | 18 | class OTDocStreamer; 19 | 20 | class OTDocStreamerCallback 21 | { 22 | public: 23 | OTDocStreamerCallback(){} 24 | virtual ~OTDocStreamerCallback(){} 25 | 26 | virtual void onStateChanged(OTDocStreamerState_t eState, OTDocStreamer* oStreamer) const= 0; 27 | virtual void onError(bool bIsFatal, OTDocStreamer* oStreamer) const= 0; 28 | }; 29 | 30 | class OTDocStreamer : public OTObject 31 | { 32 | protected: 33 | OTDocStreamer(OTDocStreamerType_t eType, OTObjectWrapper oBridgeInfo, const OTDocStreamerCallback* pcCallback = NULL); 34 | public: 35 | virtual ~OTDocStreamer(); 36 | virtual OT_INLINE const char* getObjectId() { return "OTDocStreamer"; } 37 | 38 | virtual OT_INLINE OTDocStreamerState_t getState() { return m_eState; } 39 | virtual OT_INLINE void setCallback(OTDocStreamerCallback* pcCallback) { m_pcCallback = pcCallback; } 40 | virtual bool isValid() = 0; 41 | virtual bool open(std::string strDocPath) = 0; 42 | virtual bool close() = 0; 43 | virtual size_t getPagesCount() = 0; 44 | virtual size_t getPageIndex() = 0; 45 | virtual bool exportPage(size_t nPageIndex) = 0; 46 | virtual bool getCurrentFrame(size_t* pnPageIndex, const void** ppcPtr, size_t* pnWidth = NULL, size_t* pnHeight = NULL) = 0; 47 | 48 | virtual OT_INLINE bool isOpened() { return (m_eState & OTDocStreamerState_Opened); } 49 | virtual OT_INLINE uint64_t getId() { return m_uId; } 50 | virtual OT_INLINE size_t getWidth() { return m_oBridgeInfo->getVideoWidth(); } 51 | virtual OT_INLINE size_t getHeight() { return m_oBridgeInfo->getVideoHeight(); } 52 | virtual OT_INLINE OTDocStreamerType_t getType() { return m_eType; } 53 | 54 | static std::string buildCommandArgs(unsigned short nLocalPort); 55 | static std::string buildConnectionString(unsigned short nLocalPort); 56 | static bool isSupported(); 57 | static OTObjectWrapper New(OTObjectWrapper oBridgeInfo, const OTDocStreamerCallback* pcCallback = NULL); 58 | 59 | static bool PredIsOpened(const std::pair > &pcOTStreamer) { return pcOTStreamer.second->isOpened(); } 60 | 61 | protected: 62 | virtual OT_INLINE void setState(OTDocStreamerState_t eState) 63 | { 64 | if(m_eState != eState) 65 | { 66 | m_eState = eState; 67 | if(m_pcCallback) 68 | { 69 | m_pcCallback->onStateChanged(eState, this); 70 | } 71 | } 72 | } 73 | 74 | protected: 75 | uint64_t m_uId; 76 | OTObjectWrapper m_oBridgeInfo; 77 | OTDocStreamerState_t m_eState; 78 | const OTDocStreamerCallback* m_pcCallback; 79 | 80 | private: 81 | OTDocStreamerType_t m_eType; 82 | static uint64_t g_uId; 83 | }; 84 | 85 | 86 | 87 | #endif /* OPENTELEPRESENCE_DOC_STREAMER_H */ 88 | -------------------------------------------------------------------------------- /include/opentelepresence/docstreamer/OTDocStreamerOpenOffice.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_DOC_STREAMER_OPENOFFICE_H 8 | #define OPENTELEPRESENCE_DOC_STREAMER_OPENOFFICE_H 9 | 10 | #include "OTDocStreamer.h" 11 | #include "opentelepresence/OTMutex.h" 12 | 13 | #if HAVE_OPENOFFICE 14 | 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | typedef enum OO_THREAD_INDEX_E 23 | { 24 | OO_THREAD_INDEX_OPEN, 25 | OO_THREAD_INDEX_EXPORT, 26 | OO_THREAD_INDEX_COUNT 27 | } 28 | OO_THREAD_INDEX_T; 29 | 30 | class OTDocStreamerOpenOffice : public OTDocStreamer 31 | { 32 | public: 33 | OTDocStreamerOpenOffice(OTObjectWrapper oBridgeInfo, const OTDocStreamerCallback* pcCallback = NULL); 34 | virtual ~OTDocStreamerOpenOffice(); 35 | virtual OT_INLINE const char* getObjectId() { return "OTDocStreamerOpenOffice"; } 36 | 37 | // @Overrides (OTDocStreamer) 38 | virtual bool isValid(); 39 | virtual bool open(std::string strDocPath); 40 | virtual bool close(); 41 | virtual size_t getPagesCount(); 42 | virtual size_t getPageIndex(); 43 | virtual bool exportPage(size_t nPageIndex); 44 | virtual bool getCurrentFrame(size_t* pnPageIndex, const void** ppcPtr, size_t* pnWidth = NULL, size_t* pnHeight = NULL); 45 | 46 | static std::string buildCommandArgs(unsigned short nLocalPort); 47 | static std::string buildConnectionString(unsigned short nLocalPort); 48 | 49 | private: 50 | bool _decode(); 51 | bool _close(); 52 | static void* TSK_STDCALL threadOpen(void *pArg); 53 | static void* TSK_STDCALL threadExport(void *pArg); 54 | 55 | private: 56 | std::string m_strInFilePath; 57 | rtl::OUString m_strInFileUrl; 58 | bool m_bValid; 59 | int32_t m_nPageIndex; 60 | size_t m_nPagesCount; 61 | void* m_ppThreads[OO_THREAD_INDEX_COUNT]; 62 | OTObjectWrapperm_oMutex; 63 | std::string m_strJpegFilePath; 64 | rtl::OUString m_strJpegFileUrl; 65 | void* m_pYuvBufferPtr; 66 | size_t m_nYuvBufferSize; 67 | size_t m_nYuvBufferWidth; 68 | size_t m_nYuvBufferHeight; 69 | bool m_bYuvBufferGotPict; 70 | 71 | com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPagesSupplier > m_xDrawPagesSupplier; 72 | com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPages > m_xDrawPages; 73 | com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage > m_xDrawPage; 74 | com::sun::star::uno::Reference< com::sun::star::document::XExporter > m_xExporter; 75 | com::sun::star::uno::Reference< com::sun::star::document::XFilter > m_xFilter; 76 | com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xComponent; 77 | com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > m_xseqPropFilter; 78 | }; 79 | 80 | #endif /* HAVE_OPENOFFICE */ 81 | 82 | #endif /* OPENTELEPRESENCE_DOC_STREAMER_OPENOFFICE_H */ 83 | -------------------------------------------------------------------------------- /include/opentelepresence/filters/OTFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_FILTER_H 8 | #define OPENTELEPRESENCE_FILTER_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | #include "opentelepresence/OTCommon.h" 13 | 14 | #include 15 | 16 | class OTFilter : public OTObject 17 | { 18 | protected: 19 | OTFilter(OTMediaType_t eMediaType, std::string strDescription); 20 | public: 21 | virtual ~OTFilter(); 22 | virtual OT_INLINE const char* getObjectId() { return "OTFilter"; } 23 | 24 | virtual bool isValid() = 0; 25 | 26 | protected: 27 | OTMediaType_t m_eMediaType; 28 | std::string m_strDescription; 29 | }; 30 | 31 | 32 | class OTFilterVideo : public OTFilter 33 | { 34 | protected: 35 | OTFilterVideo(std::string strDescription, size_t nInWidth, size_t nInHeight, size_t nOutWidth, size_t nOutHeight, size_t nFps); 36 | public: 37 | virtual ~OTFilterVideo(); 38 | virtual OT_INLINE const char* getObjectId() { return "OTFilterVideo"; } 39 | 40 | virtual bool filterFrame( 41 | const void* pcInBufferPtr, size_t nInBufferSize, size_t nInWidth, size_t nInHeight, size_t nOutWidth, size_t nOutHeight, 42 | void* pOutFrame 43 | ) = 0; 44 | 45 | public: 46 | static OTObjectWrapper New( 47 | std::string strDescription, 48 | size_t nInWidth, size_t nInHeight, 49 | size_t nOutWidth, size_t nOutHeight, 50 | size_t nFps = OPENTELEPRESENCE_VIDEO_FPS_DEFAULT); 51 | }; 52 | 53 | #endif /* OPENTELEPRESENCE_FILTER_H */ 54 | -------------------------------------------------------------------------------- /include/opentelepresence/filters/OTOverlay.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_FILTER_OVERLAY_H 8 | #define OPENTELEPRESENCE_FILTER_OVERLAY_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | #include "opentelepresence/OTCommon.h" 13 | #include "opentelepresence/filters/OTFilter.h" 14 | 15 | #include 16 | 17 | class OTOverlayVideoWatermark : public OTObject 18 | { 19 | protected: 20 | OTOverlayVideoWatermark(size_t nInWidth, size_t nInHeight, size_t nOutWidth, size_t nOutHeight, std::string strImagePath); 21 | public: 22 | virtual ~OTOverlayVideoWatermark(); 23 | virtual OT_INLINE const char* getObjectId() { return "OTOverlayVideoWatermark"; } 24 | 25 | virtual bool draw( 26 | const void* pcInBufferPtr, size_t nInBufferSize, size_t nInWidth, size_t nInHeight, size_t nOutWidth, size_t nOutHeight, 27 | void* pOutFrame 28 | ); 29 | 30 | static OTObjectWrapper New(size_t nInWidth, size_t nInHeight, size_t nOutWidth, size_t nOutHeight, std::string strImagePath); 31 | 32 | private: 33 | size_t m_nInWidth, m_nInHeight, m_nOutWidth, m_nOutHeight; 34 | OTObjectWrapper m_oFilter; 35 | std::string m_strImagePath; 36 | bool m_bTriedToCreateFilter; 37 | }; 38 | 39 | class OTOverlayVideoText : public OTObject 40 | { 41 | protected: 42 | OTOverlayVideoText(size_t nInWidth, size_t nInHeight, size_t nOutWidth, size_t nOutHeight, std::string strDisplayName, std::string strJobTitle, std::string strCopyright, size_t nNameFontSize, size_t nCopyrightFontSize); 43 | public: 44 | virtual ~OTOverlayVideoText(); 45 | virtual OT_INLINE const char* getObjectId() { return "OTOverlayVideoText"; } 46 | 47 | virtual OT_INLINE void setFontsFolderPath(std::string strPath) { m_strFontsFolderPath = strPath; } 48 | virtual OT_INLINE void setCopyrightFontFileName(std::string strPath){ m_strCopyrightFontFileName = strPath; } 49 | virtual OT_INLINE void setSpeakerNameFontFileName(std::string strPath){ m_strSpeakerNameFontFileName = strPath; } 50 | 51 | virtual bool isValid(); 52 | virtual bool draw( 53 | const void* pcInBufferPtr, size_t nInBufferSize, size_t nInWidth, size_t nInHeight, size_t nOutWidth, size_t nOutHeight, 54 | void* pOutFrame 55 | ); 56 | 57 | static OTObjectWrapper New( 58 | size_t nInWidth, size_t nInHeight, 59 | size_t nOutWidth, size_t nOutHeight, 60 | std::string strDisplayName, 61 | std::string strJobTitle, 62 | std::string strCopyright = OPENTELEPRESENCE_VIDEO_OVERLAY_TEXT_COPYRIGTH, 63 | size_t nNameFontSize = OPENTELEPRESENCE_VIDEO_OVERLAY_FONTSIZE_COPYRIGTH, 64 | size_t nCopyrightFontSize = OPENTELEPRESENCE_VIDEO_OVERLAY_FONTSIZE_NAME 65 | ); 66 | 67 | private: 68 | bool _updateFilter( 69 | size_t nInWidth, size_t nInHeight, 70 | size_t nOutWidth, size_t nOutHeight, 71 | size_t nFps = OPENTELEPRESENCE_VIDEO_FPS_DEFAULT); 72 | 73 | protected: 74 | size_t m_nInWidth, m_nInHeight, m_nOutWidth, m_nOutHeight; 75 | std::string m_strDisplayNameText; 76 | std::string m_strJobTitleText; 77 | std::string m_strFontsFolderPath; 78 | std::string m_strCopyrightText; 79 | std::string m_strCopyrightFontFileName; 80 | std::string m_strSpeakerNameFontFileName; 81 | size_t m_nCopyrightFontSize; 82 | size_t m_nSpeakerNameFontSize; 83 | 84 | OTObjectWrapper m_oFilter; 85 | }; 86 | 87 | #endif /* OPENTELEPRESENCE_FILTER_OVERLAY_H */ 88 | -------------------------------------------------------------------------------- /include/opentelepresence/mixers/OTMixer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_MIXER_H 8 | #define OPENTELEPRESENCE_MIXER_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | #include "opentelepresence/OTObject.h" 13 | #include "opentelepresence/OTBridgeInfo.h" 14 | 15 | class OTMixer : public OTObject 16 | { 17 | protected: 18 | OTMixer(OTMediaType_t eMediaType, OTObjectWrapper oBridgeInfo); 19 | public: 20 | virtual ~OTMixer(); 21 | virtual OT_INLINE const char* getObjectId() { return "OTMixer"; } 22 | 23 | virtual int reset() = 0; 24 | virtual bool isValid() = 0; 25 | virtual bool releaseConsumerInternals(uint64_t nConsumerId) { return true; }; 26 | 27 | virtual OT_INLINE OTMediaType_t getMediaType() { return m_eMediaType; } 28 | virtual OT_INLINE OTDimension_t getDimension() 29 | { 30 | switch(getMediaType()) 31 | { 32 | case OTMediaType_Audio: return m_oBridgeInfo->getAudioDimension(); 33 | case OTMediaType_Video: return m_oBridgeInfo->getVideoDimension(); 34 | default: return OTDimension_2D; 35 | } 36 | 37 | } 38 | 39 | static OTObjectWrapper New(OTMediaType_t eMediaType, OTObjectWrapper oBridgeInfo); 40 | 41 | protected: 42 | OTObjectWrapper m_oBridgeInfo; 43 | OTMediaType_t m_eMediaType; 44 | }; 45 | 46 | #endif /* OPENTELEPRESENCE_MIXER_H */ 47 | 48 | -------------------------------------------------------------------------------- /include/opentelepresence/mixers/OTMixerAudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_MIXERAUDIO_H 8 | #define OPENTELEPRESENCE_MIXERAUDIO_H 9 | 10 | #include "opentelepresence/mixers/OTMixer.h" 11 | #include "opentelepresence/OTFrameAudio.h" 12 | #include "opentelepresence/OTProxyPluginConsumerAudio.h" 13 | 14 | #include 15 | 16 | class OTMixerAudio : public OTMixer 17 | { 18 | protected: 19 | OTMixerAudio(OTObjectWrapper oBridgeInfo); 20 | public: 21 | virtual ~OTMixerAudio(); 22 | virtual OT_INLINE const char* getObjectId() { return "OTMixerAudio"; } 23 | virtual OTObjectWrapper mix(std::map >*, uint64_t nConsumerToIgnore = 0) = 0; 24 | 25 | static OTObjectWrapper New(OTObjectWrapper oBridgeInfo); 26 | }; 27 | 28 | #endif /* OPENTELEPRESENCE_MIXERAUDIO_H */ 29 | -------------------------------------------------------------------------------- /include/opentelepresence/mixers/OTMixerAudio2D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_MIXERAUDIO2D_H 8 | #define OPENTELEPRESENCE_MIXERAUDIO2D_H 9 | 10 | #include "opentelepresence/mixers/OTMixerAudio.h" 11 | 12 | class OTMixerAudio2D : public OTMixerAudio 13 | { 14 | protected: 15 | OTMixerAudio2D(OTObjectWrapper oBridgeInfo); 16 | public: 17 | virtual ~OTMixerAudio2D(); 18 | virtual OT_INLINE const char* getObjectId() { return "OTMixerAudio2D"; } 19 | 20 | virtual int reset(); 21 | virtual bool isValid(); 22 | virtual OTObjectWrapper mix(std::map >*, uint64_t nConsumerToIgnore = 0); 23 | 24 | static OTObjectWrapper New(OTObjectWrapper oBridgeInfo); 25 | 26 | private: 27 | void* m_pTempBuffer; 28 | size_t m_nTempBufferSize; 29 | bool m_bValid; 30 | OTObjectWrapper m_oFrame; 31 | }; 32 | 33 | #endif /* OPENTELEPRESENCE_MIXERAUDIO2D_H */ 34 | -------------------------------------------------------------------------------- /include/opentelepresence/mixers/OTMixerAudio3D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_MIXERAUDIO3D_H 8 | #define OPENTELEPRESENCE_MIXERAUDIO3D_H 9 | 10 | #include "opentelepresence/mixers/OTMixerAudio.h" 11 | 12 | class OTMixerAudio3D : public OTMixerAudio 13 | { 14 | protected: 15 | OTMixerAudio3D(OTObjectWrapper oBridgeInfo); 16 | public: 17 | virtual ~OTMixerAudio3D(); 18 | virtual OT_INLINE const char* getObjectId() { return "OTMixerAudio3D"; } 19 | 20 | virtual int reset(); 21 | virtual bool isValid(); 22 | virtual OTObjectWrapper mix(std::map >*, uint64_t nConsumerToIgnore = 0) = 0; 23 | 24 | static OTObjectWrapper New(OTObjectWrapper oBridgeInfo); 25 | 26 | private: 27 | bool m_bValid; 28 | }; 29 | 30 | #endif /* OPENTELEPRESENCE_MIXERAUDIO3D_H */ 31 | -------------------------------------------------------------------------------- /include/opentelepresence/mixers/OTMixerVideo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_MIXERVIDEO_H 8 | #define OPENTELEPRESENCE_MIXERVIDEO_H 9 | 10 | #include "opentelepresence/mixers/OTMixer.h" 11 | #include "opentelepresence/OTFrameVideo.h" 12 | #include "opentelepresence/patterns/OTPatternVideo.h" 13 | #include "opentelepresence/OTProxyPluginConsumerVideo.h" 14 | 15 | #include 16 | 17 | class OTMixerVideo : public OTMixer 18 | { 19 | protected: 20 | OTMixerVideo(OTObjectWrapper oBridgeInfo); 21 | public: 22 | virtual ~OTMixerVideo(); 23 | virtual OT_INLINE const char* getObjectId() { return "OTMixerVideo"; } 24 | virtual OTObjectWrapper mix(std::map >*, void** ppDstBuffer, uint32_t* pDstBufferSize) = 0; 25 | 26 | static OTObjectWrapper New(OTObjectWrapper oBridgeInfo); 27 | 28 | protected: 29 | OTObjectWrapper m_pOTPatternVideo; 30 | }; 31 | 32 | #endif /* OPENTELEPRESENCE_MIXERVIDEO_H */ 33 | -------------------------------------------------------------------------------- /include/opentelepresence/mixers/OTMixerVideo2D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_MIXERVIDEO2D_H 8 | #define OPENTELEPRESENCE_MIXERVIDEO2D_H 9 | 10 | #include "opentelepresence/mixers/OTMixerVideo.h" 11 | #include "opentelepresence/patterns/OTPatternVideo.h" 12 | 13 | class OTMixerVideo2D : public OTMixerVideo 14 | { 15 | protected: 16 | OTMixerVideo2D(OTObjectWrapper oBridgeInfo); 17 | public: 18 | virtual ~OTMixerVideo2D(); 19 | virtual OT_INLINE const char* getObjectId() { return "OTMixerVideo2D"; } 20 | 21 | virtual int reset(); 22 | virtual bool isValid(); 23 | virtual OTObjectWrapper mix(std::map >*, void** ppDstBuffer, uint32_t* pDstBufferSize); 24 | 25 | static OTObjectWrapper New(OTObjectWrapper oBridgeInfo); 26 | 27 | private: 28 | bool m_bValid; 29 | int32_t m_nPatterPosition; 30 | OTObjectWrapperm_pOTPatternVideo; 31 | }; 32 | 33 | #endif /* OPENTELEPRESENCE_MIXERVIDEO2D_H */ 34 | -------------------------------------------------------------------------------- /include/opentelepresence/mixers/OTMixerVideo3D.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_MIXERVIDEO3D_H 8 | #define OPENTELEPRESENCE_MIXERVIDEO3D_H 9 | 10 | #include "opentelepresence/mixers/OTMixerVideo.h" 11 | 12 | class OTMixerVideo3D : public OTMixerVideo 13 | { 14 | protected: 15 | OTMixerVideo3D(OTObjectWrapper oBridgeInfo); 16 | public: 17 | virtual ~OTMixerVideo3D(); 18 | virtual OT_INLINE const char* getObjectId() { return "OTMixerVideo3D"; } 19 | 20 | virtual int reset(); 21 | virtual bool isValid(); 22 | virtual OTObjectWrapper mix(std::map >*, void** ppDstBuffer, uint32_t* pDstBufferSize); 23 | 24 | static OTObjectWrapper New(OTObjectWrapper oBridgeInfo); 25 | 26 | private: 27 | bool m_bValid; 28 | }; 29 | 30 | #endif /* OPENTELEPRESENCE_MIXERVIDEO3D_H */ 31 | -------------------------------------------------------------------------------- /include/opentelepresence/patterns/OTPattern.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PATTERN_H 8 | #define OPENTELEPRESENCE_PATTERN_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | #include "opentelepresence/OTCommon.h" 13 | #include "opentelepresence/OTBridgeInfo.h" 14 | 15 | class OTPattern : public OTObject 16 | { 17 | protected: 18 | OTPattern(OTPatternType_t eType, OTObjectWrapper oBridgeInfo); 19 | public: 20 | virtual ~OTPattern(); 21 | virtual OT_INLINE const char* getObjectId() { return "OTPattern"; } 22 | 23 | virtual OT_INLINE OTPatternType_t getType() { return m_eType; } 24 | 25 | protected: 26 | OTPatternType_t m_eType; 27 | OTObjectWrapper m_oBridgeInfo; 28 | }; 29 | 30 | #endif /* OPENTELEPRESENCE_PATTERN_H */ 31 | -------------------------------------------------------------------------------- /include/opentelepresence/patterns/OTPatternVideo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PATTERNVIDEO_H 8 | #define OPENTELEPRESENCE_PATTERNVIDEO_H 9 | 10 | #include "opentelepresence/patterns/OTPattern.h" 11 | #include "opentelepresence/OTProxyPluginConsumerVideo.h" 12 | #include "opentelepresence/OTFrameVideo.h" 13 | 14 | #include 15 | 16 | class OTPatternVideo : public OTPattern 17 | { 18 | protected: 19 | OTPatternVideo(OTPatternType_t eType, OTObjectWrapper oBridgeInfo); 20 | public: 21 | virtual ~OTPatternVideo(); 22 | virtual OT_INLINE const char* getObjectId() { return "OTPatternVideo"; } 23 | 24 | virtual OTObjectWrapper mix(std::map >*, void** pDstBuffer, uint32_t *pDstBufferSize)=0; 25 | 26 | protected: 27 | OTObjectWrapper m_oLastMixedFrameResult; 28 | }; 29 | 30 | #endif /* OPENTELEPRESENCE_PATTERNVIDEO_H */ 31 | -------------------------------------------------------------------------------- /include/opentelepresence/patterns/OTPatternVideoHangout.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PATTERNVIDEO_HANGOUT_H 8 | #define OPENTELEPRESENCE_PATTERNVIDEO_HANGOUT_H 9 | 10 | #include "opentelepresence/patterns/OTPatternVideo.h" 11 | #include "opentelepresence/OTBridge.h" 12 | 13 | class OTPatternVideoHangout : public OTPatternVideo 14 | { 15 | protected: 16 | OTPatternVideoHangout(OTObjectWrapper oBridgeInfo); 17 | public: 18 | virtual ~OTPatternVideoHangout(); 19 | virtual OT_INLINE const char* getObjectId() { return "OTPatternVideoHangout"; } 20 | 21 | // Override from OTPatternVideo 22 | virtual OTObjectWrapper mix(std::map > *pOTConsumers, void** pDstBuffer, uint32_t *pDstBufferSize); 23 | 24 | static OTObjectWrapper New(OTObjectWrapper oBridgeInfo); 25 | 26 | private: 27 | struct AVFrame *m_pFrameMix; 28 | OTRatio_t m_parSpeaker; 29 | OTRatio_t m_parListener; 30 | }; 31 | 32 | #endif /* OPENTELEPRESENCE_PATTERNVIDEO_HANGOUT_H */ 33 | -------------------------------------------------------------------------------- /include/opentelepresence/patterns/OTPatternVideoWebEx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PATTERNVIDEO_WEBEX_H 8 | #define OPENTELEPRESENCE_PATTERNVIDEO_WEBEX_H 9 | 10 | #include "opentelepresence/patterns/OTPatternVideo.h" 11 | 12 | class OTPatternVideoWebEx : public OTPatternVideo 13 | { 14 | protected: 15 | OTPatternVideoWebEx(OTObjectWrapper oBridgeInfo); 16 | public: 17 | virtual ~OTPatternVideoWebEx(); 18 | virtual OT_INLINE const char* getObjectId() { return "OTPatternVideoWebEx"; } 19 | 20 | // Override from OTPatternVideo 21 | virtual OTObjectWrapper mix(std::map >* pOTConsumers, void** pDstBuffer, uint32_t *pDstBufferSize); 22 | 23 | }; 24 | 25 | #endif /* OPENTELEPRESENCE_PATTERNVIDEO_WEBEX_H */ 26 | -------------------------------------------------------------------------------- /include/opentelepresence/platforms/generic/OTEngineGen.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_ENGINE_GEN_H 8 | #define OPENTELEPRESENCE_ENGINE_GEN_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | #include "opentelepresence/OTEngine.h" 13 | 14 | class OTEngineGen : public OTEngine 15 | { 16 | public: 17 | OTEngineGen(); 18 | virtual ~OTEngineGen(); 19 | virtual OT_INLINE const char* GetObjectId() { return "OTEngineGen"; } 20 | 21 | public: 22 | virtual bool start(); 23 | virtual bool stop(); 24 | 25 | protected: 26 | virtual bool isValid(); 27 | }; 28 | 29 | 30 | #endif /* OPENTELEPRESENCE_ENGINE_GEN_H */ 31 | -------------------------------------------------------------------------------- /include/opentelepresence/platforms/osx/OTEngineOSX.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_ENGINEOSX_H 8 | #define OPENTELEPRESENCE_ENGINEOSX_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | #if OPENTELEPRESENCE_UNDER_OSX 13 | 14 | #include "opentelepresence/OTEngine.h" 15 | 16 | class OTEngineOSX : public OTEngine 17 | { 18 | public: 19 | OTEngineOSX(); 20 | virtual ~OTEngineOSX(); 21 | virtual OT_INLINE const char* getObjectId() { return "OTEngineOSX"; } 22 | 23 | public: 24 | virtual bool start(); 25 | virtual bool stop(); 26 | 27 | protected: 28 | virtual bool isValid(); 29 | }; 30 | 31 | #endif /* OPENTELEPRESENCE_UNDER_OSX */ 32 | 33 | 34 | #endif /* OPENTELEPRESENCE_ENGINEOSX_H */ 35 | -------------------------------------------------------------------------------- /include/opentelepresence/platforms/win32/OTEngineWin32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_ENGINEWIN32_H 8 | #define OPENTELEPRESENCE_ENGINEWIN32_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | #if OPENTELEPRESENCE_UNDER_WINDOWS 13 | 14 | #include "opentelepresence/OTEngine.h" 15 | 16 | class OTEngineWin32 : public OTEngine 17 | { 18 | public: 19 | OTEngineWin32(); 20 | virtual ~OTEngineWin32(); 21 | virtual OT_INLINE const char* getObjectId() { return "OTEngineWin32"; } 22 | 23 | public: 24 | virtual bool start(); 25 | virtual bool stop(); 26 | 27 | protected: 28 | virtual bool isValid(); 29 | 30 | private: 31 | static int initialize(); 32 | static int deInitialize(); 33 | 34 | static ULONG_PTR g_pGdiplusToken; 35 | static bool g_bInitialized; 36 | 37 | bool m_bValid; 38 | }; 39 | 40 | #endif /* OPENTELEPRESENCE_UNDER_WINDOWS */ 41 | 42 | 43 | #endif /* OPENTELEPRESENCE_ENGINEWIN32_H */ 44 | -------------------------------------------------------------------------------- /include/opentelepresence/presence/OTPresenceNotifer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PRESENCENOTIFIER_H 8 | #define OPENTELEPRESENCE_PRESENCENOTIFIER_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | 13 | class OTPresenceNotifer : public OTObject 14 | { 15 | protected: 16 | OTPresenceNotifer(); 17 | public: 18 | virtual ~OTPresenceNotifer(); 19 | virtual OT_INLINE const char* getObjectId() { return "OTPresenceNotifer"; } 20 | }; 21 | 22 | #endif /* OPENTELEPRESENCE_PRESENCENOTIFIER_H */ 23 | -------------------------------------------------------------------------------- /include/opentelepresence/presence/OTPresenceParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_PRESENCEPARSER_H 8 | #define OPENTELEPRESENCE_PRESENCEPARSER_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | 13 | class OTPresenceParser : public OTObject 14 | { 15 | protected: 16 | OTPresenceParser(); 17 | public: 18 | virtual ~OTPresenceParser(); 19 | virtual OT_INLINE const char* getObjectId() { return "OTPresenceParser"; } 20 | }; 21 | 22 | #endif /* OPENTELEPRESENCE_PRESENCEPARSER_H */ 23 | -------------------------------------------------------------------------------- /include/opentelepresence/recorder/OTRecorder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_RECODER_H 8 | #define OPENTELEPRESENCE_RECODER_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | #include "opentelepresence/OTObject.h" 12 | #include "opentelepresence/OTCommon.h" 13 | #include "opentelepresence/recorder/OTWebM.h" 14 | 15 | #include 16 | 17 | class OTRecorder : public OTObject 18 | { 19 | protected: 20 | OTRecorder(std::string strFilePath, OTMediaType_t eMediaType); 21 | public: 22 | virtual ~OTRecorder(); 23 | virtual OT_INLINE const char* getObjectId() { return "OTRecorder"; } 24 | 25 | virtual bool setVideoParams(uint32_t nVideoWidth, uint32_t nVideoHeight, uint32_t nMotionRank, uint32_t nGopSizeInSec, uint32_t nFps) = 0; 26 | virtual bool setAudioParams(uint32_t nPtime, uint32_t nRate, uint32_t nChannels) = 0; 27 | virtual bool open(OTMediaType_t eMediaType) = 0; 28 | virtual bool writeRtpVideoPayload(const void* rtpPayPtr, size_t rtpPaySize) = 0; 29 | virtual bool writeRtpAudioPayload(const void* rtpPayPtr, size_t rtpPaySize) = 0; 30 | virtual bool writeRawVideoPayload(const void* rtpPayPtr, size_t rtpPaySize) = 0; 31 | virtual bool writeRawAudioPayload(const void* rtpPayPtr, size_t rtpPaySize) = 0; 32 | virtual bool close(OTMediaType_t eMediaType) = 0; 33 | 34 | static OTObjectWrapper New(std::string strFilePath, OTMediaType_t eMediaType); 35 | 36 | protected: 37 | std::string m_strFilePath; 38 | OTMediaType_t m_eMediaType; 39 | }; 40 | 41 | #endif /* OPENTELEPRESENCE_RECODER_H */ 42 | -------------------------------------------------------------------------------- /include/opentelepresence/recorder/OTWebM.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #ifndef OPENTELEPRESENCE_RECODER_WEBM_H 8 | #define OPENTELEPRESENCE_RECODER_WEBM_H 9 | 10 | #include "OpenTelepresenceConfig.h" 11 | 12 | /* Stereo 3D packed frame format */ 13 | typedef enum stereo_format 14 | { 15 | STEREO_FORMAT_MONO = 0, 16 | STEREO_FORMAT_LEFT_RIGHT = 1, 17 | STEREO_FORMAT_BOTTOM_TOP = 2, 18 | STEREO_FORMAT_TOP_BOTTOM = 3, 19 | STEREO_FORMAT_RIGHT_LEFT = 11 20 | } stereo_format_t; 21 | 22 | typedef struct EbmlRational 23 | { 24 | int num; /**< fraction numerator */ 25 | int den; /**< fraction denominator */ 26 | } 27 | EbmlRational; 28 | 29 | #endif /* OPENTELEPRESENCE_RECODER_H */ 30 | -------------------------------------------------------------------------------- /ragel/ragel.sh: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2013 Doubango Telecom . 2 | # License: GPLv3 or proprietary (consult us) 3 | 4 | # Ragel generator 5 | # For more information about Ragel: http://www.complang.org/ragel/ 6 | 7 | export OPTIONS="-C -L -T0" 8 | 9 | 10 | ragel.exe $OPTIONS -o ../source/cfg/OTCfgParser.cc cfg.rl -------------------------------------------------------------------------------- /self-signed-certs.sh: -------------------------------------------------------------------------------- 1 | # Uncomment next line to create "privkey.pem" and "SSL_CA.pem" files 2 | openssl req -days 3650 -out SSL_CA.pem -new -x509 3 | # Save privkey.pem and SSL_CA.pem 4 | 5 | # General Public and private files 6 | openssl genrsa -out SSL_Priv.pem 1024 7 | openssl req -key SSL_Priv.pem -new -out ./cert.req 8 | echo 00 > file.srl 9 | openssl x509 -req -days 3650 -in cert.req -CA SSL_CA.pem -CAkey privkey.pem -CAserial file.srl -out SSL_Pub.pem 10 | 11 | # To convert to DER 12 | #openssl x509 -outform der -in SSL_CA.pem -out SSL_CA.der 13 | #openssl x509 -outform der -in SSL_Pub.pem -out SSL_Pub.der 14 | -------------------------------------------------------------------------------- /source/OTBridgeInfo.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/OTBridgeInfo.h" 8 | #include "opentelepresence/OTEngine.h" 9 | #include "opentelepresence/OTBridge.h" 10 | 11 | #include "tsk_debug.h" 12 | 13 | OTBridgeInfo::OTBridgeInfo(std::string strId, OTObjectWrapper oEngineInfo) 14 | : m_uEngineId(oEngineInfo->getId()) 15 | , m_strBridgeId(strId) 16 | , m_nSpeakerSipSessionId(0) 17 | , m_bRecord(oEngineInfo->m_bRecordEnabled) 18 | , m_strRecordFileExt(oEngineInfo->m_strRecordFileExt) 19 | , m_nVideoWidth(oEngineInfo->m_nMixedVideoWidth) 20 | , m_nVideoHeight(oEngineInfo->m_nMixedVideoHeight) 21 | , m_parSpeaker(oEngineInfo->m_parSpeaker) 22 | , m_parListener(oEngineInfo->m_parListener) 23 | , m_nVideoFps(oEngineInfo->m_nVideoFps) 24 | , m_nVideoGopSizeInSec(OPENTELEPRESENCE_VIDEO_GOP_SIZE_DEFAULT) 25 | , m_nVideoMotionRank(oEngineInfo->m_nVideoMotionRank) 26 | , m_eVideoDim(OPENTELEPRESENCE_VIDEO_MIXER_DIM) 27 | 28 | , m_nAudioChannels(oEngineInfo->m_nAudioChannels) 29 | , m_nAudioBitsPerSample(oEngineInfo->m_nAudioBitsPerSample) 30 | , m_nAudioSampleRate(oEngineInfo->m_nAudioSampleRate) 31 | , m_nAudioPtime(oEngineInfo->m_nAudioPtime) 32 | , m_nAudioMaxLatency(oEngineInfo->m_nAudioMaxLatency) 33 | , m_fAudioVolume(oEngineInfo->m_fAudioVolume) 34 | , m_eAudioDim(oEngineInfo->m_eAudioDim) 35 | , m_bAudioLoopback(oEngineInfo->m_bAudioLoopback) 36 | 37 | , m_bPresentationSharingEnabled(oEngineInfo->m_bPresentationSharingEnabled) 38 | , m_strPresentationSharingBaseFolder(oEngineInfo->m_strPresentationSharingBaseFolder) 39 | , m_nPresentationSharingLocalPort(oEngineInfo->m_nPresentationSharingLocalPort) 40 | , m_strPresentationSharingAppPath(oEngineInfo->m_strPresentationSharingAppPath) 41 | 42 | , m_strOverlayFontsFolderPath(oEngineInfo->m_strOverlayFontsFolderPath) 43 | , m_strOverlayCopyrightText(oEngineInfo->m_strOverlayCopyrightText) 44 | , m_strOverlayWatermarkImagePath(oEngineInfo->m_strOverlayWatermarkImagePath) 45 | , m_strOverlayCopyrightFontFileName(oEngineInfo->m_strOverlayCopyrightFontFileName) 46 | , m_strOverlaySpeakerNameFontFileName(oEngineInfo->m_strOverlaySpeakerNameFontFileName) 47 | , m_nOverlayCopyrightFontSize(oEngineInfo->m_nOverlayCopyrightFontSize) 48 | , m_nOverlaySpeakerNameFontSize(oEngineInfo->m_nOverlaySpeakerNameFontSize) 49 | , m_bOverlayDisplaySpeakerName(oEngineInfo->m_bOverlayDisplaySpeakerName) 50 | , m_bOverlayDisplaySpeakerJobTitle(oEngineInfo->m_bOverlayDisplaySpeakerJobTitle) 51 | { 52 | 53 | } 54 | 55 | OTBridgeInfo::~OTBridgeInfo() 56 | { 57 | OT_DEBUG_INFO("*** OTBridgeInfo destroyed ***"); 58 | } 59 | 60 | OTObjectWrapper OTBridgeInfo::getBridge() 61 | { 62 | OTObjectWrapper oEngine = OTEngine::getEngine(m_uEngineId); 63 | if(oEngine) 64 | { 65 | return oEngine->getBridge(m_strBridgeId); 66 | } 67 | return NULL; 68 | } 69 | -------------------------------------------------------------------------------- /source/OTCodecAudio.cc: -------------------------------------------------------------------------------- 1 | #include "opentelepresence/OTCodecAudio.h" -------------------------------------------------------------------------------- /source/OTCodecVideo.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/OTCodecVideo.h" -------------------------------------------------------------------------------- /source/OTFrameAudio.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/OTFrameAudio.h" 8 | 9 | OTFrameAudio::OTFrameAudio(bool bOwnBuffer, const void *pBufferPtr, uint32_t nBufferSize) 10 | : OTFrame(OTMediaType_Audio, bOwnBuffer, pBufferPtr, nBufferSize) 11 | , m_fVolume(OPENTELEPRESENCE_AUDIO_MIXER_VOL) 12 | , m_nBitsPerSample(OPENTELEPRESENCE_AUDIO_BITS_PER_SAMPLE_DEFAULT) 13 | , m_nChannels(OPENTELEPRESENCE_AUDIO_CHANNELS_DEFAULT) 14 | , m_nSampleRate(OPENTELEPRESENCE_AUDIO_RATE_DEFAULT) 15 | { 16 | 17 | } 18 | 19 | OTFrameAudio::~OTFrameAudio() 20 | { 21 | 22 | } 23 | 24 | OTObjectWrapper OTFrameAudio::New(bool bOwnBuffer, const void *pBufferPtr, uint32_t nBufferSize) 25 | { 26 | return new OTFrameAudio(bOwnBuffer, pBufferPtr, nBufferSize); 27 | } 28 | -------------------------------------------------------------------------------- /source/OTFrameVideo.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/OTFrameVideo.h" 8 | 9 | #include 10 | 11 | OTFrameVideo::OTFrameVideo(bool bOwnBuffer, const void *pBufferPtr, uint32_t nBufferSize) 12 | :OTFrame(OTMediaType_Video, bOwnBuffer, pBufferPtr, nBufferSize) 13 | { 14 | m_nWidth = 0; 15 | m_nHeight = 0; 16 | } 17 | 18 | OTFrameVideo::~OTFrameVideo() 19 | { 20 | 21 | } 22 | 23 | 24 | OTObjectWrapper OTFrameVideo::New(bool bOwnBuffer, const void *pBufferPtr, uint32_t nBufferSize) 25 | { 26 | return new OTFrameVideo(bOwnBuffer, pBufferPtr, nBufferSize); 27 | } 28 | -------------------------------------------------------------------------------- /source/OTMixerMgr.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/OTMixerMgr.h" 8 | #include "opentelepresence/OTMixerMgrAudio.h" 9 | #include "opentelepresence/OTMixerMgrVideo.h" 10 | 11 | #include "tsk_debug.h" 12 | 13 | #include 14 | 15 | OTMixerMgr::OTMixerMgr(OTMediaType_t eMediaType, OTObjectWrapper oBridgeInfo) 16 | :OTObject() 17 | { 18 | m_eMediaType = eMediaType; 19 | m_oBridgeInfo = oBridgeInfo; 20 | } 21 | 22 | OTMixerMgr::~OTMixerMgr() 23 | { 24 | // FIXME: loop and release()? 25 | m_OTCodecs.clear(); 26 | } 27 | 28 | /** 29 | Finds the best codec to use. 30 | /!\Function not thread safe 31 | @param listOfCodecsToSearchInto List of codecs combined using binary OR (|). 32 | @return The best codec if exist, otherwise NULL 33 | */ 34 | OTObjectWrapper OTMixerMgr::findBestCodec(OTCodec_Type_t eListOfCodecsToSearchInto) 35 | { 36 | std::map >::iterator iter = m_OTCodecs.begin(); 37 | while(iter != m_OTCodecs.end()) 38 | { 39 | if(((*iter).first & eListOfCodecsToSearchInto) == (*iter).first) 40 | { 41 | return (*iter).second; 42 | } 43 | ++iter; 44 | } 45 | return NULL; 46 | } 47 | 48 | /** 49 | Removes a list of codecs 50 | /!\Function not thread safe 51 | @param listOfCodecsToSearchInto List of codecs combined using binary OR (|). 52 | @return True if removed, False otherwise 53 | */ 54 | bool OTMixerMgr::removeCodecs(OTCodec_Type_t eListOfCodecsToSearchInto) 55 | { 56 | bool bFound = false; 57 | std::map >::iterator iter; 58 | 59 | again: 60 | iter = m_OTCodecs.begin(); 61 | while(iter != m_OTCodecs.end()) 62 | { 63 | if(((*iter).first & eListOfCodecsToSearchInto) == (*iter).first) 64 | { 65 | (*iter).second->releaseRef(); 66 | m_OTCodecs.erase(iter); 67 | bFound = true; 68 | goto again; 69 | } 70 | ++iter; 71 | } 72 | return bFound; 73 | } 74 | 75 | /** 76 | Adds a new codec to the list of supported codecs. 77 | /!\Function not thread safe 78 | @param oCodec The codec to add. Must not be NULL. 79 | @return True if codec successfully added, False otherwise 80 | */ 81 | bool OTMixerMgr::addCodec(OTObjectWrapper oCodec) 82 | { 83 | OT_ASSERT(*oCodec); 84 | 85 | std::map >::iterator iter = m_OTCodecs.find(oCodec->getType()); 86 | if(iter != m_OTCodecs.end()) 87 | { 88 | OT_DEBUG_ERROR("Codec with type = %d already exist", oCodec->getType()); 89 | return false; 90 | } 91 | m_OTCodecs.insert(std::pair >(oCodec->getType(), oCodec)); 92 | return true; 93 | } 94 | 95 | /** 96 | Executes action on all codecs. 97 | /!\Function not thread safe 98 | @return True if codec successfully added, False otherwise 99 | */ 100 | bool OTMixerMgr::executeActionOnCodecs(OTCodecAction_t eAction) 101 | { 102 | std::map >::iterator iter = m_OTCodecs.begin(); 103 | while(iter != m_OTCodecs.end()) 104 | { 105 | (*iter).second->executeAction(eAction); 106 | ++iter; 107 | } 108 | return true; 109 | } 110 | 111 | OTObjectWrapper OTMixerMgr::New(OTMediaType_t eMediaType, OTObjectWrapper oBridgeInfo) 112 | { 113 | OTObjectWrapper pOTMixer; 114 | 115 | switch(eMediaType) 116 | { 117 | case OTMediaType_Audio: 118 | { 119 | pOTMixer = new OTMixerMgrAudio(oBridgeInfo); 120 | break; 121 | } 122 | case OTMediaType_Video: 123 | { 124 | pOTMixer = new OTMixerMgrVideo(oBridgeInfo); 125 | break; 126 | } 127 | } 128 | 129 | if(pOTMixer && !pOTMixer->isValid()) 130 | { 131 | OTObjectSafeRelease(pOTMixer); 132 | } 133 | 134 | return pOTMixer; 135 | } -------------------------------------------------------------------------------- /source/OTMutex.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/OTMutex.h" 8 | 9 | OTMutex::OTMutex(bool bRecursive /*= true*/) 10 | { 11 | m_phOTMutex = tsk_mutex_create_2(bRecursive ? tsk_true : tsk_false); 12 | } 13 | 14 | OTMutex::~OTMutex() 15 | { 16 | if(m_phOTMutex) 17 | { 18 | tsk_mutex_destroy(&m_phOTMutex); 19 | } 20 | OT_DEBUG_INFO("*** OTMutex destroyed ***"); 21 | } 22 | 23 | bool OTMutex::lock() 24 | { 25 | return (tsk_mutex_lock(m_phOTMutex) == 0); 26 | } 27 | 28 | bool OTMutex::unlock() 29 | { 30 | return (tsk_mutex_unlock(m_phOTMutex) == 0); 31 | } 32 | -------------------------------------------------------------------------------- /source/OTObject.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/OTObject.h" 8 | /* Empty file used to make sure implementation in header will be built */ 9 | -------------------------------------------------------------------------------- /source/OTProxyPlugin.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/OTProxyPlugin.h" 8 | 9 | OTProxyPlugin::OTProxyPlugin(OTMediaType_t eMediaType, uint64_t nId, const ProxyPlugin* pcProxyPlugin) 10 | : OTObject() 11 | { 12 | m_eMediaType = eMediaType; 13 | m_nId = nId; 14 | m_pcProxyPlugin = pcProxyPlugin; 15 | m_bValid = true; 16 | m_bStarted = false; 17 | m_bPaused = false; 18 | m_phMutex = tsk_mutex_create_2(tsk_false); 19 | } 20 | 21 | 22 | OTProxyPlugin::~OTProxyPlugin() 23 | { 24 | m_pcProxyPlugin = NULL; 25 | tsk_mutex_destroy(&m_phMutex); 26 | 27 | OT_DEBUG_INFO("*** OTProxyPlugin destroyed ***"); 28 | } 29 | -------------------------------------------------------------------------------- /source/OTProxyPluginConsumer.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/OTProxyPluginConsumer.h" 8 | 9 | OTProxyPluginConsumer::OTProxyPluginConsumer(OTMediaType_t eMediaType, uint64_t nId, const ProxyPlugin* pcConsumer) 10 | : OTProxyPlugin(eMediaType, nId, dynamic_cast(pcConsumer)) 11 | { 12 | 13 | } 14 | 15 | OTProxyPluginConsumer::~OTProxyPluginConsumer() 16 | { 17 | OT_DEBUG_INFO("*** OTProxyPluginConsumer destroyed ***"); 18 | } -------------------------------------------------------------------------------- /source/OTProxyPluginProducer.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/OTProxyPluginProducer.h" 8 | 9 | #include "MediaSessionMgr.h" /* Codec */ 10 | 11 | OTProxyPluginProducer::OTProxyPluginProducer(OTMediaType_t eMediaType, uint64_t nId, const ProxyPlugin* pcProducer) 12 | : OTProxyPlugin(eMediaType, nId, dynamic_cast(pcProducer)) 13 | , m_pCodec(NULL) 14 | { 15 | 16 | } 17 | 18 | OTProxyPluginProducer::~OTProxyPluginProducer() 19 | { 20 | OT_DEBUG_INFO("*** OTProxyPluginProducer destroyed ***"); 21 | setCodec(NULL); 22 | } 23 | 24 | void OTProxyPluginProducer::setCodec(Codec* pcCodec) 25 | { 26 | if(m_pCodec) 27 | { 28 | delete m_pCodec; 29 | m_pCodec = NULL; 30 | } 31 | 32 | if(pcCodec) 33 | { 34 | m_pCodec = new Codec(pcCodec->getWrappedCodec()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /source/cfg/OTCfg.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/cfg/OTCfg.h" 8 | #include "opentelepresence/OTCommon.h" 9 | 10 | #include "tsk_string.h" 11 | #include "tsk_memory.h" 12 | #include "tsk_debug.h" 13 | 14 | #include 15 | 16 | 17 | // 18 | // OTCfg 19 | // 20 | OTCfg::OTCfg(OTCfgType_t eType) 21 | : m_eType(eType) 22 | { 23 | } 24 | 25 | OTCfg::~OTCfg() 26 | { 27 | } 28 | 29 | 30 | // 31 | // OTCfgSection 32 | // 33 | OTCfgSection::OTCfgSection(const char* pcName) 34 | : OTCfg(OTCfgType_Section) 35 | { 36 | OT_ASSERT(!tsk_strnullORempty(pcName)); 37 | m_pName = tsk_strdup(pcName); 38 | } 39 | 40 | OTCfgSection::~OTCfgSection() 41 | { 42 | TSK_FREE(m_pName); 43 | } 44 | 45 | bool OTCfgSection::addParam(OTObjectWrapper oParam) 46 | { 47 | if(oParam) 48 | { 49 | m_oParams.push_back(oParam); 50 | return true; 51 | } 52 | return false; 53 | } 54 | 55 | bool OTCfgSection::addParam(const char* pcName, const char* pcValue) 56 | { 57 | if(tsk_strnullORempty(pcName)) 58 | { 59 | OT_DEBUG_ERROR("Invalid parameter"); 60 | return false; 61 | } 62 | 63 | return addParam(new OTCfgParam(pcName, pcValue)); 64 | } 65 | 66 | 67 | // 68 | // OTCfgParam 69 | // 70 | OTCfgParam::OTCfgParam(const char* pcName, const char* pcValue) 71 | : OTCfg(OTCfgType_Param) 72 | , m_pValue(NULL) 73 | { 74 | OT_ASSERT(!tsk_strnullORempty(pcName)); 75 | m_pName = tsk_strdup(pcName); 76 | m_pValue = tsk_strdup(pcValue); 77 | } 78 | 79 | OTCfgParam::~OTCfgParam() 80 | { 81 | TSK_FREE(m_pName); 82 | TSK_FREE(m_pValue); 83 | } 84 | -------------------------------------------------------------------------------- /source/docstreamer/OTDocStreamer.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/docstreamer/OTDocStreamer.h" 8 | #include "opentelepresence/docstreamer/OTDocStreamerOpenOffice.h" 9 | 10 | #include "tsk_debug.h" 11 | 12 | uint64_t OTDocStreamer::g_uId = 0; 13 | 14 | // 15 | // OTDocStreamer 16 | // 17 | 18 | OTDocStreamer::OTDocStreamer(OTDocStreamerType_t eType, OTObjectWrapper oBridgeInfo, const OTDocStreamerCallback* pcCallback /*= NULL*/) 19 | : OTObject() 20 | , m_eType(eType) 21 | , m_uId(++g_uId) 22 | , m_oBridgeInfo(oBridgeInfo) 23 | , m_eState(OTDocStreamerState_None) 24 | , m_pcCallback(pcCallback) 25 | { 26 | } 27 | 28 | OTDocStreamer::~OTDocStreamer() 29 | { 30 | OT_DEBUG_INFO("*** OTDocStreamer(%s,%llu) destroyed ***", getObjectId(), m_uId); 31 | } 32 | 33 | bool OTDocStreamer::isSupported() 34 | { 35 | #if HAVE_OPENOFFICE /* || HAVE_HARTALLO */ 36 | return true; 37 | #else 38 | return false; 39 | #endif 40 | } 41 | 42 | std::string OTDocStreamer::buildCommandArgs(unsigned short nLocalPort) 43 | { 44 | #if HAVE_OPENOFFICE 45 | return OTDocStreamerOpenOffice::buildCommandArgs(nLocalPort); 46 | #else 47 | return ""; 48 | #endif 49 | } 50 | 51 | std::string OTDocStreamer::buildConnectionString(unsigned short nLocalPort) 52 | { 53 | #if HAVE_OPENOFFICE 54 | return OTDocStreamerOpenOffice::buildConnectionString(nLocalPort); 55 | #else 56 | return ""; 57 | #endif 58 | } 59 | 60 | OTObjectWrapper OTDocStreamer::New(OTObjectWrapper oBridgeInfo, const OTDocStreamerCallback* pcCallback /*= NULL*/) 61 | { 62 | OTObjectWrapper oStreamer; 63 | 64 | #if HAVE_OPENOFFICE 65 | oStreamer = new OTDocStreamerOpenOffice(oBridgeInfo, pcCallback); 66 | #endif /* HAVE_OPENOFFICE */ 67 | 68 | #if HAVE_HARTALLO /* direct conversion from document to H.264 SVC */ 69 | oStreamer = new OTDocStreamerHartallo(oBridgeInfo, pcCallback); 70 | #endif 71 | 72 | if(oStreamer && !oStreamer->isValid()) 73 | { 74 | OTObjectSafeRelease(oStreamer); 75 | } 76 | 77 | return oStreamer; 78 | } 79 | 80 | -------------------------------------------------------------------------------- /source/mixers/OTMixer.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/mixers/OTMixer.h" 8 | #include "opentelepresence/mixers/OTMixerAudio.h" 9 | #include "opentelepresence/mixers/OTMixerVideo.h" 10 | 11 | OTMixer::OTMixer(OTMediaType_t eMediaType, OTObjectWrapper oBridgeInfo) 12 | : m_eMediaType(eMediaType) 13 | , m_oBridgeInfo(oBridgeInfo) 14 | { 15 | 16 | } 17 | 18 | OTMixer::~OTMixer() 19 | { 20 | 21 | } 22 | 23 | OTObjectWrapper OTMixer::New(OTMediaType_t eMediaType, OTObjectWrapper oBridgeInfo) 24 | { 25 | OTObjectWrapper oMixer; 26 | 27 | switch(eMediaType) 28 | { 29 | case OTMediaType_Audio: 30 | { 31 | OTObjectWrapperoMixerAudio = OTMixerAudio::New(oBridgeInfo); 32 | if(oMixerAudio) 33 | { 34 | oMixer = dynamic_cast(*oMixerAudio); 35 | } 36 | break; 37 | } 38 | case OTMediaType_Video: 39 | { 40 | OTObjectWrapperoMixerVideo = OTMixerVideo::New(oBridgeInfo); 41 | if(oMixerVideo) 42 | { 43 | oMixer = dynamic_cast(*oMixerVideo); 44 | } 45 | break; 46 | } 47 | } 48 | 49 | if(oMixer && !oMixer->isValid()) 50 | { 51 | OTObjectSafeRelease(oMixer); 52 | } 53 | return oMixer; 54 | } 55 | -------------------------------------------------------------------------------- /source/mixers/OTMixerAudio.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/mixers/OTMixerAudio.h" 8 | #include "opentelepresence/mixers/OTMixerAudio2D.h" 9 | #include "opentelepresence/mixers/OTMixerAudio3D.h" 10 | 11 | OTMixerAudio::OTMixerAudio(OTObjectWrapper oBridgeInfo) 12 | :OTMixer(OTMediaType_Audio, oBridgeInfo) 13 | { 14 | } 15 | 16 | OTMixerAudio::~OTMixerAudio() 17 | { 18 | } 19 | 20 | OTObjectWrapper OTMixerAudio::New(OTObjectWrapper oBridgeInfo) 21 | { 22 | switch(oBridgeInfo->getAudioDimension()) 23 | { 24 | case OTDimension_2D: 25 | { 26 | OTObjectWrapper oMixerAudio2D = OTMixerAudio2D::New(oBridgeInfo); 27 | if(oMixerAudio2D) 28 | { 29 | return dynamic_cast(*oMixerAudio2D); 30 | } 31 | break; 32 | } 33 | case OTDimension_3D: 34 | { 35 | OTObjectWrapper oMixerAudio3D = OTMixerAudio3D::New(oBridgeInfo); 36 | if(oMixerAudio3D) 37 | { 38 | return dynamic_cast(*oMixerAudio3D); 39 | } 40 | break; 41 | } 42 | } 43 | return NULL; 44 | } 45 | -------------------------------------------------------------------------------- /source/mixers/OTMixerAudio2D.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/mixers/OTMixerAudio2D.h" 8 | 9 | #include "tsk_memory.h" 10 | #include "tsk_debug.h" 11 | 12 | #include 13 | 14 | OTMixerAudio2D::OTMixerAudio2D(OTObjectWrapper oBridgeInfo) 15 | : OTMixerAudio(oBridgeInfo) 16 | , m_pTempBuffer(NULL) 17 | , m_nTempBufferSize(0) 18 | { 19 | m_bValid = oBridgeInfo 20 | && getMediaType() == OTMediaType_Audio 21 | && oBridgeInfo->getAudioDimension() == OTDimension_2D; 22 | } 23 | 24 | OTMixerAudio2D::~OTMixerAudio2D() 25 | { 26 | TSK_FREE(m_pTempBuffer); 27 | 28 | OT_DEBUG_INFO("*** OTMixerAudio2D destroyed ***"); 29 | } 30 | 31 | int OTMixerAudio2D::reset() 32 | { 33 | return 0; 34 | } 35 | 36 | bool OTMixerAudio2D::isValid() 37 | { 38 | return m_bValid; 39 | } 40 | 41 | // 42 | // http://www.vttoth.com/digimix.htm 43 | // 44 | 45 | static void _mix16(const int16_t* pInBufferPtr, float dInBufferVolume, int16_t* pOutBufferPtr, size_t nSizeToMixInBytes) 46 | { 47 | register uint32_t i; 48 | float mixedSample; 49 | size_t nSizeToMixInSamples = (nSizeToMixInBytes >>1); 50 | for(i = 0; i+1.0f)mixedSample=+1.0f; 57 | pOutBufferPtr[i] = (int16_t)(mixedSample * 32768.0f); 58 | } 59 | } 60 | 61 | OTObjectWrapper OTMixerAudio2D::mix(std::map >*pConsumers, uint64_t nConsumerToIgnore /*= 0*/) 62 | { 63 | OT_ASSERT(pConsumers); 64 | 65 | std::map >::iterator iter; 66 | 67 | if(!m_nTempBufferSize || !m_oFrame) 68 | { 69 | OT_ASSERT(m_oBridgeInfo->getAudioBitsPerSample() == 16); 70 | size_t nTempBufferSize = (m_oBridgeInfo->getAudioSampleRate() * (m_oBridgeInfo->getAudioBitsPerSample() >> 3) * m_oBridgeInfo->getAudioChannels() * m_oBridgeInfo->getAudioPtime())/1000; 71 | if(!(m_pTempBuffer = tsk_realloc(m_pTempBuffer, nTempBufferSize))) 72 | { 73 | OT_DEBUG_ERROR("Failed to alloc buffer with size = %u", nTempBufferSize); 74 | m_nTempBufferSize = 0; 75 | return false; 76 | } 77 | m_nTempBufferSize = nTempBufferSize; 78 | if(!(m_oFrame = OTFrameAudio::New(true, NULL, m_nTempBufferSize))) 79 | { 80 | return NULL; 81 | } 82 | m_oFrame->setBitsPerSample(m_oBridgeInfo->getAudioBitsPerSample()); 83 | m_oFrame->setChannels(m_oBridgeInfo->getAudioChannels()); 84 | m_oFrame->setSampleRate(m_oBridgeInfo->getAudioSampleRate()); 85 | m_oFrame->setVolume(m_oBridgeInfo->getAudioVolume()); 86 | } 87 | 88 | bool bMixed = false; 89 | size_t nCopiedSizeInBytes, nCopiedSizeInBytesMax = 0; 90 | 91 | for(iter = pConsumers->begin(); iter != pConsumers->end(); ++iter) 92 | { 93 | if(iter->first == nConsumerToIgnore) 94 | { 95 | continue; 96 | } 97 | 98 | nCopiedSizeInBytes = iter->second->copyFromHeldBuffer(m_pTempBuffer, m_nTempBufferSize); 99 | if(nCopiedSizeInBytes) 100 | { 101 | nCopiedSizeInBytesMax = TSK_MAX(nCopiedSizeInBytesMax, nCopiedSizeInBytes); 102 | if(!bMixed) // First time ? 103 | { 104 | memcpy(m_oFrame->getBufferPtr(), m_pTempBuffer, nCopiedSizeInBytes); 105 | } 106 | else 107 | { 108 | _mix16((const int16_t *)m_pTempBuffer, m_oFrame->getVolume(), (int16_t*)m_oFrame->getBufferPtr(), nCopiedSizeInBytes); 109 | } 110 | bMixed = true; 111 | } 112 | } 113 | 114 | if(bMixed) 115 | { 116 | m_oFrame->setValidDataSize(nCopiedSizeInBytesMax); 117 | return m_oFrame; 118 | } 119 | 120 | return NULL; 121 | } 122 | 123 | OTObjectWrapper OTMixerAudio2D::New(OTObjectWrapper oBridgeInfo) 124 | { 125 | OTObjectWrapper oMixerAudio2D = new OTMixerAudio2D(oBridgeInfo); 126 | if(oMixerAudio2D && !oMixerAudio2D->isValid()) 127 | { 128 | OTObjectSafeRelease(oMixerAudio2D); 129 | } 130 | return oMixerAudio2D; 131 | } 132 | -------------------------------------------------------------------------------- /source/mixers/OTMixerVideo.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/mixers/OTMixerVideo.h" 8 | #include "opentelepresence/mixers/OTMixerVideo2D.h" 9 | #include "opentelepresence/mixers/OTMixerVideo3D.h" 10 | 11 | OTMixerVideo::OTMixerVideo(OTObjectWrapper oBridgeInfo) 12 | : OTMixer(OTMediaType_Video, oBridgeInfo) 13 | { 14 | } 15 | 16 | OTMixerVideo::~OTMixerVideo() 17 | { 18 | OTObjectSafeRelease(m_pOTPatternVideo); 19 | } 20 | 21 | OTObjectWrapper OTMixerVideo::New(OTObjectWrapper oBridgeInfo) 22 | { 23 | switch(oBridgeInfo->getVideoDimension()) 24 | { 25 | case OTDimension_2D: 26 | { 27 | OTObjectWrapper oMixerVideo2D = OTMixerVideo2D::New(oBridgeInfo); 28 | if(oMixerVideo2D && oMixerVideo2D->isValid()) 29 | { 30 | return dynamic_cast(*oMixerVideo2D); 31 | } 32 | break; 33 | } 34 | case OTDimension_3D: 35 | { 36 | OTObjectWrapper oMixerVideo3D = OTMixerVideo3D::New(oBridgeInfo); 37 | if(oMixerVideo3D && oMixerVideo3D->isValid()) 38 | { 39 | return dynamic_cast(*oMixerVideo3D); 40 | } 41 | break; 42 | } 43 | } 44 | return NULL; 45 | } 46 | -------------------------------------------------------------------------------- /source/mixers/OTMixerVideo2D.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/mixers/OTMixerVideo2D.h" 8 | #include "opentelepresence/patterns/OTPatternVideoWebEx.h" 9 | #include "opentelepresence/patterns/OTPatternVideoHangout.h" 10 | 11 | #include "tsk_debug.h" 12 | 13 | #include 14 | 15 | OTMixerVideo2D::OTMixerVideo2D(OTObjectWrapper oBridgeInfo) 16 | : OTMixerVideo(oBridgeInfo) 17 | { 18 | m_pOTPatternVideo = NULL; 19 | m_nPatterPosition = 0; 20 | m_bValid = oBridgeInfo 21 | && getMediaType() == OTMediaType_Video 22 | && oBridgeInfo->getVideoDimension() == OTDimension_2D; 23 | 24 | // FIXME: what about other patterns (e.g. WebEx) 25 | m_pOTPatternVideo = dynamic_cast(*OTPatternVideoHangout::New(oBridgeInfo)); 26 | } 27 | 28 | OTMixerVideo2D::~OTMixerVideo2D() 29 | { 30 | OT_DEBUG_INFO("*** OTMixerVideo2D destroyed ***"); 31 | } 32 | 33 | int OTMixerVideo2D::reset() 34 | { 35 | m_nPatterPosition = 0; 36 | return 0; 37 | } 38 | 39 | bool OTMixerVideo2D::isValid() 40 | { 41 | return m_bValid; 42 | } 43 | 44 | OTObjectWrapper OTMixerVideo2D::mix(std::map >* pOTConsumers, void** ppDstBuffer, uint32_t* pDstBufferSize) 45 | { 46 | return m_pOTPatternVideo->mix(pOTConsumers, ppDstBuffer, pDstBufferSize);; 47 | } 48 | 49 | OTObjectWrapper OTMixerVideo2D::New(OTObjectWrapper oBridgeInfo) 50 | { 51 | OTObjectWrapper oMixerVideo2D = new OTMixerVideo2D(oBridgeInfo); 52 | if(oMixerVideo2D && !oMixerVideo2D->isValid()) 53 | { 54 | OTObjectSafeRelease(oMixerVideo2D); 55 | } 56 | return oMixerVideo2D; 57 | } 58 | -------------------------------------------------------------------------------- /source/mixers/OTMixerVideo3D.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/mixers/OTMixerVideo3D.h" 8 | 9 | #include "tsk_debug.h" 10 | 11 | OTMixerVideo3D::OTMixerVideo3D(OTObjectWrapper oBridgeInfo) 12 | : OTMixerVideo(oBridgeInfo) 13 | { 14 | m_bValid = oBridgeInfo 15 | && getMediaType() == OTMediaType_Video 16 | && oBridgeInfo->getVideoDimension() == OTDimension_3D; 17 | } 18 | 19 | OTMixerVideo3D::~OTMixerVideo3D() 20 | { 21 | } 22 | 23 | int OTMixerVideo3D::reset() 24 | { 25 | return 0; 26 | } 27 | 28 | bool OTMixerVideo3D::isValid() 29 | { 30 | return m_bValid; 31 | } 32 | 33 | OTObjectWrapper OTMixerVideo3D::mix(std::map >* pOTConsumers, void** ppDstBuffer, uint32_t* pDstBufferSize) 34 | { 35 | OT_DEBUG_ERROR("Not supported"); 36 | return NULL; 37 | } 38 | 39 | 40 | OTObjectWrapper OTMixerVideo3D::New(OTObjectWrapper oBridgeInfo) 41 | { 42 | OTObjectWrapper oMixerVideo3D = new OTMixerVideo3D(oBridgeInfo); 43 | if(oMixerVideo3D && !oMixerVideo3D->isValid()) 44 | { 45 | OTObjectSafeRelease(oMixerVideo3D); 46 | } 47 | return oMixerVideo3D; 48 | } 49 | -------------------------------------------------------------------------------- /source/patterns/OTPattern.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/patterns/OTPattern.h" 8 | 9 | OTPattern::OTPattern(OTPatternType_t eType, OTObjectWrapper oBridgeInfo) 10 | : OTObject() 11 | , m_eType(eType) 12 | , m_oBridgeInfo(oBridgeInfo) 13 | { 14 | 15 | } 16 | 17 | OTPattern::~OTPattern() 18 | { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /source/patterns/OTPatternVideo.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/patterns/OTPatternVideo.h" 8 | 9 | OTPatternVideo::OTPatternVideo(OTPatternType_t eType, OTObjectWrapper oBridgeInfo) 10 | : OTPattern(eType, oBridgeInfo) 11 | { 12 | 13 | } 14 | 15 | OTPatternVideo::~OTPatternVideo() 16 | { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /source/patterns/OTPatternVideoWebEx.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/patterns/OTPatternVideoWebEx.h" 8 | 9 | #include 10 | 11 | OTPatternVideoWebEx::OTPatternVideoWebEx(OTObjectWrapper oBridgeInfo) 12 | : OTPatternVideo(OTPatternType_WebEx, oBridgeInfo) 13 | { 14 | } 15 | 16 | OTPatternVideoWebEx::~OTPatternVideoWebEx() 17 | { 18 | 19 | } 20 | 21 | OTObjectWrapper OTPatternVideoWebEx::mix(std::map >*pOTConsumers, void** pDstBuffer, uint32_t *pDstBufferSize) 22 | { 23 | OT_ASSERT(false); 24 | return NULL; 25 | } -------------------------------------------------------------------------------- /source/platforms/generic/OTEngineGen.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/platforms/generic/OTEngineGen.h" 8 | 9 | OTEngineGen::OTEngineGen() 10 | :OTEngine() 11 | { 12 | } 13 | 14 | OTEngineGen::~OTEngineGen() 15 | { 16 | } 17 | 18 | bool OTEngineGen::isValid() 19 | { 20 | return true; 21 | } 22 | 23 | bool OTEngineGen::start() 24 | { 25 | return OTEngine::start(); 26 | } 27 | 28 | bool OTEngineGen::stop() 29 | { 30 | return OTEngine::stop(); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /source/platforms/osx/OTEngineOSX.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/platforms/osx/OTEngineOSX.h" 8 | 9 | #if OPENTELEPRESENCE_UNDER_OSX 10 | 11 | #include "tsk_debug.h" 12 | 13 | OTEngineOSX::OTEngineOSX() 14 | :OTEngine() 15 | { 16 | } 17 | 18 | OTEngineOSX::~OTEngineOSX() 19 | { 20 | } 21 | 22 | bool OTEngineOSX::isValid() 23 | { 24 | return true; 25 | } 26 | 27 | bool OTEngineOSX::start() 28 | { 29 | return OTEngine::start(); 30 | } 31 | 32 | bool OTEngineOSX::stop() 33 | { 34 | return OTEngine::stop(); 35 | } 36 | 37 | 38 | #endif /* OPENTELEPRESENCE_UNDER_OSX */ 39 | -------------------------------------------------------------------------------- /source/platforms/win32/OTEngineWin32.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/platforms/win32/OTEngineWin32.h" 8 | 9 | #if OPENTELEPRESENCE_UNDER_WINDOWS 10 | 11 | #include "tsk_debug.h" 12 | 13 | #include 14 | 15 | ULONG_PTR OTEngineWin32::g_pGdiplusToken = NULL; 16 | bool OTEngineWin32::g_bInitialized = FALSE; 17 | 18 | OTEngineWin32::OTEngineWin32() 19 | : OTEngine() 20 | { 21 | int ret; 22 | 23 | m_bValid = FALSE; 24 | 25 | if(!OTEngineWin32::g_bInitialized && (ret = OTEngineWin32::initialize())){ 26 | OT_DEBUG_ERROR("OTEngineWin32::Initialize failed with error code=%d", ret); 27 | return; 28 | } 29 | 30 | if((m_bValid = g_bInitialized)) 31 | { 32 | 33 | } 34 | } 35 | 36 | OTEngineWin32::~OTEngineWin32() 37 | { 38 | } 39 | 40 | bool OTEngineWin32::isValid() 41 | { 42 | return m_bValid; 43 | } 44 | 45 | bool OTEngineWin32::start() 46 | { 47 | if(!OTEngineWin32::g_bInitialized) 48 | { 49 | OT_DEBUG_ERROR("Engine not initialized. Did you forget to call OTEngine::Initialize()"); 50 | return false; 51 | } 52 | 53 | // call parent 54 | return OTEngine::start(); 55 | } 56 | 57 | bool OTEngineWin32::stop() 58 | { 59 | if(!OTEngineWin32::g_bInitialized) 60 | { 61 | OT_DEBUG_ERROR("Engine not initialized. Did you forget to call OTEngine::Initialize()"); 62 | return false; 63 | } 64 | 65 | // call parent 66 | return OTEngine::stop(); 67 | } 68 | 69 | int OTEngineWin32::initialize() 70 | { 71 | if(OTEngineWin32::g_bInitialized) 72 | { 73 | OT_DEBUG_WARN("Engine already initialized"); 74 | return 0; 75 | } 76 | 77 | 78 | using namespace Gdiplus; 79 | // Initialize GDI+ 80 | GdiplusStartupInput gdiplusStartupInput; 81 | GdiplusStartup(&OTEngineWin32::g_pGdiplusToken, &gdiplusStartupInput, NULL); 82 | // Process priorty 83 | // SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS); 84 | 85 | OTEngineWin32::g_bInitialized = TRUE; 86 | return 0; 87 | } 88 | 89 | int OTEngineWin32::deInitialize() 90 | { 91 | if(!OTEngineWin32::g_bInitialized) 92 | { 93 | OT_DEBUG_WARN("not initialized"); 94 | return 0; 95 | } 96 | 97 | using namespace Gdiplus; 98 | // Uninitialize GDI+ 99 | GdiplusShutdown(OTEngineWin32::g_pGdiplusToken); 100 | 101 | OTEngineWin32::g_bInitialized = FALSE; 102 | return 0; 103 | } 104 | 105 | #endif /* OPENTELEPRESENCE_UNDER_WINDOWS */ 106 | -------------------------------------------------------------------------------- /source/presence/OTPresenceNotifer.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/presence/OTPresenceNotifer.h" 8 | 9 | OTPresenceNotifer::OTPresenceNotifer() 10 | :OTObject() 11 | { 12 | } 13 | 14 | OTPresenceNotifer::~OTPresenceNotifer() 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /source/presence/OTPresenceParser.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Mamadou DIOP 3 | * Copyright (C) 2013 Doubango Telecom 4 | * License: GPLv3 5 | * This file is part of the open source SIP TelePresence system 6 | */ 7 | #include "opentelepresence/presence/OTPresenceParser.h" 8 | 9 | OTPresenceParser::OTPresenceParser() 10 | :OTObject() 11 | { 12 | } 13 | 14 | OTPresenceParser::~OTPresenceParser() 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /thirdparties/common/include/AL/efx-creative.h: -------------------------------------------------------------------------------- 1 | /* The tokens that would be defined here are already defined in efx.h. This 2 | * empty file is here to provide compatibility with Windows-based projects 3 | * that would include it. */ 4 | -------------------------------------------------------------------------------- /thirdparties/win32/lib/OpenAL-patched/OpenAL32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/thirdparties/win32/lib/OpenAL-patched/OpenAL32.dll -------------------------------------------------------------------------------- /thirdparties/win32/lib/OpenAL-patched/readme.txt: -------------------------------------------------------------------------------- 1 | We removed: 2 | 3 | HAVE___CONTROL87_2 4 | HAVE__CONTROLFP 5 | 6 | from config.h before building with Visual Studio -------------------------------------------------------------------------------- /thirdparties/win32/lib/OpenAL-unpatched/OpenAL32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/thirdparties/win32/lib/OpenAL-unpatched/OpenAL32.dll -------------------------------------------------------------------------------- /thirdparties/win32/lib/OpenAL32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/thirdparties/win32/lib/OpenAL32.lib -------------------------------------------------------------------------------- /website/assets/ico/apple-touch-icon-114-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/ico/apple-touch-icon-114-precomposed.png -------------------------------------------------------------------------------- /website/assets/ico/apple-touch-icon-144-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/ico/apple-touch-icon-144-precomposed.png -------------------------------------------------------------------------------- /website/assets/ico/apple-touch-icon-57-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/ico/apple-touch-icon-57-precomposed.png -------------------------------------------------------------------------------- /website/assets/ico/apple-touch-icon-72-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/ico/apple-touch-icon-72-precomposed.png -------------------------------------------------------------------------------- /website/assets/ico/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/ico/favicon.ico -------------------------------------------------------------------------------- /website/assets/ico/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/ico/favicon.png -------------------------------------------------------------------------------- /website/assets/img/bootstrap-docs-readme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/bootstrap-docs-readme.png -------------------------------------------------------------------------------- /website/assets/img/bs-docs-bootstrap-features.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/bs-docs-bootstrap-features.png -------------------------------------------------------------------------------- /website/assets/img/bs-docs-masthead-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/bs-docs-masthead-pattern.png -------------------------------------------------------------------------------- /website/assets/img/bs-docs-responsive-illustrations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/bs-docs-responsive-illustrations.png -------------------------------------------------------------------------------- /website/assets/img/bs-docs-twitter-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/bs-docs-twitter-github.png -------------------------------------------------------------------------------- /website/assets/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /website/assets/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /website/assets/img/grid-baseline-20px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/grid-baseline-20px.png -------------------------------------------------------------------------------- /website/assets/img/less-logo-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/less-logo-large.png -------------------------------------------------------------------------------- /website/assets/img/responsive-illustrations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/responsive-illustrations.png -------------------------------------------------------------------------------- /website/assets/img/tp-logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/tp-logo.jpg -------------------------------------------------------------------------------- /website/assets/img/webrtc-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DoubangoTelecom/telepresence/8442ad7948081d4019e973bbe4588365a38714d9/website/assets/img/webrtc-logo.png -------------------------------------------------------------------------------- /website/assets/js/bootstrap-affix.js: -------------------------------------------------------------------------------- 1 | /* ========================================================== 2 | * bootstrap-affix.js v2.3.1 3 | * http://twitter.github.com/bootstrap/javascript.html#affix 4 | * ========================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* AFFIX CLASS DEFINITION 27 | * ====================== */ 28 | 29 | var Affix = function (element, options) { 30 | this.options = $.extend({}, $.fn.affix.defaults, options) 31 | this.$window = $(window) 32 | .on('scroll.affix.data-api', $.proxy(this.checkPosition, this)) 33 | .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this)) 34 | this.$element = $(element) 35 | this.checkPosition() 36 | } 37 | 38 | Affix.prototype.checkPosition = function () { 39 | if (!this.$element.is(':visible')) return 40 | 41 | var scrollHeight = $(document).height() 42 | , scrollTop = this.$window.scrollTop() 43 | , position = this.$element.offset() 44 | , offset = this.options.offset 45 | , offsetBottom = offset.bottom 46 | , offsetTop = offset.top 47 | , reset = 'affix affix-top affix-bottom' 48 | , affix 49 | 50 | if (typeof offset != 'object') offsetBottom = offsetTop = offset 51 | if (typeof offsetTop == 'function') offsetTop = offset.top() 52 | if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() 53 | 54 | affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? 55 | false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 56 | 'bottom' : offsetTop != null && scrollTop <= offsetTop ? 57 | 'top' : false 58 | 59 | if (this.affixed === affix) return 60 | 61 | this.affixed = affix 62 | this.unpin = affix == 'bottom' ? position.top - scrollTop : null 63 | 64 | this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : '')) 65 | } 66 | 67 | 68 | /* AFFIX PLUGIN DEFINITION 69 | * ======================= */ 70 | 71 | var old = $.fn.affix 72 | 73 | $.fn.affix = function (option) { 74 | return this.each(function () { 75 | var $this = $(this) 76 | , data = $this.data('affix') 77 | , options = typeof option == 'object' && option 78 | if (!data) $this.data('affix', (data = new Affix(this, options))) 79 | if (typeof option == 'string') data[option]() 80 | }) 81 | } 82 | 83 | $.fn.affix.Constructor = Affix 84 | 85 | $.fn.affix.defaults = { 86 | offset: 0 87 | } 88 | 89 | 90 | /* AFFIX NO CONFLICT 91 | * ================= */ 92 | 93 | $.fn.affix.noConflict = function () { 94 | $.fn.affix = old 95 | return this 96 | } 97 | 98 | 99 | /* AFFIX DATA-API 100 | * ============== */ 101 | 102 | $(window).on('load', function () { 103 | $('[data-spy="affix"]').each(function () { 104 | var $spy = $(this) 105 | , data = $spy.data() 106 | 107 | data.offset = data.offset || {} 108 | 109 | data.offsetBottom && (data.offset.bottom = data.offsetBottom) 110 | data.offsetTop && (data.offset.top = data.offsetTop) 111 | 112 | $spy.affix(data) 113 | }) 114 | }) 115 | 116 | 117 | }(window.jQuery); -------------------------------------------------------------------------------- /website/assets/js/bootstrap-alert.js: -------------------------------------------------------------------------------- 1 | /* ========================================================== 2 | * bootstrap-alert.js v2.3.1 3 | * http://twitter.github.com/bootstrap/javascript.html#alerts 4 | * ========================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* ALERT CLASS DEFINITION 27 | * ====================== */ 28 | 29 | var dismiss = '[data-dismiss="alert"]' 30 | , Alert = function (el) { 31 | $(el).on('click', dismiss, this.close) 32 | } 33 | 34 | Alert.prototype.close = function (e) { 35 | var $this = $(this) 36 | , selector = $this.attr('data-target') 37 | , $parent 38 | 39 | if (!selector) { 40 | selector = $this.attr('href') 41 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 42 | } 43 | 44 | $parent = $(selector) 45 | 46 | e && e.preventDefault() 47 | 48 | $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) 49 | 50 | $parent.trigger(e = $.Event('close')) 51 | 52 | if (e.isDefaultPrevented()) return 53 | 54 | $parent.removeClass('in') 55 | 56 | function removeElement() { 57 | $parent 58 | .trigger('closed') 59 | .remove() 60 | } 61 | 62 | $.support.transition && $parent.hasClass('fade') ? 63 | $parent.on($.support.transition.end, removeElement) : 64 | removeElement() 65 | } 66 | 67 | 68 | /* ALERT PLUGIN DEFINITION 69 | * ======================= */ 70 | 71 | var old = $.fn.alert 72 | 73 | $.fn.alert = function (option) { 74 | return this.each(function () { 75 | var $this = $(this) 76 | , data = $this.data('alert') 77 | if (!data) $this.data('alert', (data = new Alert(this))) 78 | if (typeof option == 'string') data[option].call($this) 79 | }) 80 | } 81 | 82 | $.fn.alert.Constructor = Alert 83 | 84 | 85 | /* ALERT NO CONFLICT 86 | * ================= */ 87 | 88 | $.fn.alert.noConflict = function () { 89 | $.fn.alert = old 90 | return this 91 | } 92 | 93 | 94 | /* ALERT DATA-API 95 | * ============== */ 96 | 97 | $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) 98 | 99 | }(window.jQuery); -------------------------------------------------------------------------------- /website/assets/js/bootstrap-button.js: -------------------------------------------------------------------------------- 1 | /* ============================================================ 2 | * bootstrap-button.js v2.3.1 3 | * http://twitter.github.com/bootstrap/javascript.html#buttons 4 | * ============================================================ 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================ */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* BUTTON PUBLIC CLASS DEFINITION 27 | * ============================== */ 28 | 29 | var Button = function (element, options) { 30 | this.$element = $(element) 31 | this.options = $.extend({}, $.fn.button.defaults, options) 32 | } 33 | 34 | Button.prototype.setState = function (state) { 35 | var d = 'disabled' 36 | , $el = this.$element 37 | , data = $el.data() 38 | , val = $el.is('input') ? 'val' : 'html' 39 | 40 | state = state + 'Text' 41 | data.resetText || $el.data('resetText', $el[val]()) 42 | 43 | $el[val](data[state] || this.options[state]) 44 | 45 | // push to event loop to allow forms to submit 46 | setTimeout(function () { 47 | state == 'loadingText' ? 48 | $el.addClass(d).attr(d, d) : 49 | $el.removeClass(d).removeAttr(d) 50 | }, 0) 51 | } 52 | 53 | Button.prototype.toggle = function () { 54 | var $parent = this.$element.closest('[data-toggle="buttons-radio"]') 55 | 56 | $parent && $parent 57 | .find('.active') 58 | .removeClass('active') 59 | 60 | this.$element.toggleClass('active') 61 | } 62 | 63 | 64 | /* BUTTON PLUGIN DEFINITION 65 | * ======================== */ 66 | 67 | var old = $.fn.button 68 | 69 | $.fn.button = function (option) { 70 | return this.each(function () { 71 | var $this = $(this) 72 | , data = $this.data('button') 73 | , options = typeof option == 'object' && option 74 | if (!data) $this.data('button', (data = new Button(this, options))) 75 | if (option == 'toggle') data.toggle() 76 | else if (option) data.setState(option) 77 | }) 78 | } 79 | 80 | $.fn.button.defaults = { 81 | loadingText: 'loading...' 82 | } 83 | 84 | $.fn.button.Constructor = Button 85 | 86 | 87 | /* BUTTON NO CONFLICT 88 | * ================== */ 89 | 90 | $.fn.button.noConflict = function () { 91 | $.fn.button = old 92 | return this 93 | } 94 | 95 | 96 | /* BUTTON DATA-API 97 | * =============== */ 98 | 99 | $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { 100 | var $btn = $(e.target) 101 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') 102 | $btn.button('toggle') 103 | }) 104 | 105 | }(window.jQuery); -------------------------------------------------------------------------------- /website/assets/js/bootstrap-popover.js: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * bootstrap-popover.js v2.3.1 3 | * http://twitter.github.com/bootstrap/javascript.html#popovers 4 | * =========================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * =========================================================== */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* POPOVER PUBLIC CLASS DEFINITION 27 | * =============================== */ 28 | 29 | var Popover = function (element, options) { 30 | this.init('popover', element, options) 31 | } 32 | 33 | 34 | /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js 35 | ========================================== */ 36 | 37 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { 38 | 39 | constructor: Popover 40 | 41 | , setContent: function () { 42 | var $tip = this.tip() 43 | , title = this.getTitle() 44 | , content = this.getContent() 45 | 46 | $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) 47 | $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) 48 | 49 | $tip.removeClass('fade top bottom left right in') 50 | } 51 | 52 | , hasContent: function () { 53 | return this.getTitle() || this.getContent() 54 | } 55 | 56 | , getContent: function () { 57 | var content 58 | , $e = this.$element 59 | , o = this.options 60 | 61 | content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) 62 | || $e.attr('data-content') 63 | 64 | return content 65 | } 66 | 67 | , tip: function () { 68 | if (!this.$tip) { 69 | this.$tip = $(this.options.template) 70 | } 71 | return this.$tip 72 | } 73 | 74 | , destroy: function () { 75 | this.hide().$element.off('.' + this.type).removeData(this.type) 76 | } 77 | 78 | }) 79 | 80 | 81 | /* POPOVER PLUGIN DEFINITION 82 | * ======================= */ 83 | 84 | var old = $.fn.popover 85 | 86 | $.fn.popover = function (option) { 87 | return this.each(function () { 88 | var $this = $(this) 89 | , data = $this.data('popover') 90 | , options = typeof option == 'object' && option 91 | if (!data) $this.data('popover', (data = new Popover(this, options))) 92 | if (typeof option == 'string') data[option]() 93 | }) 94 | } 95 | 96 | $.fn.popover.Constructor = Popover 97 | 98 | $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { 99 | placement: 'right' 100 | , trigger: 'click' 101 | , content: '' 102 | , template: '

' 103 | }) 104 | 105 | 106 | /* POPOVER NO CONFLICT 107 | * =================== */ 108 | 109 | $.fn.popover.noConflict = function () { 110 | $.fn.popover = old 111 | return this 112 | } 113 | 114 | }(window.jQuery); 115 | -------------------------------------------------------------------------------- /website/assets/js/bootstrap-tab.js: -------------------------------------------------------------------------------- 1 | /* ======================================================== 2 | * bootstrap-tab.js v2.3.1 3 | * http://twitter.github.com/bootstrap/javascript.html#tabs 4 | * ======================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ======================================================== */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* TAB CLASS DEFINITION 27 | * ==================== */ 28 | 29 | var Tab = function (element) { 30 | this.element = $(element) 31 | } 32 | 33 | Tab.prototype = { 34 | 35 | constructor: Tab 36 | 37 | , show: function () { 38 | var $this = this.element 39 | , $ul = $this.closest('ul:not(.dropdown-menu)') 40 | , selector = $this.attr('data-target') 41 | , previous 42 | , $target 43 | , e 44 | 45 | if (!selector) { 46 | selector = $this.attr('href') 47 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 48 | } 49 | 50 | if ( $this.parent('li').hasClass('active') ) return 51 | 52 | previous = $ul.find('.active:last a')[0] 53 | 54 | e = $.Event('show', { 55 | relatedTarget: previous 56 | }) 57 | 58 | $this.trigger(e) 59 | 60 | if (e.isDefaultPrevented()) return 61 | 62 | $target = $(selector) 63 | 64 | this.activate($this.parent('li'), $ul) 65 | this.activate($target, $target.parent(), function () { 66 | $this.trigger({ 67 | type: 'shown' 68 | , relatedTarget: previous 69 | }) 70 | }) 71 | } 72 | 73 | , activate: function ( element, container, callback) { 74 | var $active = container.find('> .active') 75 | , transition = callback 76 | && $.support.transition 77 | && $active.hasClass('fade') 78 | 79 | function next() { 80 | $active 81 | .removeClass('active') 82 | .find('> .dropdown-menu > .active') 83 | .removeClass('active') 84 | 85 | element.addClass('active') 86 | 87 | if (transition) { 88 | element[0].offsetWidth // reflow for transition 89 | element.addClass('in') 90 | } else { 91 | element.removeClass('fade') 92 | } 93 | 94 | if ( element.parent('.dropdown-menu') ) { 95 | element.closest('li.dropdown').addClass('active') 96 | } 97 | 98 | callback && callback() 99 | } 100 | 101 | transition ? 102 | $active.one($.support.transition.end, next) : 103 | next() 104 | 105 | $active.removeClass('in') 106 | } 107 | } 108 | 109 | 110 | /* TAB PLUGIN DEFINITION 111 | * ===================== */ 112 | 113 | var old = $.fn.tab 114 | 115 | $.fn.tab = function ( option ) { 116 | return this.each(function () { 117 | var $this = $(this) 118 | , data = $this.data('tab') 119 | if (!data) $this.data('tab', (data = new Tab(this))) 120 | if (typeof option == 'string') data[option]() 121 | }) 122 | } 123 | 124 | $.fn.tab.Constructor = Tab 125 | 126 | 127 | /* TAB NO CONFLICT 128 | * =============== */ 129 | 130 | $.fn.tab.noConflict = function () { 131 | $.fn.tab = old 132 | return this 133 | } 134 | 135 | 136 | /* TAB DATA-API 137 | * ============ */ 138 | 139 | $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { 140 | e.preventDefault() 141 | $(this).tab('show') 142 | }) 143 | 144 | }(window.jQuery); -------------------------------------------------------------------------------- /website/assets/js/bootstrap-transition.js: -------------------------------------------------------------------------------- 1 | /* =================================================== 2 | * bootstrap-transition.js v2.3.1 3 | * http://twitter.github.com/bootstrap/javascript.html#transitions 4 | * =================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) 27 | * ======================================================= */ 28 | 29 | $(function () { 30 | 31 | $.support.transition = (function () { 32 | 33 | var transitionEnd = (function () { 34 | 35 | var el = document.createElement('bootstrap') 36 | , transEndEventNames = { 37 | 'WebkitTransition' : 'webkitTransitionEnd' 38 | , 'MozTransition' : 'transitionend' 39 | , 'OTransition' : 'oTransitionEnd otransitionend' 40 | , 'transition' : 'transitionend' 41 | } 42 | , name 43 | 44 | for (name in transEndEventNames){ 45 | if (el.style[name] !== undefined) { 46 | return transEndEventNames[name] 47 | } 48 | } 49 | 50 | }()) 51 | 52 | return transitionEnd && { 53 | end: transitionEnd 54 | } 55 | 56 | })() 57 | 58 | }) 59 | 60 | }(window.jQuery); -------------------------------------------------------------------------------- /website/assets/js/google-code-prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #D14; } 6 | .kwd, .prettyprint .tag { color: #1e347b; } 7 | .typ, .atn, .dec, .var { color: teal; } 8 | .pln { color: #48484c; } 9 | 10 | .prettyprint { 11 | padding: 8px; 12 | background-color: #f7f7f9; 13 | border: 1px solid #e1e1e8; 14 | } 15 | .prettyprint.linenums { 16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 19 | } 20 | 21 | /* Specify class=linenums on a pre to get line numbering */ 22 | ol.linenums { 23 | margin: 0 0 0 33px; /* IE indents via margin-left */ 24 | } 25 | ol.linenums li { 26 | padding-left: 12px; 27 | color: #bebec5; 28 | line-height: 20px; 29 | text-shadow: 0 1px 0 #fff; 30 | } -------------------------------------------------------------------------------- /website/assets/js/html5shiv.js: -------------------------------------------------------------------------------- 1 | /* 2 | HTML5 Shiv v3.6.2pre | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed 3 | */ 4 | (function(l,f){function m(){var a=e.elements;return"string"==typeof a?a.split(" "):a}function i(a){var b=n[a[o]];b||(b={},h++,a[o]=h,n[h]=b);return b}function p(a,b,c){b||(b=f);if(g)return b.createElement(a);c||(c=i(b));b=c.cache[a]?c.cache[a].cloneNode():r.test(a)?(c.cache[a]=c.createElem(a)).cloneNode():c.createElem(a);return b.canHaveChildren&&!s.test(a)?c.frag.appendChild(b):b}function t(a,b){if(!b.cache)b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag(); 5 | a.createElement=function(c){return!e.shivMethods?b.createElem(c):p(c,a,b)};a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/\w+/g,function(a){b.createElem(a);b.frag.createElement(a);return'c("'+a+'")'})+");return n}")(e,b.frag)}function q(a){a||(a=f);var b=i(a);if(e.shivCSS&&!j&&!b.hasCSS){var c,d=a;c=d.createElement("p");d=d.getElementsByTagName("head")[0]||d.documentElement;c.innerHTML="x"; 6 | c=d.insertBefore(c.lastChild,d.firstChild);b.hasCSS=!!c}g||t(a,b);return a}var k=l.html5||{},s=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,r=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,j,o="_html5shiv",h=0,n={},g;(function(){try{var a=f.createElement("a");a.innerHTML="";j="hidden"in a;var b;if(!(b=1==a.childNodes.length)){f.createElement("a");var c=f.createDocumentFragment();b="undefined"==typeof c.cloneNode|| 7 | "undefined"==typeof c.createDocumentFragment||"undefined"==typeof c.createElement}g=b}catch(d){g=j=!0}})();var e={elements:k.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==k.shivCSS,supportsUnknownElements:g,shivMethods:!1!==k.shivMethods,type:"default",shivDocument:q,createElement:p,createDocumentFragment:function(a,b){a||(a=f);if(g)return a.createDocumentFragment(); 8 | for(var b=b||i(a),c=b.frag.cloneNode(),d=0,e=m(),h=e.length;d