Squashed 'external/toxcore/c-toxcore/' changes from 1701691d5..640e6cace

640e6cace fix(toxav): remove extra copy of video frame on encode Tested and works, but there might be alignment issues and other stuff.
6f7f51554 chore(toxav): use realtime deadline for vp8 encoder Technically all this does is choose a quality based on frame duration, which we always set to 1, and as such is always realtime. (In same timebase as pts, which we use as a frame counter...)
5047ae5a2 chore: make the source tarball exhibit the old behavior
14804a4b8 chore: Fix sonar-scan CI action.
e2db7d946 cleanup: Exclude lan_discovery test from running on macos, instead of excluding it from the project.
3accade67 chore: Fix CI, disabling some tests that no longer run on CI.
ef8d767e6 cleanup: Fix comment formatting errors.
34ec822da cleanup: Fix some clang-19 format warnings.
40b3f0b46 refactor: Use clang's nullability qualifiers instead of attributes.
f81e30679 refactor: Use per-parameter nullability annotations.
REVERT: 1701691d5 chore(toxav): use realtime deadline for vp8 encoder Technically all this does is choose a quality based on frame duration, which we always set to 1, and as such is always realtime. (In same timebase as pts, which we use as a frame counter...)
REVERT: a87505867 fix(toxav): remove extra copy of video frame on encode Tested and works, but there might be alignment issues and other stuff.

git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: 640e6cace81b4412c45977b94eb9c41e53c54035
This commit is contained in:
Green Sky
2025-10-08 12:03:02 +02:00
parent ab12fbe820
commit 54c0a3c874
195 changed files with 3148 additions and 5495 deletions

View File

