summaryrefslogtreecommitdiff
path: root/toxav
AgeCommit message (Collapse)Author
2018-07-12Style fixes in TCP code; remove MIN and PAIR from util.h.iphydf
* Moved PAIR to toxav, where it's used (but really this should die). * Replace most MIN calls with typed `min_*` calls. Didn't replace the ones where the desired semantics are unclear. Moved the MIN macro to the one place where it's still used. * Avoid assignments in `while` loops. Instead, factored out the loop body into a separate `bool`-returning function. * Use named types for callbacks (`_cb` types). * Avoid assignments in `if` conditions. * Removed `MAKE_REALLOC` and expanded its two calls. We can't have templates in C, and this fake templating is ugly and hard to analyse and debug (it expands on a single line). * Moved epoll system include to the .c file, out of the .h file. * Avoid assignments in expressions (`a = b = c;`). * Avoid multiple declarators per struct member declaration. * Fix naming inconsistencies. * Replace `net_to_host` macro with function.
2018-07-09Factor out time keeping code into its own module: mono_time.c.iphydf
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-08Avoid side-effectful assignments in conditionals.iphydf
Only in audio.c for now. This should be done everywhere.
2018-07-08Remove VLA usage from `send_audio_packet`.iphydf
Also use `net_pack_u16` in that function instead of manual ntohs+memcpy and `net_unpack_u16` in its receiving counterpart.
2018-07-07Call the "peer leaves" callback only once on group delete.iphydf
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-04Add some tests for our ring_buffer implementation.iphydf
These can serve as documentation until we write actual api docs, probably using apidsl.
2018-06-24Use clang-format for C++ code.iphydf
`clang-format -style='{BasedOnStyle: Google, ColumnLimit: 100}'`
2018-06-24Add Logger to various net_crypto functions.iphydf
In preparation for adding log statements. Also, fix an uninitialised variable warning in cppcheck.
2018-06-16Only check full rtp offset if RTP_LARGE_FRAME is setRobin Lindén
2018-05-20Move system header includes from network.h to network.ciphydf
2018-04-17Improve network error reporting on WindowsMaxim Biro
Windows doesn't report network errors though errno, it has its own facilities.
2018-03-16Remove the use of the 'hh' format specifier.iphydf
It's not supported in mingw. See https://github.com/TokTok/c-toxcore/issues/786.
2018-03-09Don't set RTP_LARGE_FRAME on rtp audio packetsRobin Lindén
2018-03-09Don't throw away rtp packets from old ToxcoreRobin Lindén
2018-02-24Fix a bunch of compiler warnings and remove suppressions.iphydf
2018-02-20make groupnumber uint32_tsudden6
fixes #606
2018-02-11Improve video key frame sending.zoff99
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-08Remove csrc from the RTPHeader struct.iphydf
This is not used by anything in the code, so we shouldn't have it in the header.
2018-02-06Format .cpp files with format-source.iphydf
2018-02-01Manually serialise RTPHeader struct instead of memcpy.iphydf
2018-01-31Change the "capabilities" field to a "flags" field.iphydf
This is more appropriate for RTP headers. Capabilities may be negotiated up front, but flags are useful in each packet.
2018-01-30Use nullptr as NULL pointer constant instead of NULL or 0.iphydf
This changes only code, no string literals or comments.
2018-01-29Add RTP header fields for the full frame length and offset.iphydf
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-28Avoid clashes with "build" directories on case-insensitive file systems.iphydf
2018-01-28Make audio/video bit rates "properties"xhe
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-25Split bit_rate_set(), one for audio, one for video.xhe
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-25Rename some rtp header struct members to be clearer.iphydf
These are the names used in the next PR, in RTPHeaderV3, so here we rename the old struct members already.
2018-01-22Publish a single public BUILD target for c-toxcore.iphydf
2018-01-21Make BUILD files more finely-grained.iphydf
This allows us to precisely see which libraries depend on which and lets us split them up more, if necessary.
2018-01-21Add comment from #629 in ring_buffer.c.iphydf
2018-01-21Add BUILD files for all the little tools in the repo.iphydf
Also, fix av_test.c, since I broke it last time.
2018-01-19Add some explanatory comments to the toxav audio code.iphydf
By @zoff99.
2018-01-19Use more descriptive names in bwcontroller.iphydf
2018-01-19Extract named constants from magic numbers in toxav/audio.c.iphydf
By @zoff99.
2018-01-18Use C99 standard in bazel builds.iphydf
2018-01-18Add bazel build scripts for c-toxcore.iphydf
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-14Add random_u16 function and rename the others to match.iphydf
2018-01-13Remove useless if statementendoffile78
2018-01-10Fix formatting in some C files.iphydf
Also replace &(x) with &x for consistency.
2017-12-17Split video payload into multiple packets when >65kmannol
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-11-19Fix typoyangfl
2017-06-04Add a monolith_test that includes all toxcore sources.iphydf
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-02-26Add part of platform-independent network API implementationDiadlo
socket -> net_socket htons -> net_htons htonl -> net_htonl connect -> net_connect sendto -> net_sendto_ip4 getaddrinfo -> net_getipport sa_family_t -> Family
2017-01-28Add VLA compatibility macro for C89-ish compilers.iphydf
2017-01-26Add platform-independent Socket and IP implementationDiadlo
2017-01-19Update license headers and remove redundant file name comment.iphydf
"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-18Setup autotools to read .so version info from a separate fileSergey 'Jin' Bostandzhyan
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
2016-12-21Use after free reported in #278 occurs because toxav_kill()mannol
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-03rename messenger function, prepend m_Gregory Mullen (grayhatter)
2016-11-20Fix a memory leak in GroupAVMaxim Biro