1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
Commit Graph

231 Commits

Author SHA1 Message Date
Diadlo
c3de6238ca
feat(camerasource): Change default video mode to preferred 2016-06-25 14:20:13 +03:00
Diadlo
1ddc1371a0
fix(videoframe): Added correct image copy 2016-06-25 14:20:13 +03:00
Nils Fenner
792103f8b0
refactor(filter_audio): completely remove filter_audio dependency
The filter_audio API is not working for qTox/Tox and thus disabled by default via compiler switch. In current qTox UI, it is not configurable, even when this switch is enabled. According to issue #3194 the library is no longer maintained as well. I don't see any reason to keep it in qTox.
2016-06-04 22:12:27 +02:00
Diadlo
e087398f56
fix(core): Added emit idSet after set NoSpam
Fix #1680.
2016-04-25 01:43:36 +03:00
sudden6
5339ad978b
fix(groupaudio): don't play audio while call is inactive
This also avoids logspam, because toxcore keeps recieving audio data
even if the call is inactive.
2016-04-24 14:34:49 +02:00
sudden6
afcd146a5b
fix(groupaudio): avoid deadlock when ending groupcall
The offending statement caused a deadlock, because the audioLock was
locked twice by the audio thread.
2016-04-24 14:34:49 +02:00
Nils Fenner
356543ca3b
feat(audio): add (repair) support for group audio calls 2016-04-24 14:34:49 +02:00
Nils Fenner
e5c7b3a4f6
refactor(audio): completely remove Audio class dependency from Core
The Audio singleton instance initializes itself on startup. No need for an extra call.
2016-04-24 14:34:49 +02:00
Polshakov Dmitry
343568339f
style(constructors): Constructors are explicit now 2016-04-20 22:53:27 +03:00
Diadlo
f28c3a16ae fix(core, widget): Added checks
Fix #3133.
* Added check, that core and coreAv exist, before use them
* Added check, that tox exit, before use them
2016-04-14 23:40:06 +03:00
sudden6
a89b673b40 Revert "Revert changes from merge of #2092 pull request"
This reverts commit 06611d618e.
2016-02-20 22:32:57 +01:00
tux3
ce2f8fd1d5
Cleanup and improve audio input
We now subscribe to an event and wait for frames when capturing audio
input, the big avdantage is that we only have to fetch the frames from
the hardware once, and we don't need to cache anything.
The frames are simply dispatched to the client's callbacks immediately.

Also removes some outdated ifdefs that did not apply anymore.
2016-01-23 16:45:25 +01:00
tux3
2654b6cbcd
Safer casts in Core::getGroupPeerNames 2016-01-21 16:51:25 +01:00
tux3
8253e1e395
Fix #1409: Don't save core if nothing really changed 2016-01-21 08:04:46 +01:00
tux3
0955843b8d
Merge branch 'pr2799' 2016-01-16 14:30:41 +01:00
tux3
c576a1485a
Scan-build cleanup 2016-01-16 02:24:13 +01:00
Zetok Zalbavar
ccfb81b2e4
Add some basic documentation about Tox ID in source
Lets not make plaintext gods angry by linking to a dead html page.
2016-01-14 20:21:00 +00:00
Nils Fenner
552155bd1f
Merge PR #2719 from antis81:fix_audio_subscriptions
* fix dangling audio output device
* do not resubscribe sid in copy constructor
2015-12-23 23:29:20 +01:00
Nils Fenner
0615c7c3c6
reimplement audio in/out subscription concept 2015-12-20 09:45:43 +01:00
Nils Fenner
27bfade9e1
unsubscribe invalid ToxCall from audio when copied 2015-12-20 09:45:43 +01:00
Nils Fenner
02f5f0a391
remove obsolete include of audio.h 2015-12-20 09:45:43 +01:00
Nils Fenner
08c43d0b83
cleanup OpenAL compatibility code in audio class 2015-12-20 09:45:43 +01:00
Nils Fenner
a1b87194b8
fix #2504
We need to filter samples * channels; also cleaned up data types
2015-12-20 09:45:43 +01:00
Nils Fenner
bb7d2a72b7
privatized audio interface 2015-12-20 09:45:22 +01:00
Nils Fenner
c23cb0043f
implement actual audio in/out subscription management 2015-12-20 09:42:14 +01:00
Nils Fenner
e7f666be77
un-/subscribe audio in/out in tox-call 2015-12-20 09:40:57 +01:00
Nils Fenner
efda47a226
close audio output in destructor 2015-12-20 09:40:57 +01:00
tux3
cbe8104576
Fix bad handling of empty avatars
Fixes #2694
2015-12-19 16:28:57 +01:00
tux3
b5cdfb3dce
Implement new SQLCipher based database and history
qTox will automatically import the old history on startup.

