Commit Graph

58 Commits

Author SHA1 Message Date
iphydf
a9fbdaf46b
Do not use else after return.
http://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code
2016-09-02 11:02:56 +01:00
iphydf
77db27331e
Sort #includes in all source files. 2016-09-01 16:35:46 +01:00
iphydf
633da98ae6
Add braces to all if statements. 2016-08-31 20:04:16 +01:00
iphydf
dd8a568141
Make self_connection_status callback stateless.
**What are we doing?**

We are moving towards stateless callbacks. This means that when registering a
callback, you no longer pass a user data pointer. Instead, you pass a user data
pointer to tox_iterate. This pointer is threaded through the code, passed to
each callback. The callback can modify the data pointed at. An extra indirection
will be needed if the pointer itself can change.

**Why?**

Currently, callbacks are registered with a user data pointer. This means the
library has N pointers for N different callbacks. These pointers need to be
managed by the client code. Managing the lifetime of the pointee can be
difficult. In C++, it takes special effort to ensure that the lifetime of user
data extends at least beyond the lifetime of the Tox instance. For other
languages, the situation is much worse. Java and other garbage collected
languages may move objects in memory, so the pointers are not stable. Tox4j goes
through a lot of effort to make the Java/Scala user experience a pleasant one by
keeping a global array of Tox+userdata on the C++ side, and communicating via
protobufs. A Haskell FFI would have to do similarly complex tricks.

Stateless callbacks ensure that a user data pointer only needs to live during a
single function call. This means that the user code (or language runtime) can
move the data around at will, as long as it sets the new location in the
callback.

**How?**

We are doing this change one callback at a time. After each callback, we ensure
that everything still works as expected. This means the toxcore change will
require 15 Pull Requests.
2016-08-17 14:57:20 +01:00
irungentoo
6a494e2cbd
Astyle. 2015-11-03 13:42:05 -05:00
Eniz Vukovic
d6fdf16520 New Adaptive BR algorithm, cleanups and fixes 2015-10-10 23:54:23 +02:00
mannol
7d5de68364 Fixed CALL_STATE naming 2015-07-10 16:54:53 +02:00
mannol
6c126e34e6 Implement handling capability change on rtp level 2015-06-30 01:41:38 +02:00
mannol
2ecb71bb1e Renamed TOXAV_CALL_STATE to TOXAV_FRIEND_CALL_STATE 2015-06-27 17:28:07 +02:00
mannol
08bc4eb0e0 Added payload turning off by setting bit rate to 0 2015-06-27 01:55:28 +02:00
mannol
a3132feddb Fixed sample size in callback and other stuff 2015-06-13 15:00:34 +02:00
mannol
d694839d60 Rebased on master and removed alpha channel (again) 2015-06-05 22:14:37 +02:00
irungentoo
8e80ced6ce
Move savedata to options struct.
Add a way to select the type of savedata (normal savedata, load a
secret key, potentially others?) to load.
2015-05-22 18:23:56 -04:00
mannol
3100042a2b Updated with master 2015-05-22 23:22:31 +02:00
mannol
73fbc22961 Fixed inconsistencies 2015-05-07 23:14:03 +02:00
mannol
eb6e8aa290 Fixed* api comments and some bugs 2015-05-01 22:29:25 +02:00
mannol
b2b11f0fba Added many test and fixed various warnings 2015-04-30 00:40:30 +02:00
mannol
9bba7a0434 Done 2015-04-29 01:01:25 +02:00
irungentoo
45cf8a744c
Merge branch 'one_more_rename' of https://github.com/dubslow/toxcore into new_api 2015-03-18 16:15:36 -04:00
Dubslow
2f65de6fd1
Move get_connection_status to self pseudonamespace, to contrast friend_get_connection_status 2015-03-18 14:18:36 -05:00
Dubslow
3bf259f69d Convert core code depending on the api 2015-03-12 18:23:14 -05:00
irungentoo
76dfccf2d6
Ported some tests to the new api. 2015-02-25 21:09:14 -05:00
irungentoo
23d76f484a
Fixed memory leak in test. 2015-02-08 16:30:48 -05:00
irungentoo
d9ea6e9485
Properly free everything at the end of each test. 2015-02-07 22:57:04 -05:00
mannol
e62ded3a6d More av cleanup 2014-11-29 13:42:19 +01:00
irungentoo
279c33c01a
Merge branch 'master' of https://github.com/mannol/toxcore 2014-11-24 20:24:59 -05:00
mannol
386c9748d4 av refactor 2014-11-18 00:46:46 +01:00
pyruvate
ec9082f2c3 Remove DEFTESTCASE and DEFTESTCASE_SLOW redefinitions 2014-08-09 11:33:20 +03:00
irungentoo
0719a4296e
Merge branch 'mannol1-master' 2014-08-02 11:29:27 -04:00
mannol
6c1ac97da9 Added userdata pointer to audio/video callbacks 2014-08-02 01:09:33 +02:00
irungentoo
ab4673e873
Merge branch 'mannol1-master' 2014-07-26 21:26:32 -04:00
mannol
fc230c8671 Fixed tests and conflicts 2014-07-27 00:26:58 +02:00
mannol
54e7d29589 Make codec settings dynamic 2014-07-26 19:29:49 +02:00
irungentoo
6ede3e8ad4
Merge branch 'master' of https://github.com/mannol1/toxcore 2014-07-22 11:20:55 -04:00
mannol
0cf9f27b70 This should fix test failing 2014-07-21 22:11:59 +02:00
mannol
79115259a8 Fixed conflicts 2014-07-21 04:10:05 +02:00
mannol
1aeeef58b2 Improved protocol and cleaned code a bit 2014-07-21 01:10:57 +02:00
notsecure
c527979daa make autotests compile 2014-07-07 17:37:05 -04:00
irungentoo
65b4c026f4
The width and height set during the video encoder initialization is
now described as the maximum width and height of images.

This is to work around what appears to be a bug in libvpx where the
resolution of the stream can be decreased but increasing it above
its originally set value introduces memory corruption.
2014-07-05 14:36:19 -04:00
irungentoo
139cfa7aeb
Merge branch 'master' of https://github.com/mannol1/toxcore 2014-06-22 19:54:40 -04:00
mannol
6f46dd5afd Removed hamful code 2014-06-23 00:22:01 +02:00
irungentoo
2fa8815a85
Fixed some warnings. 2014-06-10 18:51:40 -04:00
irungentoo
9a4659e575
Replaced randombytes_salsa20_random_buf() with randombytes() in av tests. 2014-05-25 12:28:59 -04:00
irungentoo
82e38883a2
Merge branch 'mannol1-Multicalls' into multi-av 2014-05-25 12:27:48 -04:00
mannol
565e95301f Tests works and some fixes 2014-05-24 16:02:01 +02:00
mannol
843171fbc8 This works. 2014-05-16 19:56:40 +02:00
mannol
9bb910a370 This should work 2014-05-10 18:00:49 +02:00
mannol
0fa03b9240 Bunch of random changes 2014-05-03 01:46:03 +02:00
mannol
42b25a4d3e Yeah many calls 2014-04-27 19:21:26 +02:00
irungentoo
268172ec41
Pings and onion packets implemented in TCP_Client.c
Astyled one test and added a couple lines to another.
2014-04-12 22:00:46 -04:00