Commit Graph

4314 Commits

Author SHA1 Message Date
iphydf
2e74db5447
Improve gtest finding, support local checkout.
Also fix library dependency order for monolith test.
2018-02-11 12:20:36 +00:00
iphydf
95029f412c
Build toxcore with libsodium.dll instead of libsodium.lib.
The .lib doesn't have debugging information. The .dll has a .pdb file
next to it.
2018-02-09 20:51:39 +00:00
iphydf
6cd4fcdec4
Remove libcheck from the dependencies.
We're not gaining much from this library, and it's a burden, especially
for windows development.
2018-02-09 20:51:39 +00:00
iphydf
05912fd65c
Add gtest include directory to -I flags if found.
Otherwise it won't be found when cross-compiling.
2018-02-09 20:36:54 +00:00
iphydf
a940f26293
Adopt the "change occurred" API change from isotoxin-groupchat.
The logic and behaviour remain the same, but PEER_EXIT and PEER_JOIN are
merged into LIST_CHANGED. This allows clients to take a first step to
adapt to the API change without us having to actually submit the full
change, yet.
2018-02-09 00:18:30 +00:00
Robin Lindén
0fbdb03f40
Add MSVC compilation instructions 2018-02-08 18:41:49 +01:00
iphydf
f2857932d2
Use the markdown GPLv3 license in the c-toxcore repo. 2018-02-08 16:08:09 +00:00
iphydf
0eeb16d031
Reject discovery packets coming from outside the LAN.
Even if that means rejecting packets from ourselves if our IP is not a
"LAN" IP.
2018-02-08 15:47:36 +00:00
iphydf
8a0e98bab8
Fix LAN discovery on FreeBSD.
Also, add an auto-test for bootstrap and for LAN discovery.

Bootstrap is never tested otherwise, and LAN discovery is a prerequisite
for everything else. Having these two tests lets us rule out or identify
LAN discovery as a possible cause for test failures.
2018-02-08 14:57:34 +00:00
iphydf
36ba80aacb
Remove csrc from the RTPHeader struct.
This is not used by anything in the code, so we shouldn't have it in the
header.
2018-02-08 13:20:40 +00:00
iphydf
3fcc9a3c83
Add some unit tests for util.h. 2018-02-08 12:54:39 +00:00
iphydf
dcd439a5c3
Make cmake script more forgiving.
Instead of hard-erroring when we don't find dependencies, we just don't
build the things requested and print a warning. This is less annoying to
users because we enable a bunch of things by default. This way, we can at
least build something with the default "cmake" invocation.
2018-02-06 20:22:33 +00:00
iphydf
835b9fbdc9
Improve stability of crypto_memcmp test.
Also reduce number of people in conference to 5, because on Circle CI the
test times out trying to connect more than 6 or 7 people. The persistent
conferences PR will improve this so we can set it much higher then.
2018-02-06 20:21:27 +00:00
iphydf
feaefbcbb3
Format .cpp files with format-source. 2018-02-06 13:44:03 +00:00
iphydf
52f6e4e7c5
Move tox_shell program to the toxins repository.
https://github.com/TokTok/toxins/tree/master/tox_shell
2018-02-06 13:06:22 +00:00
iphydf
a3a0e553f3
Move irc_syncbot to the toxins repository. 2018-02-06 11:45:50 +00:00
iphydf
f71ec8dd02
Move the tox_sync tool to the toxins repository. 2018-02-05 18:15:31 +00:00
sudden6
9f2582d699
use official debian domain 2018-02-05 14:23:31 +01:00
iphydf
f41c11c34e
Use more ubuntu packages; remove hstox for now.
Since trusty has more up-to-date packages, we can remove some of the
custom install code. Also, we're not using hstox at the moment, so there
is no need to slow down the builds for now.
2018-02-04 00:36:31 +00:00
Diadlo
99bfb9a4f2
Revert "Add correction message type"
This reverts commit e16d3894c5 and
commit c5976e37ea.
2018-02-02 15:00:43 +03:00
iphydf
83779a21ea
Manually serialise RTPHeader struct instead of memcpy. 2018-02-01 23:35:44 +00:00
iphydf
d9413d5576
Improve conference test stability. 2018-02-01 14:58:00 +00:00
iphydf
ba176f767a
Change the "capabilities" field to a "flags" field.
This is more appropriate for RTP headers. Capabilities may be negotiated
up front, but flags are useful in each packet.
2018-01-31 13:50:12 +00:00
iphydf
92ffad1a72
Use nullptr as NULL pointer constant instead of NULL or 0.
This changes only code, no string literals or comments.
2018-01-30 23:35:50 +00:00
iphydf
623e9ac331
Add RTP header fields for the full frame length and offset.
This also adds RTPCapabilities and a header field to tell the receiver
about capabilities used in encoding this frame. It is intended to contain
settings relevant to the current frame being sent.
2018-01-29 23:01:13 +00:00
iphydf
6f6c4dc2bd
Add -D__STDC_LIMIT_MACROS=1 for C++ code.
Without this, `UINT*_MAX` are not defined.
2018-01-29 22:14:21 +00:00
iphydf
6e0ac337c9
Avoid clashes with "build" directories on case-insensitive file systems. 2018-01-28 15:17:34 +00:00
xhe
651ef3adb6
Make audio/video bit rates "properties"
follow TokTok#731. This commit
completely removed all things in namespace bit_rate, and deprecated
functions are to be added back in another commit. set_xxx() is treadted
as a property of namespace audio&video, same as bit_rate change event.

