Commit Graph

583 Commits

Author SHA1 Message Date
iphydf
abc17b0f89
Factor out time keeping code into its own module: mono_time.c.
It turns out, `unix_time` is also monotonic, and is used as such, so I've
renamed the new functions to `mono_time_*`.

2018-07-08:
```
00:01 <@irungentoo> the idea used to be that the unix_time() function
  could go backward in time but I think I might have started using it like
  if it could not after I changed it so that it would never go back in time
```
2018-07-09 21:04:50 +00:00
iphydf
c0c3098737
Avoid side-effectful assignments in conditionals.
Only in audio.c for now. This should be done everywhere.
2018-07-08 19:34:45 +00:00
iphydf
b3889f0f05
Remove VLA usage from send_audio_packet.
Also use `net_pack_u16` in that function instead of manual ntohs+memcpy
and `net_unpack_u16` in its receiving counterpart.
2018-07-08 13:59:37 +00:00
iphydf
08ff19a63b
Call the "peer leaves" callback only once on group delete.
We used to pass the actual peer numbers of peers leaving, but we no
longer know these in the PGC world, so we don't pass them anymore.
2018-07-07 16:02:00 +00:00
iphydf
3ef1f839fc
Add some tests for our ring_buffer implementation.
These can serve as documentation until we write actual api docs, probably
using apidsl.
2018-07-04 10:37:46 +00:00
iphydf
29b2dd6315
Use clang-format for C++ code.
`clang-format -style='{BasedOnStyle: Google, ColumnLimit: 100}'`
2018-06-24 20:17:53 +00:00
iphydf
8e00294b3c
Add Logger to various net_crypto functions.
In preparation for adding log statements.

Also, fix an uninitialised variable warning in cppcheck.
2018-06-24 19:17:32 +00:00
Robin Lindén
2f80e2206c
Only check full rtp offset if RTP_LARGE_FRAME is set 2018-06-16 22:50:07 +00:00
iphydf
be797d4b03
Move system header includes from network.h to network.c 2018-05-20 15:42:42 +00:00
Maxim Biro
7d399cedcf
Improve network error reporting on Windows
Windows doesn't report network errors though errno, it has its own facilities.
2018-04-17 19:07:50 -04:00
iphydf
aa05095419
Remove the use of the 'hh' format specifier.
It's not supported in mingw.

See https://github.com/TokTok/c-toxcore/issues/786.
2018-03-16 01:57:26 +00:00
Robin Lindén
5600251efe
Don't set RTP_LARGE_FRAME on rtp audio packets 2018-03-09 17:18:39 +00:00
Robin Lindén
5da8c8d5de
Don't throw away rtp packets from old Toxcore 2018-03-09 17:06:41 +00:00
iphydf
d3b286cb43
Fix a bunch of compiler warnings and remove suppressions. 2018-02-24 22:20:22 +00:00
sudden6
03b55cde1a
make groupnumber uint32_t
fixes #606
2018-02-20 20:58:54 +01:00
zoff99
721358208b
Improve video key frame sending.
This change does not include the addition of VP9. We do that in a
separate pull request.

Changes:

* fix the video bug (video frames larger than 65KBytes) by sending full
  frame length in alternate header field