This new database code is much more robust.
It is very resilient and will not corrupt or disappear after a crash or
power failure, unlike the old code.
The on-disk database format is also much more compact now.

The database sync option in the advanced settings has been removed,
we know run many database operations asynchronously so performance
should not be a problem anymore, but we always ensure resiliency
in case of abrupt termination, so there is no tradeoff anymore.
2015-12-19 04:17:28 +01:00
tux3
ab8220c2cf
Remove stale TODO 2015-12-15 19:20:34 +01:00
tux3
cbade4bae6
Fix tiny memory leak on startup 2015-12-15 19:08:59 +01:00
tux3
63644050f3
Fix #2683
There is still an issue with the history keeping the old password, though
2015-12-14 23:27:12 +01:00
tux3
981588d630
Fix some avatars saved with the wrong name 2015-12-08 23:10:15 +01:00
tux3
9905042434
Fix wrong word in copypasted log message 2015-12-08 22:13:28 +01:00
tux3
b39f3eacb0
Clean unused getIDString() function 2015-12-05 19:09:20 +01:00
tux3
25ed3d4fba
Fix avatars for encrypted profiles
WARNING: Note that avatars for encrypted profiles are currently stored unencrypted!
2015-12-05 19:08:28 +01:00
tux3
a6bbd31b12
Retry sending audio frames on sync/lock error 2015-12-05 03:22:00 +01:00
tux3
333d10e6d5
Log type of audio send error 2015-12-05 02:35:11 +01:00
tux3
7f5f807bde
Fix filter audio
Fixes #2504

Fixes #2517

Fixes #1565
2015-12-04 18:20:47 +01:00
tux3
37075dbfb5
Improve video quality
Double the allowed bitrate, this is especially noticeable on desktop streaming. Desktop streaming is still completely broken, with what looks like iframes silently getting dropped on a regular basis.

Retry 5 times to send a frame when there's an internal toxav lock sync error, this allows us to drop way less frames.
2015-12-04 12:53:58 +01:00
tux3
db52ef6e6a
Disable buggy automatic bitrate adjustements
For some users on poor connections, toxav would suggest lower and lower bitratres until reaching zero and disabling audio/video entirely, toxav would then not raise the bitrate back and the only way to re-enable audio/video would have been to change A/V sources or restart the call

We now log toxav's recommendation, but ignore it
2015-11-14 23:51:30 +01:00
Zetok Zalbavar
cfea4675d7
Don't show in debug output nicks
They can contain personal info.
2015-11-14 20:11:37 +00:00
tux3
523e419adf
Fix theoritical A/V deadlock
Could only be hit by pausing at a key point in a debugger until the call timed-out.

Having one thread going up the call stack and acquiring locks (toxcore callbacks), while another thread goes down taking locks in the other order (CoreAV calling toxav functions) creates some pretty freezy situations.

The deadlock was caused by the GUI thread calling the CoreAV thread, acquiring the CoreAV callback, then right before calling a toxav function, not schedule the thread until the call times out. At this point the toxcore thread fires its state callback to tell us the call is over, locking internal toxcore/toxav mutexes, it reaches our callback function which tries to switch to the CoreAV thread to clean up the call data structures, but has to wait since the CoreAV thread holds its own lock. At this point if we resume the CoreAV thread, it'll be busy calling into a toxav function, which tries to acquire internal toxav locks, those locks are held by the toxcore callback so we deadlock.

