summaryrefslogtreecommitdiffstats
path: root/pica-client/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* pica-client: echo cancellation, and native audio on Windows and macOSAnton2026-08-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PlatformDriverName() now takes a direction, and answers with one of two kinds of name. A bare one - "alsa", "pulse", "oss" - is an FFmpeg libavdevice driver opened the way everything else here is opened. One prefixed "platform-" is not an FFmpeg driver at all: what follows names a platform audio API the caller drives itself through NativeAudioBackend. Windows and macOS take the second route, because both provide acoustic echo cancellation but only to streams that declare themselves part of a voice call - AudioCategory_Communications on WASAPI, the VoiceProcessingIO audio unit on CoreAudio - and libavdevice's wrappers have no way to ask for either. Doing our own cancelling on platforms that would have done it better below us is not a trade worth making. Where the platform will not do it, speexdsp does: one EchoCanceller per call, shared by both directions through a QSharedPointer, since the call is torn down without joining either audio thread. Playback feeds it the far end as it hands it to the device; capture subtracts before encoding. Alignment is left to the FIFO - in steady state its backlog settles at the sound card's buffer depth, which is also how far ahead of the speaker the playback side runs, leaving only the room for the filter tail to model. Measured 27 dB ERLE on a 60 ms echo with 1.6 dB of loss on speech when nothing is playing. On macOS the canceller is a single audio unit that renders and captures at once, so both directions share one refcounted instance. Ringtones deliberately get a plain HALOutput unit instead - opening a voice unit to play a bell would switch the microphone on and prompt for permission. Linux gains a choice of alsa or pulse, with PulseAudio device enumeration through libpulse when configure finds it. Info.plist gains NSMicrophoneUsageDescription and NSCameraUsageDescription. Without them macOS 10.14 and later kills the process on first use of the microphone or camera rather than asking, so calls did not merely fail, they took the application with them. Two things fixed along the way that were not about echo at all: the settings dialog's microphone test paced playback by counting timer ticks, which on Windows meant a 20 ms packet every ~31 ms because the system timer granularity is 15.6 ms - the recording came out slowed down and chopped up. It now paces against a QElapsedTimer. And chooseEncoderSampleFmt() uses avcodec_get_supported_config() where available, the AVCodec format arrays it replaced having been removed in FFmpeg 9. Only the Linux paths are verified here; the Windows and macOS backends compile to nothing on this machine and have been reviewed by hand. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CBqDgvq3Ty6C6BjLFH16bw
* pica-client: VAAPI on X11, two codepathsAnton2026-08-161-0/+10
|
* pica-client: VAAPI hardware accelerationAnton2026-08-141-0/+7
|
* pica-client: move SkyNet instance to the separate threadAnton2026-08-121-1/+49
|
* add audiovideocallcontroller and callwindow, menu action to initiate callAnton2021-06-291-0/+5
|
* changed license from GPL-3.0-or-later to GPL-3.0-onlyAnton2019-11-131-2/+1
|
* pica-client: Qt5 supportAnton2019-02-271-1/+3
|
* add copyrigt and GPL-3.0-or-later license notice to source filesAnton2018-07-171-0/+17
|
* improved crossplatform resource loadingAnton2018-07-151-22/+17
|
* remove CA usageAnton2018-07-141-4/+1
|
* preprocessor conditions for loading resources on OS XAnton2018-07-141-0/+7
|
* fix permissions, add executable bit on config directoryAnton2018-07-021-1/+1
|
* set permissions for config dir, sqlite database and private keys - ↵Anton2018-06-191-0/+2
| | | | read-write only for owner
* pica-client: initialize sqlite db connection once on startupAnton2017-12-301-6/+5
|
* pica-client: use single sqlite database connection instance, prevents ↵Anton2017-12-301-0/+1
| | | | multiple warnings about connection in use
* fixed code style on all source files (*.c *.cpp *.h) using astyle ↵Anton2017-12-011-275/+275
| | | | --style=allman --lineend=linux --indent=tab --pad-oper
* show settings dialog on first startAnton2016-09-151-0/+11
|
* fixed settings table creation query, make values uniqueAnton2016-09-041-2/+4
|
* fixed schema updateAnton2016-08-301-0/+1
|
* added sqlite table settings and updated schema versionAnton2016-08-301-1/+26
|
* Added item "Activate" in systray menu for Unityme_desk2014-10-261-0/+2
| | | | git-svn-id: svn://localhost/project_picapica/trunk@334 fb96df88-216d-11de-830c-f3023f12d8ac
* temporarily disabled DH parameter generation featureme_desk2014-08-171-2/+2
| | | | git-svn-id: svn://localhost/project_picapica/trunk@326 fb96df88-216d-11de-830c-f3023f12d8ac
* playing sound on new message arrival - added wav file, new class Sound, menu ↵me_desk2014-08-091-0/+4
| | | | | | item in systray menu for muting git-svn-id: svn://localhost/project_picapica/trunk@318 fb96df88-216d-11de-830c-f3023f12d8ac
* initial minimal working file transfer implementation, new class ↵me_desk2014-05-041-0/+4
| | | | | | FileTransferController git-svn-id: svn://localhost/project_picapica/trunk@306 fb96df88-216d-11de-830c-f3023f12d8ac
* fixed syntax errorme_desk2013-10-141-1/+1
| | | | git-svn-id: svn://localhost/project_picapica/trunk@286 fb96df88-216d-11de-830c-f3023f12d8ac
* fixed database update queryme_desk2013-10-141-1/+1
| | | | git-svn-id: svn://localhost/project_picapica/trunk@285 fb96df88-216d-11de-830c-f3023f12d8ac
* fixed DHParam directory for Windowsme_desk2013-10-131-1/+1
| | | | git-svn-id: svn://localhost/project_picapica/trunk@283 fb96df88-216d-11de-830c-f3023f12d8ac
* contacts now have type - temporary, regular, blacklisted. On incoming ↵me_desk2013-10-131-1/+3
| | | | | | connections from previously unknown peers new temporary contact record will be created git-svn-id: svn://localhost/project_picapica/trunk@278 fb96df88-216d-11de-830c-f3023f12d8ac
* better handling of DH parameter generation - added new class DHParam, ↵me_desk2013-10-111-2/+37
| | | | | | default DH param file dhparam4096.pem git-svn-id: svn://localhost/project_picapica/trunk@277 fb96df88-216d-11de-830c-f3023f12d8ac
* update from database schema 1 to 2 with importing old accounts and ↵me_desk2013-10-071-2/+152
| | | | | | converting them to the new id formats; implemented new function PICA_get_id_from_cert_string git-svn-id: svn://localhost/project_picapica/trunk@276 fb96df88-216d-11de-830c-f3023f12d8ac
* switched to TLS 1.2 and DHE-RSA-CAMELLIA256-SHA. DH parameters file is ↵me_desk2013-09-131-0/+15
| | | | | | created on first start git-svn-id: svn://localhost/project_picapica/trunk@273 fb96df88-216d-11de-830c-f3023f12d8ac
* global variable account_id is replaced with static members ↵me_desk2013-09-011-1/+0
| | | | | | Accounts::AccountRecord & Accounts::GetCurrentAccount() and SetCurrentAccount() git-svn-id: svn://localhost/project_picapica/trunk@268 fb96df88-216d-11de-830c-f3023f12d8ac
* updated pica-client to make it handle new id format. quint32 type for id is ↵me_desk2013-08-301-7/+7
| | | | | | replaced with QByteArray in most places. Implemented verification callbacks in client and node that allow self-signed certificates git-svn-id: svn://localhost/project_picapica/trunk@266 fb96df88-216d-11de-830c-f3023f12d8ac
* new seed node instance picapica.im:2233 for new protocol transitionsme_desk2013-04-211-1/+1
| | | | git-svn-id: svn://localhost/project_picapica/trunk@244 fb96df88-216d-11de-830c-f3023f12d8ac
* implemented database schema updateme_desk2013-02-211-76/+172
| | | | git-svn-id: svn://localhost/project_picapica/trunk@225 fb96df88-216d-11de-830c-f3023f12d8ac
* displaying history in chatwindowme_desk2013-01-201-1/+0
| | | | git-svn-id: svn://localhost/project_picapica/trunk@221 fb96df88-216d-11de-830c-f3023f12d8ac
* new class History for storing message history and undelivered messages ↵me_desk2013-01-121-0/+16
| | | | | | between restarts git-svn-id: svn://localhost/project_picapica/trunk@220 fb96df88-216d-11de-830c-f3023f12d8ac
* changes required to build pica pica on Windows in MSVS2008me_desk2012-09-131-1/+9
| | | | git-svn-id: svn://localhost/project_picapica/trunk@202 fb96df88-216d-11de-830c-f3023f12d8ac
* path to production CA certificate in pica-clientme_laptop2012-08-201-1/+1
| | | | git-svn-id: svn://localhost/project_picapica/trunk@180 fb96df88-216d-11de-830c-f3023f12d8ac
* seed nodes in pica-client's nodelist databaseme_laptop2012-08-201-0/+3
| | | | git-svn-id: svn://localhost/project_picapica/trunk@179 fb96df88-216d-11de-830c-f3023f12d8ac
* put pica-node executable in pica-node dir to avoid conflict (pica-node dir ↵me_desk2012-08-181-3/+3
| | | | | | and pica-node executable in same top_srcdir) git-svn-id: svn://localhost/project_picapica/trunk@167 fb96df88-216d-11de-830c-f3023f12d8ac
* todo list updateme_desk2012-06-171-0/+161
git-svn-id: svn://localhost/project_picapica/trunk@128 fb96df88-216d-11de-830c-f3023f12d8ac