* improve video frame reconstruction logic with slots
* configure video encoder and decoder to be multihtreaded
* set error resilience flags on video codec
* change encoder and decoder softdeadline
2018-02-11 23:31:46 +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
feaefbcbb3
Format .cpp files with format-source. 2018-02-06 13:44:03 +00:00
iphydf
83779a21ea
Manually serialise RTPHeader struct instead of memcpy. 2018-02-01 23:35:44 +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
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
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
42636861d8
Publish a single public BUILD target for c-toxcore. 2018-01-22 21:18:24 +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
656040027d
Add some explanatory comments to the toxav audio code.
By @zoff99.
2018-01-19 22:27:04 +00:00
iphydf
1a4e56397b
Use more descriptive names in bwcontroller. 2018-01-19 21:03:48 +00:00
iphydf
f1d726a3a8
Extract named constants from magic numbers in toxav/audio.c.
By @zoff99.
2018-01-19 20:20:36 +00:00
iphydf
0a5be3cbc5
Use C99 standard in bazel builds. 2018-01-18 21:52:31 +00:00
iphydf
18a33169b8
Add bazel build scripts for c-toxcore.
This allows us and users to reproducibly build verified versions of the
library with checksums. It will power the toktok-stack continuous build
with checked-in checksums at specific git revisions.
2018-01-18 16:11:52 +00:00
iphydf
da739a9438
Add random_u16 function and rename the others to match. 2018-01-14 21:08:02 +00:00
endoffile78
f4ba43c81b
Remove useless if statement 2018-01-13 16:01:43 +00:00
iphydf
54ec162558
Fix formatting in some C files.
Also replace &(x) with &x for consistency.
2018-01-10 18:57:37 +00:00
mannol
e996a030f0
Split video payload into multiple packets when >65k
This is the implementation of the [proposed fix](https://github.com/TokTok/c-toxcore/issues/620#issuecomment-346902071) for [this issue](https://github.com/TokTok/c-toxcore/issues/620).
2017-12-17 16:31:23 +01:00
yangfl
2651193b99
Fix typo 2017-11-19 23:52:23 +01:00
iphydf
1e8fa85aad
Add a monolith_test that includes all toxcore sources.
This requires that every symbol, even if static (file-scope), is unique.
The idea is that we can easily run "whole" program static analysis on
programs that include monolith.h ("whole" is in quotes, as we don't
include dependencies like libsodium in this static analysis).
2017-06-04 17:48:23 +00:00
Diadlo
b19a9e5464
Add part of platform-independent network API implementation
socket      -> net_socket
htons       -> net_htons
htonl       -> net_htonl
connect     -> net_connect
sendto      -> net_sendto_ip4
getaddrinfo -> net_getipport
sa_family_t -> Family
2017-02-26 23:16:16 +03:00
iphydf
6ae33c16cf
Add VLA compatibility macro for C89-ish compilers. 2017-01-28 20:49:12 +00:00
Diadlo
f00006cf1d
Add platform-independent Socket and IP implementation 2017-01-26 23:11:15 +03:00
iphydf
8f96ca6d86
Update license headers and remove redundant file name comment.
"All rights reserved" was incorrect. The project was licensed under GPL3,
which means a lot of rights are licensed to everybody in the world, i.e.
not reserved to the "Tox Project".
2017-01-19 00:01:44 +00:00
Sergey 'Jin' Bostandzhyan
3f24f04876 Setup autotools to read .so version info from a separate file
We want to use the same libtool style .so versions in both build systems,
ideally both systems should read the version information from the same
configuration file.

This commit introduces an so.version configuration file and sets up
the autotools to use it.

The version numbers in so.version define the ABI compatibility and should be
updated prior to each release.

implements #323
2017-01-18 11:20:07 +01:00
mannol
7122d2e862 Use after free reported in #278 occurs because toxav_kill()
calls msi_kill() (toxav.c:180) which frees msi_call instances (msi.c:161)
which are then used when call_remove() (toxav.c:1136) is called.
This fix prevents call_remove() from calling invalid pointer.

Fixes #278
2016-12-21 00:16:22 +01:00
Gregory Mullen (grayhatter)
d66b3eabd5
rename messenger function, prepend m_ 2016-12-03 13:21:27 -08:00
Maxim Biro
551660a64a Fix a memory leak in GroupAV 2016-11-20 20:51:48 -05:00
Maxim Biro
44ac196936 Fix NULL pointer dereference in log calls 2016-11-20 20:32:48 -05:00
iphydf
3bc5ad1c13 Add NONE enumerator to bit mask. 2016-11-20 16:38:30 +00:00
iphydf
a1af74fb7a
Rename some internal "group chat" things to "conference".
This is to allow new group chats to coexist with old group chats. We do
not rename everything in group.[ch] to conference, yet, because it's not
currently necessary, and a general internal API overhaul is due at some
point anyway.
2016-10-29 22:37:03 +01:00
Dmytro Vorobiov
59d27e6d94 toxav renaming: group.{h,c} -> groupav.{h,c}
toxav file for "group" conflicts with toxcore "group" file. While this
works fine in almost all cases, Xcode on macOS is confused with that.
2016-10-28 22:11:48 +02:00
iphydf
b8b9789a69
Rebuild apidsl'd headers in cmake.
- Moved apidsl headers next to their generated versions. In the future,
  perhaps all (or most) headers will be apidsl-generated, so the sources
  should stay together.
- Try to find apidsl/apigen binary and astyle binary and use it for the
  format test. Don't run the format test if these can't be found.
2016-10-02 23:54:03 +01:00
iphydf
6d2b85ed06
Minor documentation fixes.
- Fixed incorrect parameter names (documented name didn't match code
  name).
- Removed `@return` from functions that return `void`.
- Make sure every parameter is documented. This required moving the
  planes and strides documentation to the function docs.
2016-10-01 11:17:57 +01:00
iphydf
1977d56caa
Remove return after no-return situation (and other cleanups).
Cleanups:
- Fix header guards to not use reserved names.
- Avoid name shadowing.
- Removed an unused variable found by avoiding name shadowing.
2016-09-30 19:06:44 +01:00
Gregory Mullen (grayhatter)
51139a080c
v0.0.0 => v0.0.1 2016-09-28 12:12:39 -07:00
iphydf
d369448ace
Work around bug in opencv3 headers.
OpenCV 3.1 doesn't define cvRound in C, only in C++. Thus, we now need
to compile av_test as C++ code.
2016-09-25 01:58:51 +01:00
iphydf
f60900c4b8
Move ring buffer out of toxcore/util into toxav.
Toxcore itself doesn't use this data structure. Only toxav does, so now
toxav owns the code for it.
2016-09-24 23:36:50 +01:00
iphydf
15cb426166
Make toxcore code C++ compatible.
It is still C code, so still compatible with C compilers as well. This
change lets us see more clearly where implicit conversions occur by
making them explicit.
2016-09-24 21:53:50 +01:00
iphydf
0d347c2b2e
Minor cleanups: unused vars, unreachable code, static globals.
- All global variables should be static unless they have an explicit
  extern declaration in a header file.
- `to_compare` was not used in encryptsave and toxav tests.
- `break` in switch cases is not required directly after `return`,
  `goto`, or a noreturn function like `abort`.
2016-09-24 20:52:09 +01:00
iphydf
b588e0fdd3
Replace void* with RingBuffer* to avoid conversions.
`vbuf_raw` is always a `RingBuffer*` so there is no need to pretend it
could ever be anything else (as indicated by it being a pointer to
void).
2016-09-23 11:41:11 +01:00
iphydf
51d18236c8
Revert "Make ToxAV stateless"
This reverts commit 21f8db12c4.

It is currently broken. Incoming call callbacks are not invoked, and
instead the client goes offline immediately.
2016-09-19 21:53:40 +01:00
Gregory Mullen (grayhatter)
21f8db12c4
Make ToxAV stateless 2016-09-17 14:05:51 -07:00
iphydf
1494e474dd
Ensure that all TODOs have an owner.
In the future, all TODOs added either need a bug number (TODO(#NN)) or a
person's github user name. By default, I made irungentoo the owner of
all toxcore TODOs, mannol the owner of toxav TODOs, and myself the owner
of API TODOs.
2016-09-16 12:06:02 +01:00
iphydf
a8823830d3
Add some astyle options to make it do more.
It now enforces a bit more formatting. In particular, padding inside
parentheses is removed. I would like it to remove padding after unary
operators, but there seems to be no option for that.
2016-09-13 01:07:02 +01:00
iphydf
0aa2840164
Group #include directives in 3-4 groups.
1. Current module (if C file).
2. Headers from current library.
3. Headers from other library (e.g. toxcore includes in toxav).
4. System headers.
2016-09-13 00:32:02 +01:00
iphydf
406d292107
Minor cleanups: header reordering, adding {}.
I hadn't done this for the "fun" code, yet. Also, we should include
system headers after our own headers.

"In general, a module should be implemented by one or more .cpp files.
Each of these .cpp files should include the header that defines their
interface first. This ensures that all of the dependences of the module
header have been properly added to the module header itself, and are not
implicit. System headers should be included after user headers for a
translation unit."
-- http://llvm.org/docs/CodingStandards.html#a-public-header-file-is-a-module
2016-09-09 19:30:50 +01:00
iphydf
59075ba325
Use const for version numbers.
ApiDSL generates the lowercase function declarations for us and puts them in the
right namespace (TOX_, TOXAV_).
2016-09-09 10:05:12 +01:00
iphydf
54de13c1c7
Fix compilation for Windows.
- Mingw32 didn't read MSDN, so behaves badly despite lean and mean.
- Avoid alignment issues on windows with packed bitfields in the RTP header.
  This change makes the program ill-formed in C99, but I don't know the correct
  fix at the moment, and I don't want to keep the Windows build broken for too
  long.
2016-09-08 11:37:35 +01:00
iphydf
d5f9344847
Remove the packet mutation in toxav's bwcontroller.
1. This mutation is never observed outside the function.
2. If it were (it's not), it would be undefined behaviour, since the
   packet data goes out of scope a few instructions after the callback
   returns.
2016-09-08 11:10:25 +01:00
Jfreegman
27a1626084
Comment intentional switch fallthroughs 2016-09-07 17:48:01 -04:00
iphydf
ad26560516
Improve static and const correctness.
- Any non-externally-visible declarations should be `static`.
- Casting away the `const` qualifier from pointers-to-const is
  dangerous. All but one instance of this are now correct. The one
  instance where we can't keep `const` is one where toxav code actually
  writes to a chunk of memory marked as `const`. This code also assumes
  4 byte alignment of data packets. I don't know whether that is a valid
  assumption, but it's likely unportable, and *not* obviously correct.
- Replaced empty parameter lists with `(void)` to avoid passing
  parameters to it. Empty parameter lists are old style declarations for
  unknown number and type of arguments.
- Commented out (as `#if DHT_HARDENING` block) the hardening code that
  was never executed.
- Minor style fix: don't use `default` in enum-switches unless the number
  of enumerators in the default case is very large. In this case, it was
  2, so we want to list them both explicitly to be warned about missing
  one if we add one in the future.
- Removed the only two function declarations from nTox.h and put them
  into nTox.c. They are not used outside and nTox is not a library.
2016-09-06 11:54:37 +01:00
iphydf
5b57ab6332
Improve C standard compliance.
- Don't cast between object and function pointers.
- Use standard compliant `__VA_ARGS__` in macros.
- Add explicit `__extension__` on unnamed union in struct (it's a GNU
  extension).
- Remove ; after function definitions.
- Replace `const T foo = 3;` for integral types `T` with `enum { foo = 3 };`.
  Folding integral constants like that as compile time constants is a GNU
  extension. Arrays allocated with `foo` as dimension are VLAs on strictly
  compliant C99 compilers.
- Replace empty initialiser list `{}` with zero-initialiser-list `{0}`.
  The former is a GNU extension meaning the latter.
- Cast `T*` (where `T != void`) to `void *` in format arguments. While any
  object pointer can be implicitly converted to and from `void *`, this
  conversion does not happen in variadic function calls.
- Replace arithmetic on `void *` with arithmetic on `char *`. The former
  is non-compliant.
- Replace non-`int`-derived types (like `uint16_t`, which is
  `short`-derived) in bit fields with `int`-derived types. Using any type
  other than `int` or `unsigned int` (or any of their aliases) in bit
  fields is a GNU extension.
2016-09-06 11:09:10 +01:00
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
579bdc126f
Remove useless casts.
These casts are either completely useless (casting T to T) or implicit (x = y).
2016-09-01 18:49:49 +01:00
iphydf
77db27331e
Sort #includes in all source files. 2016-09-01 16:35:46 +01:00
iphydf
45d1f9acb9
Match parameter names in declarations with their definitions.
The parameter names were taken from function definitions to update the names in
function declarations (prototypes).
2016-09-01 14:54:17 +01:00
iphydf
3a9300368d
Add newlines because astyle wants them.
We'll revert this once we move to clang-format.
2016-08-31 20:54:20 +01:00
iphydf
633da98ae6
Add braces to all if statements. 2016-08-31 20:04:16 +01:00
iphydf
13ae9e9a93
Move logging to a callback.
This removes the global logger (which by the way was deleted when the first tox
was killed, so other toxes would then stop logging). Various bits of the code
now carry a logger or pass it around. It's a bit less transparent now, but now
there is no need to have a global logger, and clients can decide what to log and
where.
2016-08-27 01:16:14 +01:00
iphydf
6935643f9a
Fix some compiler warnings. 2016-08-18 17:10:15 +01:00
iphydf
b5cfd33340
Add and use CMake build script
Also, fix the hstox build that was taking half an hour. It now takes 5 minutes.
Also, perform distcheck on travis to ensure that make dist works. It's not
actually failing the build at the moment due to broken tests.
2016-08-12 01:13:11 +01:00
iphydf
459f8f2013
Check code formatting on Travis.
We run astyle on Travis and check if there is a diff. The build terminates if
git finds a difference.
2016-08-12 01:00:00 +01:00
iphydf
fc330c1fa5
Silence/fix some compiler warnings.
Some of these (like the incompatible pointers one) are really annoying for
later refactoring.
2016-08-10 13:52:40 +01:00
derive
13fc00cc1b Added astyled toxav.h to match toxav.in.h 2016-03-09 15:52:31 +13:00
Gregory Mullen (GrayHatter)
9628f9d171 added the dropped ; 2016-02-13 20:53:30 -08:00
Gregory Mullen (GrayHatter)
ea21a541ff missed a line tox to toxav 2016-02-13 20:50:01 -08:00
Gregory Mullen (GrayHatter)
96bf594be5 update the compatablity function to match the macro 2016-02-13 20:44:30 -08:00
Gregory Mullen (GrayHatter)
2d361228cd SemVer toxav too 2016-02-13 20:23:29 -08:00
Eniz Vukovic
bd62c6a359 Fix issue #1497 2016-01-13 23:14:51 +01:00
irungentoo
1d91699e8e
Fixed use of it after free. 2015-12-15 15:12:38 -05:00
Eniz Vukovic
96a7b7b4fc Fix error reporting in toxav_call() 2015-11-29 00:38:33 +01:00
irungentoo
74f2fa00c2
Merge branch 'master' of https://github.com/helium-software/toxcore 2015-11-19 14:43:09 -05:00
irungentoo
4df59de504
Mannol toxav fix. 2015-11-17 18:41:00 -05:00
Tibor Stolz
edbfca5474 fix BWController misspelling 2015-11-11 10:33:03 +01:00
Jfreegman
c019c6236e
Prevent debug message from spamming stdout 2015-11-04 21:00:00 -05:00
irungentoo
6a494e2cbd
Astyle. 2015-11-03 13:42:05 -05:00
Eniz Vukovic
ca4214bbcf Fix compile error on mingw 2015-11-03 00:08:46 +01:00
Eniz Vukovic
fa0c87fa55 Revert "Removed mutex operations" 2015-10-31 14:53:20 +01:00
Eniz Vukovic
e730bd54e6 Fix possible misalignment of RTP header 2015-10-26 22:29:23 +01:00
mannol
caa0382877 Fix misplaced log message. 2015-10-24 16:22:56 +02:00
Eniz Vukovic
87828a1b42 Add synchronization protection for send_frame API functions 2015-10-24 01:56:49 +02:00
Eniz Vukovic
7972db5c41 Removed mutex operations 2015-10-23 22:56:54 +02:00
irungentoo
d012bb1e8e Added mutex lock+unlock.
Should it be also added to the other parts of this function?
2015-10-23 22:54:22 +02:00
irungentoo
d8a85d9a78 Fixed error in last commit. 2015-10-23 22:54:22 +02:00
irungentoo
b23819a4d1 Fixed some memory related bugs. 2015-10-23 22:54:22 +02:00
mannol
4f3be9f354 Fix docs 2015-10-23 22:54:22 +02:00
Eniz Vukovic
90b1ca8727 Fix setting resolution for vpx v1.4 (or newer i suppose) 2015-10-23 22:53:56 +02:00
Eniz Vukovic
363771ea3c Fix typo and change logger config option 2015-10-13 00:35:46 +02:00
Eniz Vukovic
bb67d9b273 Return removed groupchats code 2015-10-12 22:30:55 +02:00
Eniz Vukovic
8f130b6f25 Remove old comment 2015-10-11 00:41:34 +02:00
Eniz Vukovic
b93322242a Update 2015-10-10 23:56:05 +02:00
Eniz Vukovic
d6fdf16520 New Adaptive BR algorithm, cleanups and fixes 2015-10-10 23:54:23 +02:00
krobelus
4ca82235a0 typo 2015-08-18 21:28:25 +02:00
mannol
bf5e9b89d2 Fix bug in codec initialization 2015-08-13 00:19:24 +02:00
mannol
c641b0fceb Updated with upstream 2015-08-09 12:39:21 +02:00
mannol
0be0e88f3e Remove empty lines 2015-08-09 12:02:52 +02:00
mannol
12d3f9396b Fix possible double free 2015-08-09 11:57:39 +02:00
mannol
6ab4308581 Apply OPUS codec fixes 2015-08-08 18:01:36 +02:00
mannol
3c8cae72d0 Removed redundant function from video.[h|c] 2015-08-08 17:45:24 +02:00
mannol
657a57b406 Fixed memory leak during session cleanup and fixed naming. 2015-08-07 02:04:04 +02:00
irungentoo
87c9ac242b
Merge branch 'Opus-Codec-Settings' of https://github.com/JasonLocklin/toxcore 2015-07-31 23:36:19 -04:00
Jason Locklin
f05fdae055 added documentation 2015-07-31 11:11:32 -04:00
Jason Locklin
ef086a5897 Set packet loss percentage
Make the Codec resistant to up to 10% packet loss (default 0) at the expense of some bandwidth.  10% is aggressive (1-5% should be typical for voip systems, but can be higher when users are on WiFi connections. This could also be adjusted on the fly, rather than hard-coded, with feedback from the receiving client.
2015-07-31 11:08:51 -04:00
Jason Locklin
bcb864af4a Enable in-band FEC
In-band FEC can be used with OPUS_APPLICATION_VOIP to improve Codec robustness to packet loss and corruption. It is disabled by default:

http://opus-codec.org/docs/html_api-1.0.1/group__opus__encoderctls.html#ga5b67dc832aa46c1c2f35752c46380545
2015-07-31 11:01:32 -04:00
Jason Locklin
06c72f83d7 OPUS_APPLICATION_VOIP should be used
See: http://opus-codec.org/docs/html_api-1.0.1/group__opus__encoder.html#gaa89264fd93c9da70362a0c9b96b9ca88

"VOIP" rather than "AUDIO":
> gives best quality at a given bitrate for voice signals. It enhances the input signal by high-pass filtering and emphasizing formants and harmonics. Optionally it includes in-band forward error correction to protect against packet loss. Use this mode for typical VoIP applications.
2015-07-31 10:50:37 -04:00
irungentoo
553f3ea513
Fixed some strange build issues. 2015-07-20 22:21:53 -04:00
mannol
7d5de68364 Fixed CALL_STATE naming 2015-07-10 16:54:53 +02:00
mannol
10e0209f2a Merge branch 'new_api' of github.com:mannol/toxcore into new_api 2015-07-09 03:41:28 +02:00
mannol
dd0880af38 Fixed documentation. 2015-07-09 03:40:47 +02:00
GrayHatter
ce9003d432 send_message() is too global to be non-static 2015-07-08 15:09:19 -07:00
mannol
4bc2413c44 Fixed missing include toxav_old.h 2015-07-01 22:50:06 +02:00
mannol
6c126e34e6 Implement handling capability change on rtp level 2015-06-30 01:41:38 +02:00
mannol
13148d7d7c Added support for old groupchats 2015-06-27 19:20:52 +02:00
mannol
2ecb71bb1e Renamed TOXAV_CALL_STATE to TOXAV_FRIEND_CALL_STATE 2015-06-27 17:28:07 +02:00
mannol
1ba55d0ca7 Added explanation about how audio callback works 2015-06-27 16:12:33 +02:00
mannol
08bc4eb0e0 Added payload turning off by setting bit rate to 0 2015-06-27 01:55:28 +02:00
mannol
9aba4ec273 Random fixes 2015-06-25 01:04:31 +02:00
mannol
a3132feddb Fixed sample size in callback and other stuff 2015-06-13 15:00:34 +02:00
mannol
979d7730aa Forgot about this 2015-06-05 22:18:21 +02:00
mannol
d694839d60 Rebased on master and removed alpha channel (again) 2015-06-05 22:14:37 +02:00
mannol
3100042a2b Updated with master 2015-05-22 23:22:31 +02:00
mannol
64037017cc Fix bug 2015-05-12 22:16:00 +02:00
irungentoo
b2350f2e26
Check if call supports video encoding before encoding frame. 2015-05-09 16:09:48 -04:00
mannol
73fbc22961 Fixed inconsistencies 2015-05-07 23:14:03 +02:00
irungentoo
048d793021
Toxav fix.
Use stored image width instead of displayed image width.
2015-05-05 16:12:09 -04:00
mannol
eb6e8aa290 Fixed* api comments and some bugs 2015-05-01 22:29:25 +02:00
mannol
5c4f275686 Merge branch 'new_api' of github.com:mannol/toxcore into new_api 2015-04-30 00:40:53 +02:00
mannol
b2b11f0fba Added many test and fixed various warnings 2015-04-30 00:40:30 +02:00
krobelus
45c45841cf Fixed typo 2015-04-29 09:21:28 +02:00
mannol
9bba7a0434 Done 2015-04-29 01:01:25 +02:00
mannol
e4a020333d working av new api 2015-04-28 00:55:57 +02:00
mannol
27e0254a98 Almooooooost 2015-04-27 00:15:57 +02:00
mannol
144fc94d69 Almost done 2015-04-26 00:31:03 +02:00
mannol
1bfd93e64a Finished refactoring 2015-04-22 02:09:37 +02:00
mannol
3fd0ee5f08 Final touchups 2015-04-21 02:31:12 +02:00
mannol
cbb8fdd4ea Add extern "C" 2015-04-20 11:21:55 +02:00
mannol
3a12a3b329 Update comment 2015-04-18 19:15:46 +02:00
mannol
eb9f4ad592 Fix toxav callback 2015-04-18 19:08:18 +02:00
mannol
d1fd3e36a6 Updated with upstream 2015-04-17 19:19:58 +02:00
mannol
969367b72a Update latest 2015-04-17 15:55:02 +02:00
mannol
da6c17222f The pretty basic adaptive bitrate is *working* 2015-04-16 02:00:34 +02:00
mannol
2465f486ac Started custom RTCP 2015-04-13 01:45:53 +02:00
mannol
b2d88a4544 Random fixes 2015-04-11 02:07:54 +02:00
mannol
4fa31d14cf Make it possible to decode mono audio with stereo decoder 2015-04-09 02:43:13 +02:00
mannol
9c003c9dd2 Video works now 2015-04-08 01:00:19 +02:00
mannol
bf9f7e2ae8 Video works but there is one deadlock left and video replay is slow 2015-04-07 01:24:36 +02:00
mannol
62c4fd7409 Video preview works (lmao) 2015-04-02 02:04:45 +02:00
mannol
fdaad0b7c0 A little CS cleanup 2015-03-29 01:10:34 +01:00
mannol
e65efc8936 Improvement in test and removed some bloat from CS 2015-03-28 03:36:31 +01:00
mannol
9bd20e8741 Merge branch 'new_api' of github.com:mannol/toxcore into new_api 2015-03-25 23:31:04 +01:00
Dubslow
56e5373a11
Consistency with core api 2015-03-25 14:55:42 -05:00
mannol
c1aa5bac4f Current progress of video testing 2015-03-24 23:59:01 +01:00
mannol
96ca88a0d6 Make it possible to change channels/sample rate of the decoder 2015-03-23 23:38:04 +01:00
mannol
995bddbc26 Audio works in test 2015-03-23 22:22:17 +01:00
mannol
62af82705a Some progress 2015-03-22 23:50:43 +01:00
mannol
a4fae8ffd4 Started testing transfer 2015-03-22 00:22:40 +01:00
mannol
4f76a8c89e Updating with master 2015-03-20 19:07:23 +01:00
irungentoo
8c18dd42a7
Fix build warning. 2015-03-19 18:17:27 -04:00
irungentoo
2b2c9f37a6
Fixed group audio issues when getting an old audio packet. 2015-03-19 18:02:46 -04:00
mannol
45e8807c1e Make toxav thread safe 2015-03-01 18:45:04 +01:00
irungentoo
e5791ed9ef
Added different error codes for custom packet functions in Messenger. 2015-02-26 13:13:26 -05:00
irungentoo
33370edee6
Changes to custom packet functions in Messenger.
Added function for rtp A/V packets, modified functions to behave
correctly for the new api.
2015-02-26 08:05:57 -05:00
irungentoo
ca997bda70
toxav new api fixes. 2015-02-25 20:51:37 -05:00
mannol
9e65cd5337 Implement pausing 2015-02-24 23:27:20 +01:00
mannol
29601feb76 New msi protocol 2015-02-21 01:07:22 +01:00
mannol
efe31ec92f Removed extra msi header and started testing 2015-02-20 00:23:38 +01:00
mannol
6e259d5fcb Msi should be done; toxav.c need a cleanup and adjustments 2015-02-18 23:23:46 +01:00
mannol
483a6ffa32 Added 2 new headers into msi for buffer control 2015-02-17 23:34:40 +01:00
irungentoo
c6a59e64b7
Updated types in Messenger callbacks to fit with the ones in the new api.
Friend number changed from int32_t to uint32_t.
Some lengths changed to size_t.
2015-02-17 15:49:22 -05:00
mannol
7329f3b3d4 Fixed header protectors and cleaning up the msi 2015-02-16 23:30:20 +01:00
mannol
8c245affb1 Started adjusting msi backend to new api 2015-02-15 22:41:10 +01:00
mannol
aad857527c Control part of new api already kind of works 2015-02-14 23:37:52 +01:00
irungentoo
ee3adf2641
Fixed memory leak. 2015-02-08 16:23:05 -05:00
irungentoo
01b4ad7a8a Fixed memory leak. 2015-02-06 15:16:07 -05:00
irungentoo
7e7b7f6c33
Fixed memory leak. 2015-02-06 15:13:36 -05:00
irungentoo
1302981d55
Removed useless misleading define. 2015-02-04 20:54:08 -05:00
mannol
39680f31d0 Progress 2015-02-01 23:43:54 +01:00
mannol
1450c22d01 Current progress 2015-01-24 23:29:54 +01:00