Our solution is that when getting a toxcore callback, we immediately switch to a temporary thread, allowing toxcore to release the locks it held, and that temporary thread tries to switch to do work on call data structures. Meanwhile if the CoreAV thread needs internal toxcore locks, it can get them.
2015-11-08 00:32:32 +01:00
tux3
7dc608818c
Automatic AV bitrate management
Makes progress on #2134
2015-11-06 23:05:51 +01:00
tux3
d41a578735
Fix crash on audio -> video call promotion
We just ignore it and not show the received video for now.
Fixes #2505
2015-11-06 20:47:42 +01:00
tux3
b4754c6ac2
Fix inconsistent noexcept in toxcall.cpp 2015-11-06 01:49:54 +01:00
tux3
f107858252
Properly exit CoreAV thread 2015-10-25 13:53:04 +01:00
tux3
c902543ae4
Fix call race leading to deadlock and memory leak
A call cancel/accepted race was locking up both UI and AV threads, while the stream thread was shoveling more and more video frames on the AV thread's event queue
2015-10-25 00:17:45 +02:00
tux3
a776579732
Don't assert if a call dies while we answer it
This error condition only happens when a peer cancels its outgoing call in the middle of us answering it. We can simply ignore the error and things should nicely fall back into place. Since this race should be pretty rare in normal usage, it's nice to leave a log message, as it might mean we're being fuzzed.

We can prograssively replace more of those asserts by fallbacks and log messages now that everything has been shown to work fine, and the race conditions are harmless.

I feel like writing a novel today. Good thing nobody looks at these!
2015-10-24 21:41:19 +02:00
tux3
37e2d2e75f
CoreAV: Fix BlockingQueued connections deadlock
Having a deadlock problem? The solution is more locks!
2015-10-24 15:35:08 +02:00
tux3
c0d8703368
Properly signal when we stop sending video
And properly handle toxav happily delivering things out of order,
like firing a video frame callback right after a callback setting the bitrate to 0,
when the peer sent these commands in the right order
2015-10-24 04:26:39 +02:00
tux3
aaf04a80db
Remove some debug output 2015-10-24 02:46:34 +02:00
tux3
1dc7e4cca5
Add 45s call ringing timeout 2015-10-24 01:53:10 +02:00
tux3
8d2ae07c9f
Revert "Delete CoreAV from the Core thread"
This reverts commit 1f758efc2f.
2015-10-23 20:05:35 +02:00
tux3
ae243b2089
Delete CoreAV's timer from the CoreAV thread 2015-10-23 20:05:30 +02:00
tux3
1f758efc2f
Delete CoreAV from the Core thread
Since it was created there

Fixes #2457
2015-10-23 19:42:39 +02:00
tux3
4d9aeeec39 Fix bitrate callback to match toxav update 2015-10-23 17:52:46 +02:00
tux3
6dc91b156a Use actual mutexes for CameraSource
That homemade spinlock thing was insane, VTune says we were spending 1.5s spinning for no reason when openning a device for example
2015-10-23 17:52:46 +02:00
tux3
477554ffba Clean up callback hell between AV UI and CoreAV 2015-10-23 17:52:46 +02:00
tux3
a505e06f83 Multithread CoreAV
This is a little less insane, gives an overall 2x speedup on debug builds video calls
2015-10-23 17:52:45 +02:00
tux3
41e0212f77 Cleanup UI/CoreAV interface 2015-10-23 17:52:45 +02:00
tux3
73a4f40744 Fix call start/call invite race condition
Would result in an assert failure
2015-10-23 17:52:45 +02:00
tux3
1db17ae1ec Fix crash due to erase/remove typo
A race condition would result in trying to remove an element that didn't exist, and thus erasing end (undefined behavior) instead of erasing [end, end) (no-op)
2015-10-23 17:52:45 +02:00
tux3
f45256baf1 Implement group calls 2015-10-23 17:52:45 +02:00
tux3
6cbd507ca8 Clean up dead code in CoreAV 2015-10-23 17:39:08 +02:00
tux3
69b8a90277 Implement video calls 2015-10-23 17:39:08 +02:00
tux3
e0aa8dd4a2 Implement audio calls 2015-10-23 17:39:08 +02:00
tux3
2b888ddc05 Better data structure for tox calls 2015-10-23 17:19:16 +02:00
tux3
512dc8de2d Implement basic call logic
We can now make New AV calls, but without any audio/video. Just opening a link.
2015-10-23 17:09:53 +02:00
tux3
dbbc702c60 Strip out old AV code 2015-10-23 17:02:01 +02:00
Nils Fenner
33e54b841a
Merge pull request #2415 from antis81:ngf/mic 2015-10-21 22:19:37 +02:00
Zetok Zalbavar
c07aee18ad
Merge pull request #2346 from PKEv:save_avatar_in_DB
Save avatar in DB
add import avatars
update delete avatar action
correct import avatar for user without history
add multithreaded
make import run once
2015-10-20 21:01:20 +01:00
Nils Fenner
b7cf4df13f
Get rid of static methods and bugs 2015-10-20 03:46:44 +02:00
Nils Fenner
2a2cba3cf2
remove outcommented code 2015-10-18 22:21:08 +02:00
TheSpiritXIII
dc2c6532a5
Audio: Fix unclosed audio when hanging up 2015-10-18 22:21:08 +02:00
TheSpiritXIII
bbbd450b6a
Audio: Only open mic when requested 2015-10-18 22:21:08 +02:00
TheSpiritXIII
a311b96376
Audio: Open output only when necessary 2015-10-18 22:21:08 +02:00
agilob
7117083e86
Merge remote-tracking branch 'origin/new_video_view' 2015-10-18 20:55:01 +01:00
PKEv
e5a5074f91 make import run once
and rename function
2015-10-18 22:15:49 +03:00
PKEv
ec5e9c7350 correct import avatar for user without history 2015-10-18 16:50:00 +03:00
PKev
dd975c38eb Save avatar in DB
Partially addresses an issue #1656
2015-10-14 22:16:59 +03:00
agilob
7c6ac40d21
add debugging messages to camerasource, code reformatting to make it more readable and ogranized better 2015-10-11 07:38:44 +01:00
Impyy
98c21f3832 Added a context menu to edit/remove the avatar 2015-10-05 22:03:31 +02:00
tux3
c0e2b91fe8
Fix #2310 caused by #2309 2015-09-27 23:45:02 +02:00
Impyy
c49ce6208e Load user status from data file 2015-09-25 20:56:11 +02:00
tux3
6229e045f2
Merge branch 'pr2223'
Fixes #659
2015-09-14 19:51:10 +02:00
PKEv
564b32eb7c save alias 2015-09-14 20:10:35 +03:00
tux3
8fbc0c8b59
Remove some debug output fluff 2015-09-06 00:11:47 +02:00
Zetok Zalbavar
06611d618e
Revert changes from merge of #2092 pull request
That pull request made qTox crash in a number of ways, with no quick fix
available.