toxav_basic_test is fixed, either.
2018-01-28 13:21:57 +00:00
sudden6
b9350bc459
Fix link in README.md 2018-01-27 22:29:24 +01:00
iphydf
9c03439ad0
Fix out of bounds read in error case in messenger_test.
Also got rid of two VLAs. They are overused a bit in toxcore. In
irc_syncbot, the array was uninitialised and then filled by a recv system
call. This can cause uninitialised reads if recv doesn't fill the entire
array. It could not cause out of bounds read directly, because a
NUL-terminator was in place, but both cases are undefined behaviour.
2018-01-26 01:30:06 +00:00
Maxim Biro
2a5941c9f9 Use Wine Staging for running Windows tests 2018-01-25 17:27:26 -05:00
Maxim Biro
c9ed0ae8cd Show source file name and line number on crash 2018-01-25 17:27:26 -05:00
Maxim Biro
6df9e05da2 Make Travis test Windows Dockerfile 2018-01-25 17:27:26 -05:00
Maxim Biro
e672b6f092 Add Dockerfile for Windows cross-compilation 2018-01-25 16:04:54 -05:00
Maxim Biro
29cd93a49c Update install instructions to use CMake 2018-01-25 16:04:53 -05:00
Maxim Biro
54a1ccf8ce Install runtime modules into bin directory
Runtime modules, such as executables and shared libraries should be
installed into "bin" instead of "lib".
2018-01-25 15:57:50 -05:00
Maxim Biro
5ef37e0b63 Prefix add_test() with $CROSSCOMPILING_EMULATOR
$CMAKE_CROSSCOMPILING_EMULATOR is automatically prefixing add_test()
in CMake versions starting 3.3[1], but because we target CMake 2.8, we
can't use that and we have to add our own $CROSSCOMPILING_EMULATOR that
will prefix add_test().

[1] https://cmake.org/cmake/help/v3.3/variable/CMAKE_CROSSCOMPILING_EMULATOR.html#variable:CMAKE_CROSSCOMPILING_EMULATOR
2018-01-25 15:57:50 -05:00
xhe
0becafd272
Split bit_rate_set(), one for audio, one for video.
Fixes #572.

As discussed in the issue, there's a risk that toxcore may not hold the
maximum bitrates libvpx supports, if toxcore insists on using integer
type. I initially proposed to have another flag in set(), so that we can
use unsigned type instead. iphydf came up with a better solution, that is
splitting the original functions, one for audio, one for video. Now, we
could safely replace int32_t with uint32_t.

Also: clean video_bit_rate_invalid()

Though this is not a part of issue #572, as it's used in the
toxav_bit_rate_set(), i cleaned the code. As mannol said, there should be
a check. Uint32_t is large enough to hold the maximum bitrates libvpx
supports, but user may pass a value larger than uint while smaller than
uint32_t. Thanks to the reminding from nurupo, it's no longer a stub
function.

Bitrate error enums are shared for both audio and video
https://github.com/TokTok/c-toxcore/pull/578#issuecomment-360095609, just
as iphydf said.
2018-01-25 14:29:01 +00:00
iphydf
cd8080f6d1
Rename some rtp header struct members to be clearer.
These are the names used in the next PR, in RTPHeaderV3, so here we
rename the old struct members already.
2018-01-25 09:42:01 +00:00
iphydf
a640ed106a
Remove dead return statement.
Turning this code:
```c
if (cond) { ... return 0; }
if (!cond) { ... return 0; }
return -1;
```
into:
```c
if (cond) { ... return 0; }
else { ... return 0; }
```

The `return -1` in the first variant can never happen.
2018-01-25 09:22:19 +00:00
iphydf
67cf395163
Disable the autotools build in PR builds.
We will only build this during the nightly build. It's very rare for the
autotools build to break when the cmake build does not.
2018-01-25 02:52:13 +00:00
iphydf
42636861d8
Publish a single public BUILD target for c-toxcore. 2018-01-22 21:18:24 +00:00
iphydf
8f1bbcf83e
Use <stdlib.h> for alloca on FreeBSD.
https://www.freebsd.org/cgi/man.cgi?alloca

If stdlib.h does not define alloca, and we're using GCC (or Clang), we
define the macro ourselves in terms of a GCC builtin.
2018-01-22 21:05:30 +00:00
iphydf
e6c04ef028
Use self-built portaudio instead of system-provided. 2018-01-22 00:44:19 +00:00
iphydf
033965b8cc
Make the monolith test a C++ binary.
This way, developers compile toxcore, toxav, and toxencryptsave as C++ at
least once at home, reducing the likelyhood of running into travis
failures where we compile as C++ in the windows build.
2018-01-21 20:56:30 +00:00
iphydf
52778aed93
Make BUILD files more finely-grained.
This allows us to precisely see which libraries depend on which and lets
us split them up more, if necessary.
2018-01-21 19:44:09 +00:00
iphydf
6c98791563
Add comment from #629 in ring_buffer.c. 2018-01-21 17:42:19 +00:00
iphydf
1cecb6c87a
Add BUILD files for all the little tools in the repo.
Also, fix av_test.c, since I broke it last time.
2018-01-21 01:31:11 +00:00
iphydf
822dd2fac2
Don't allocate or dereference Tox_Options in tests.
This struct will soon become opaque.
2018-01-21 00:14:43 +00:00
iphydf
98febe0589
Add testing/*.c (except av_test) to bazel build. 2018-01-20 19:32:12 +00:00