@@ -74,15 +74,15 @@ struct GC_Announces {
GC_Peer_Announce peer_announces[GCA_MAX_SAVED_ANNOUNCES_PER_GC];
GC_Announces *next_announce;
GC_Announces *prev_announce;
GC_Announces *_Nullable next_announce;
GC_Announces *_Nullable prev_announce;
};
/* A list of all announces. */
struct GC_Announces_List {
const Memory *mem;
const Memory *_Nonnull mem;
GC_Announces *root_announces;
GC_Announces *_Nullable root_announces;
uint64_t last_timeout_check;
};
@@ -90,13 +90,10 @@ struct GC_Announces_List {
*
* The caller is responsible for freeing the memory with `kill_gca`.
*/
non_null()
GC_Announces_List *new_gca_list(const Memory *mem);
GC_Announces_List *_Nullable new_gca_list(const Memory *_Nonnull mem);
/** @brief Frees all dynamically allocated memory associated with `announces_list`. */
nullable(1)
void kill_gca(GC_Announces_List *announces_list);
void kill_gca(GC_Announces_List *_Nullable announces_list);
/** @brief Iterates through the announces list and removes announces that are considered stale.
*
* @param gc_announces_list The list of announces to iterate.
@@ -104,16 +101,14 @@ void kill_gca(GC_Announces_List *announces_list);
* This function should be called from the main loop, and will iterate the list a
* maxmimum of once per second.
*/
non_null()
void do_gca(const Mono_Time *mono_time, GC_Announces_List *gc_announces_list);
void do_gca(const Mono_Time *_Nonnull mono_time, GC_Announces_List *_Nonnull gc_announces_list);
/** @brief Frees all dynamically allocated memory associated with an announces list entry.
*
* @param gc_announces_list The announces list we want to search through.
* @param chat_id The chat ID that designates the entry we want to remove.
*/
non_null()
void cleanup_gca(GC_Announces_List *gc_announces_list, const uint8_t *chat_id);
void cleanup_gca(GC_Announces_List *_Nonnull gc_announces_list, const uint8_t *_Nonnull chat_id);
/** @brief Puts a set of announces from the announces list in supplied list.
*
@@ -126,9 +121,8 @@ void cleanup_gca(GC_Announces_List *gc_announces_list, const uint8_t *chat_id);
* @return the number of added nodes on success.
* @retval -1 on failure.
*/
non_null()
int gca_get_announces(const GC_Announces_List *gc_announces_list, GC_Announce *gc_announces, uint8_t max_nodes,
const uint8_t *chat_id, const uint8_t *except_public_key);
int gca_get_announces(const GC_Announces_List *_Nonnull gc_announces_list, GC_Announce *_Nonnull gc_announces, uint8_t max_nodes, const uint8_t *_Nonnull chat_id,
const uint8_t *_Nonnull except_public_key);
/** @brief Adds a public_announce to list of announces.
*
@@ -138,9 +132,8 @@ int gca_get_announces(const GC_Announces_List *gc_announces_list, GC_Announce *g
* @return the peer announce on success.
* @retval null on failure.
*/
non_null()
GC_Peer_Announce *gca_add_announce(const Memory *mem, const Mono_Time *mono_time, GC_Announces_List *gc_announces_list,
const GC_Public_Announce *public_announce);
GC_Peer_Announce *_Nullable gca_add_announce(const Memory *_Nonnull mem, const Mono_Time *_Nonnull mono_time, GC_Announces_List *_Nonnull gc_announces_list,
const GC_Public_Announce *_Nonnull public_announce);
/** @brief Packs an announce into a data buffer.
*
@@ -151,8 +144,7 @@ GC_Peer_Announce *gca_add_announce(const Memory *mem, const Mono_Time *mono_time
* @return the size of the packed data on success.
* @retval -1 on failure.
*/
non_null()
int gca_pack_announce(const Logger *log, uint8_t *data, uint16_t length, const GC_Announce *announce);
int gca_pack_announce(const Logger *_Nonnull log, uint8_t *_Nonnull data, uint16_t length, const GC_Announce *_Nonnull announce);
/** @brief Returns the number of bytes needed for a buff in which to pack `count` announces. */
uint16_t gca_pack_announces_list_size(uint16_t count);
@@ -169,10 +161,8 @@ uint16_t gca_pack_announces_list_size(uint16_t count);
* @return the number of packed announces on success.
* @retval -1 on failure.
*/
non_null(1, 2, 4) nullable(6)
int gca_pack_announces_list(const Logger *log, uint8_t *data, uint16_t length, const GC_Announce *announces,
uint8_t announces_count, size_t *processed);
int gca_pack_announces_list(const Logger *_Nonnull log, uint8_t *_Nonnull data, uint16_t length, const GC_Announce *_Nonnull announces,
uint8_t announces_count, size_t *_Nullable processed);
/** @brief Unpacks packed announces from a data buffer into a supplied list.
*
* @param data The data buffer to unpack from.
@@ -183,9 +173,7 @@ int gca_pack_announces_list(const Logger *log, uint8_t *data, uint16_t length, c
* @return the number of unpacked announces on success.
* @retval -1 on failure.
*/
non_null()
int gca_unpack_announces_list(const Logger *log, const uint8_t *data, uint16_t length, GC_Announce *announces,
uint8_t max_count);
int gca_unpack_announces_list(const Logger *_Nonnull log, const uint8_t *_Nonnull data, uint16_t length, GC_Announce *_Nonnull announces, uint8_t max_count);
/** @brief Packs a public announce into a data buffer.
*
@@ -196,9 +184,7 @@ int gca_unpack_announces_list(const Logger *log, const uint8_t *data, uint16_t l
* @return the size of the packed data on success.
* @retval -1 on failure.
*/
non_null()
int gca_pack_public_announce(const Logger *log, uint8_t *data, uint16_t length,
const GC_Public_Announce *public_announce);
int gca_pack_public_announce(const Logger *_Nonnull log, uint8_t *_Nonnull data, uint16_t length, const GC_Public_Announce *_Nonnull public_announce);
/** @brief Unpacks a public announce from a data buffer into a supplied public announce.
*
@@ -209,16 +195,13 @@ int gca_pack_public_announce(const Logger *log, uint8_t *data, uint16_t length,
* @return the size of the unpacked data on success.
* @retval -1 on failure.
*/
non_null()
int gca_unpack_public_announce(const Logger *log, const uint8_t *data, uint16_t length,
GC_Public_Announce *public_announce);
int gca_unpack_public_announce(const Logger *_Nonnull log, const uint8_t *_Nonnull data, uint16_t length, GC_Public_Announce *_Nonnull public_announce);
/** @brief Returns true if the announce is valid.
*
* An announce is considered valid if there is at least one TCP relay, or the ip_port is set.
*/
non_null()
bool gca_is_valid_announce(const GC_Announce *announce);
bool gca_is_valid_announce(const GC_Announce *_Nonnull announce);
#ifdef __cplusplus
} /* extern "C" */