Squashed 'external/toxcore/c-toxcore/' changes from 03e9fbf3703..55752a2e2ef

55752a2e2ef fix(toxav): pass video bit rate as kbit Previously we unintentionally made it Mbit.
7e573280a75 docs(toxav): fix docs of toxav.h - fix units to be more readable - use width before height consistently - video -> audio typo
5f88a084e8c fix: friend_connections leak on allocation failure clean up when it only contains connections in the NONE state
6d27a1ae178 fix: wrong comment for closelist
ce4f29e8036 cleanup: Fix all `-Wsign-compare` warnings.
4d4251c397f chore: lower cirrus ci timeout drastically
40676284507 fix: events leak that can occur if allocation fails rare in practice, found by fuzzing
9610ac31c5f fix: Return an error instead of crashing on nullptr args in NGC.
a57c2c8f956 refactor: Make ToxAV independent of toxcore internals.
5752fc29f86 refactor: Make tox-bootstrapd use bool instead of int
df675786eb2 chore: Add release-drafter github action.
03fd7a69dcf chore: Use toktok's cmp instead of upstream.
350c0ba1205 cleanup: Sort apk/apt install commands in Dockerfiles.
8c1bda502cb chore(deps): bump golang.org/x/net
ddb9d3210da chore: Upgrade to FreeBSD 14.1 in cirrus build.
e9076f45bd3 chore(cmake): set options changes as cache and with force

git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: 55752a2e2ef894bfa6d7a2a21a0278e3f2bede7d
This commit is contained in:
Green Sky
2024-11-09 13:44:30 +01:00
parent fe6c5391a2
commit cae0ab9c5c
96 changed files with 1320 additions and 1159 deletions

View File

@ -73,6 +73,8 @@ typedef struct Tox Tox;
#endif /* !TOX_DEFINED */
#endif /* !APIGEN_IGNORE */
#ifndef TOXAV_DEFINED
#define TOXAV_DEFINED
/**
* @brief The ToxAV instance type.
*
@ -83,6 +85,7 @@ typedef struct Tox Tox;
* notifying peers.
*/
typedef struct ToxAV ToxAV;
#endif /* TOXAV_DEFINED */
/** @{
* @brief Creation and destruction
@ -246,9 +249,9 @@ typedef enum Toxav_Err_Call {
* receiving are both enabled by default.
*
* @param friend_number The friend number of the friend that should be called.
* @param audio_bit_rate Audio bit rate in Kb/sec. Set this to 0 to disable
* @param audio_bit_rate Audio bit rate in kbit/sec. Set this to 0 to disable
* audio sending.
* @param video_bit_rate Video bit rate in Kb/sec. Set this to 0 to disable
* @param video_bit_rate Video bit rate in kbit/sec. Set this to 0 to disable
* video sending.
*/
bool toxav_call(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate,
@ -315,9 +318,9 @@ typedef enum Toxav_Err_Answer {
* enabled by default.
*
* @param friend_number The friend number of the friend that is calling.
* @param audio_bit_rate Audio bit rate in Kb/sec. Set this to 0 to disable
* @param audio_bit_rate Audio bit rate in kbit/sec. Set this to 0 to disable
* audio sending.
* @param video_bit_rate Video bit rate in Kb/sec. Set this to 0 to disable
* @param video_bit_rate Video bit rate in kbit/sec. Set this to 0 to disable
* video sending.
*/
bool toxav_answer(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate,
@ -597,11 +600,11 @@ bool toxav_audio_send_frame(ToxAV *av, uint32_t friend_number, const int16_t pcm
uint8_t channels, uint32_t sampling_rate, Toxav_Err_Send_Frame *error);
/**
* Set the bit rate to be used in subsequent video frames.
* Set the bit rate to be used in subsequent audio frames.
*
* @param friend_number The friend number of the friend for which to set the
* bit rate.
* @param bit_rate The new audio bit rate in Kb/sec. Set to 0 to disable.
* @param bit_rate The new audio bit rate in kbit/sec. Set to 0 to disable.
*
* @return true on success.
*/
@ -614,7 +617,7 @@ bool toxav_audio_set_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t bit_ra
*
* @param friend_number The friend number of the friend for which to set the
* bit rate.
* @param audio_bit_rate Suggested maximum audio bit rate in Kb/sec.
* @param audio_bit_rate Suggested maximum audio bit rate in kbit/sec.
*/
typedef void toxav_audio_bit_rate_cb(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, void *user_data);
@ -627,9 +630,10 @@ void toxav_callback_audio_bit_rate(ToxAV *av, toxav_audio_bit_rate_cb *callback,
/**
* Send a video frame to a friend.
*
* Y - plane should be of size: `height * width`
* U - plane should be of size: `(height/2) * (width/2)`
* V - plane should be of size: `(height/2) * (width/2)`
* The video frame needs to be planar YUV420.
* Y - plane should be of size: `width * height`
* U - plane should be of size: `(width/2) * (height/2)`
* V - plane should be of size: `(width/2) * (height/2)`
*
* @param friend_number The friend number of the friend to which to send a video
* frame.
@ -641,9 +645,9 @@ void toxav_callback_audio_bit_rate(ToxAV *av, toxav_audio_bit_rate_cb *callback,
*/
bool toxav_video_send_frame(
ToxAV *av, uint32_t friend_number, uint16_t width, uint16_t height,
const uint8_t y[/*! height * width */],
const uint8_t u[/*! height/2 * width/2 */],
const uint8_t v[/*! height/2 * width/2 */],
const uint8_t y[/*! width * height */],
const uint8_t u[/*! width/2 * height/2 */],
const uint8_t v[/*! width/2 * height/2 */],
Toxav_Err_Send_Frame *error);
/**
@ -651,7 +655,7 @@ bool toxav_video_send_frame(
*
* @param friend_number The friend number of the friend for which to set the
* bit rate.
* @param bit_rate The new video bit rate in Kb/sec. Set to 0 to disable.
* @param bit_rate The new video bit rate in kbit/sec. Set to 0 to disable.
*
* @return true on success.
*/
@ -664,7 +668,7 @@ bool toxav_video_set_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t bit_ra
*
* @param friend_number The friend number of the friend for which to set the
* bit rate.
* @param video_bit_rate Suggested maximum video bit rate in Kb/sec.
* @param video_bit_rate Suggested maximum video bit rate in kbit/sec.
*/
typedef void toxav_video_bit_rate_cb(ToxAV *av, uint32_t friend_number, uint32_t video_bit_rate, void *user_data);