Hopefully there will be a way to fix crash, so that this commit could be
reverted, and fix applied.
2015-08-30 21:28:53 +01:00
agilob
d6b176d955
Merge remote-tracking branch 'TheSpirit/requests'
merge awaiting friend requests, fix formatting conflict
2015-08-30 14:25:46 +01:00
TheSpiritXIII
2043908e15 Remove dialog for group invites 2015-08-21 10:32:00 -04:00
Zetok Zalbavar
2088c26028
Better wording for accepting / rejecting avatars 2015-07-28 11:11:58 +01:00
Jookia
7fab49d665 core: TOX_ERR_NEW_LOAD_BAD_FORMAT is non-fatal.
This fixes errors from save migrations between versions and architectures.
2015-07-12 23:58:40 +10:00
PKev
4682814442 fix the names in the history
fix #1943 #1787
2015-06-30 16:56:38 +03:00
tux3
645b1e5566
Fix raciness of encryption API
And make it saner by not having one global password that has to be set before encrypting/decrypting, which is as racy and poorly designed as it gets

Fixes #1917 's immediate symtoms, which some potential for other regressions due to the mess that is encrypted persistence currently
2015-06-27 21:14:35 +02:00
tux3
2ab55568f2
Make the video code a singleton, fix multithreading bugs
There can now only be one CameraSource running.

Video frames are decoded in their own thread, and then converted by users in the user's threads.
The CameraSource API is entirely thread-safe and controls the video decoding thread.

The video device only stays open as long as there are users subscribed to the CameraSource.

We use a dangerous combination of spinlocks and memory fences to keep things synchronized.
2015-06-26 18:34:48 +02:00
TheSpiritXIII
858b005567 Circles: Fix memory leaks and extraneous saving 2015-06-26 10:54:49 +02:00
TheSpiritXIII
c662c0aa92 Update activity on friendship, fix category friend removing (circles and activity) 2015-06-26 10:54:49 +02:00
TheSpiritXIII
ac2263b3e8 Save circle settings after each modification 2015-06-26 10:54:00 +02:00
Daniel Hrabovcak
e0b9e81938 Minor circle widget base class cleanup 2015-06-26 10:54:00 +02:00