2023-07-25 11:53:09 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
* Copyright © 2016-2018 The TokTok team.
|
|
|
|
* Copyright © 2013-2015 Tox project.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** @file
|
|
|
|
* @brief Public audio/video API for Tox clients.
|
|
|
|
*
|
|
|
|
* This API can handle multiple calls. Each call has its state, in very rare
|
|
|
|
* occasions the library can change the state of the call without apps knowledge.
|
|
|
|
*
|
|
|
|
* @section av_events Events and callbacks
|
|
|
|
*
|
|
|
|
* As in Core API, events are handled by callbacks. One callback can be
|
|
|
|
* registered per event. All events have a callback function type named
|
|
|
|
* `toxav_{event}_cb` and a function to register it named `toxav_callback_{event}`.
|
|
|
|
* Passing a NULL callback will result in no callback being registered for that
|
|
|
|
* event. Only one callback per event can be registered, so if a client needs
|
|
|
|
* multiple event listeners, it needs to implement the dispatch functionality
|
|
|
|
* itself. Unlike Core API, lack of some event handlers will cause the the
|
|
|
|
* library to drop calls before they are started. Hanging up call from a
|
|
|
|
* callback causes undefined behaviour.
|
|
|
|
*
|
|
|
|
* @section av_threading Threading implications
|
|
|
|
*
|
|
|
|
* Only toxav_iterate is thread-safe, all other functions must run from the
|
|
|
|
* tox thread.
|
|
|
|
*
|
|
|
|
* Important exceptions are the `*_iterate` and `*_iterate_interval`
|
|
|
|
* functions. You have to choose either the single thread or the multi thread
|
|
|
|
* functions and read their documentation.
|
|
|
|
*
|
|
|
|
* A common way to run ToxAV (multiple or single instance) is to have a thread,
|
|
|
|
* separate from tox instance thread, running a simple toxav_iterate loop,
|
|
|
|
* sleeping for `toxav_iteration_interval * milliseconds` on each iteration.
|
|
|
|
*
|
|
|
|
* An important thing to note is that events are triggered from both tox and
|
|
|
|
* toxav thread (see above). Audio and video receive frame events are triggered
|
|
|
|
* from toxav thread while all the other events are triggered from tox thread.
|
|
|
|
*
|
|
|
|
* Tox thread has priority with mutex mechanisms. Any api function can
|
|
|
|
* fail if mutexes are held by tox thread in which case they will set SYNC
|
|
|
|
* error code.
|
|
|
|
*
|
|
|
|
* @subsection av_multi_threading Separate audio and video threads
|
|
|
|
*
|
|
|
|
* ToxAV supports either a single thread for audio and video or decoding and
|
|
|
|
* encoding them in separate threads. You have to choose one mode and can not
|
|
|
|
* mix function calls to those different modes.
|
|
|
|
*
|
|
|
|
* For best results use the multi-threaded mode and run the audio thread with
|
|
|
|
* higher priority than the video thread. This prioritizes audio over video.
|
|
|
|
*/
|
|
|
|
#ifndef C_TOXCORE_TOXAV_TOXAV_H
|
|
|
|
#define C_TOXCORE_TOXAV_TOXAV_H
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* External Tox type.
|
|
|
|
*/
|
2024-01-09 16:39:05 +01:00
|
|
|
#ifndef APIGEN_IGNORE
|
2023-07-25 11:53:09 +02:00
|
|
|
#ifndef TOX_DEFINED
|
|
|
|
#define TOX_DEFINED
|
|
|
|
typedef struct Tox Tox;
|
2024-01-09 16:39:05 +01:00
|
|
|
#endif /* !TOX_DEFINED */
|
|
|
|
#endif /* !APIGEN_IGNORE */
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The ToxAV instance type.
|
|
|
|
*
|
2024-01-09 16:39:05 +01:00
|
|
|
* Each ToxAV instance can be bound to only one Tox instance, and Tox instance
|
2023-07-25 11:53:09 +02:00
|
|
|
* can have only one ToxAV instance. One must make sure to close ToxAV instance
|
|
|
|
* prior closing Tox instance otherwise undefined behaviour occurs. Upon
|
|
|
|
* closing of ToxAV instance, all active calls will be forcibly terminated
|
|
|
|
* without notifying peers.
|
|
|
|
*/
|
|
|
|
typedef struct ToxAV ToxAV;
|
|
|
|
|
|
|
|
/** @{
|
|
|
|
* @brief Creation and destruction
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef enum Toxav_Err_New {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function returned successfully.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_NEW_OK,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* One of the arguments to the function was NULL when it was not expected.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_NEW_NULL,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Memory allocation failure while trying to allocate structures required for
|
|
|
|
* the A/V session.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_NEW_MALLOC,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attempted to create a second session for the same Tox instance.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_NEW_MULTIPLE,
|
|
|
|
|
|
|
|
} Toxav_Err_New;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Start new A/V session. There can only be only one session per Tox instance.
|
|
|
|
*/
|
|
|
|
ToxAV *toxav_new(Tox *tox, Toxav_Err_New *error);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Releases all resources associated with the A/V session.
|
|
|
|
*
|
|
|
|
* If any calls were ongoing, these will be forcibly terminated without
|
|
|
|
* notifying peers. After calling this function, no other functions may be
|
|
|
|
* called and the av pointer becomes invalid.
|
|
|
|
*/
|
|
|
|
void toxav_kill(ToxAV *av);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the Tox instance the A/V object was created for.
|
|
|
|
*/
|
|
|
|
Tox *toxav_get_tox(const ToxAV *av);
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** @{
|
|
|
|
* @brief A/V event loop, single thread
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the interval in milliseconds when the next toxav_iterate call should
|
|
|
|
* be. If no call is active at the moment, this function returns 200.
|
|
|
|
* This function MUST be called from the same thread as toxav_iterate.
|
|
|
|
*/
|
|
|
|
uint32_t toxav_iteration_interval(const ToxAV *av);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Main loop for the session. This function needs to be called in intervals of
|
|
|
|
* `toxav_iteration_interval()` milliseconds. It is best called in the separate
|
|
|
|
* thread from tox_iterate.
|
|
|
|
*/
|
|
|
|
void toxav_iterate(ToxAV *av);
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** @{
|
|
|
|
* @brief A/V event loop, multiple threads
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the interval in milliseconds when the next toxav_audio_iterate call
|
|
|
|
* should be. If no call is active at the moment, this function returns 200.
|
|
|
|
* This function MUST be called from the same thread as toxav_audio_iterate.
|
|
|
|
*/
|
|
|
|
uint32_t toxav_audio_iteration_interval(const ToxAV *av);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Main loop for the session. This function needs to be called in intervals of
|
|
|
|
* `toxav_audio_iteration_interval()` milliseconds. It is best called in a
|
|
|
|
* separate thread from tox_iterate and toxav_video_iterate. The thread calling
|
|
|
|
* this function should have higher priority than the one calling
|
|
|
|
* toxav_video_iterate to prioritize audio over video.
|
|
|
|
*/
|
|
|
|
void toxav_audio_iterate(ToxAV *av);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the interval in milliseconds when the next toxav_video_iterate call
|
|
|
|
* should be. If no call is active at the moment, this function returns 200.
|
|
|
|
* This function MUST be called from the same thread as toxav_video_iterate.
|
|
|
|
*/
|
|
|
|
uint32_t toxav_video_iteration_interval(const ToxAV *av);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Main loop for the session. This function needs to be called in intervals of
|
|
|
|
* `toxav_video_iteration_interval()` milliseconds. It is best called in a
|
|
|
|
* separate thread from tox_iterate and toxav_audio_iterate. The thread calling
|
|
|
|
* this function should have lower priority than the one calling
|
|
|
|
* toxav_audio_iterate to prioritize audio over video.
|
|
|
|
*/
|
|
|
|
void toxav_video_iterate(ToxAV *av);
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** @{
|
|
|
|
* @brief Call setup
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef enum Toxav_Err_Call {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function returned successfully.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_OK,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A resource allocation error occurred while trying to create the structures
|
|
|
|
* required for the call.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_MALLOC,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Synchronization error occurred.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_SYNC,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The friend number did not designate a valid friend.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_FRIEND_NOT_FOUND,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The friend was valid, but not currently connected.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_FRIEND_NOT_CONNECTED,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attempted to call a friend while already in an audio or video call with
|
|
|
|
* them.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_FRIEND_ALREADY_IN_CALL,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Audio or video bit rate is invalid.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_INVALID_BIT_RATE,
|
|
|
|
|
|
|
|
} Toxav_Err_Call;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Call a friend. This will start ringing the friend.
|
|
|
|
*
|
|
|
|
* It is the client's responsibility to stop ringing after a certain timeout,
|
|
|
|
* if such behaviour is desired. If the client does not stop ringing, the
|
|
|
|
* library will not stop until the friend is disconnected. Audio and video
|
|
|
|
* 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
|
|
|
|
* audio sending.
|
|
|
|
* @param video_bit_rate Video bit rate in Kb/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,
|
|
|
|
Toxav_Err_Call *error);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function type for the call callback.
|
|
|
|
*
|
|
|
|
* @param friend_number The friend number from which the call is incoming.
|
|
|
|
* @param audio_enabled True if friend is sending audio.
|
|
|
|
* @param video_enabled True if friend is sending video.
|
|
|
|
*/
|
|
|
|
typedef void toxav_call_cb(ToxAV *av, uint32_t friend_number, bool audio_enabled, bool video_enabled, void *user_data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the callback for the `call` event. Pass NULL to unset.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void toxav_callback_call(ToxAV *av, toxav_call_cb *callback, void *user_data);
|
|
|
|
|
|
|
|
typedef enum Toxav_Err_Answer {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function returned successfully.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_ANSWER_OK,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Synchronization error occurred.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_ANSWER_SYNC,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Failed to initialize codecs for call session. Note that codec initiation
|
|
|
|
* will fail if there is no receive callback registered for either audio or
|
|
|
|
* video.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_ANSWER_CODEC_INITIALIZATION,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The friend number did not designate a valid friend.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_ANSWER_FRIEND_NOT_FOUND,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The friend was valid, but they are not currently trying to initiate a call.
|
|
|
|
* This is also returned if this client is already in a call with the friend.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_ANSWER_FRIEND_NOT_CALLING,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Audio or video bit rate is invalid.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_ANSWER_INVALID_BIT_RATE,
|
|
|
|
|
|
|
|
} Toxav_Err_Answer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Accept an incoming call.
|
|
|
|
*
|
|
|
|
* If answering fails for any reason, the call will still be pending and it is
|
|
|
|
* possible to try and answer it later. Audio and video receiving are both
|
|
|
|
* 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
|
|
|
|
* audio sending.
|
|
|
|
* @param video_bit_rate Video bit rate in Kb/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,
|
|
|
|
Toxav_Err_Answer *error);
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** @{
|
|
|
|
* @brief Call state graph
|
|
|
|
*/
|
|
|
|
|
|
|
|
enum Toxav_Friend_Call_State {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The empty bit mask. None of the bits specified below are set.
|
|
|
|
*/
|
|
|
|
TOXAV_FRIEND_CALL_STATE_NONE = 0,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set by the AV core if an error occurred on the remote end or if friend
|
|
|
|
* timed out. This is the final state after which no more state
|
|
|
|
* transitions can occur for the call. This call state will never be triggered
|
|
|
|
* in combination with other call states.
|
|
|
|
*/
|
|
|
|
TOXAV_FRIEND_CALL_STATE_ERROR = 1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The call has finished. This is the final state after which no more state
|
|
|
|
* transitions can occur for the call. This call state will never be
|
|
|
|
* triggered in combination with other call states.
|
|
|
|
*/
|
|
|
|
TOXAV_FRIEND_CALL_STATE_FINISHED = 2,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The flag that marks that friend is sending audio.
|
|
|
|
*/
|
|
|
|
TOXAV_FRIEND_CALL_STATE_SENDING_A = 4,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The flag that marks that friend is sending video.
|
|
|
|
*/
|
|
|
|
TOXAV_FRIEND_CALL_STATE_SENDING_V = 8,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The flag that marks that friend is receiving audio.
|
|
|
|
*/
|
|
|
|
TOXAV_FRIEND_CALL_STATE_ACCEPTING_A = 16,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The flag that marks that friend is receiving video.
|
|
|
|
*/
|
|
|
|
TOXAV_FRIEND_CALL_STATE_ACCEPTING_V = 32,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function type for the call_state callback.
|
|
|
|
*
|
|
|
|
* @param friend_number The friend number for which the call state changed.
|
|
|
|
* @param state The bitmask of the new call state which is guaranteed to be
|
|
|
|
* different than the previous state. The state is set to 0 when the call is
|
|
|
|
* paused. The bitmask represents all the activities currently performed by the
|
|
|
|
* friend.
|
|
|
|
*/
|
|
|
|
typedef void toxav_call_state_cb(ToxAV *av, uint32_t friend_number, uint32_t state, void *user_data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the callback for the `call_state` event. Pass NULL to unset.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void toxav_callback_call_state(ToxAV *av, toxav_call_state_cb *callback, void *user_data);
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** @{
|
|
|
|
* @brief Call control
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef enum Toxav_Call_Control {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Resume a previously paused call. Only valid if the pause was caused by this
|
|
|
|
* client, if not, this control is ignored. Not valid before the call is accepted.
|
|
|
|
*/
|
|
|
|
TOXAV_CALL_CONTROL_RESUME,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Put a call on hold. Not valid before the call is accepted.
|
|
|
|
*/
|
|
|
|
TOXAV_CALL_CONTROL_PAUSE,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reject a call if it was not answered, yet. Cancel a call after it was
|
|
|
|
* answered.
|
|
|
|
*/
|
|
|
|
TOXAV_CALL_CONTROL_CANCEL,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request that the friend stops sending audio. Regardless of the friend's
|
|
|
|
* compliance, this will cause the audio_receive_frame event to stop being
|
|
|
|
* triggered on receiving an audio frame from the friend.
|
|
|
|
*/
|
|
|
|
TOXAV_CALL_CONTROL_MUTE_AUDIO,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Calling this control will notify client to start sending audio again.
|
|
|
|
*/
|
|
|
|
TOXAV_CALL_CONTROL_UNMUTE_AUDIO,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request that the friend stops sending video. Regardless of the friend's
|
|
|
|
* compliance, this will cause the video_receive_frame event to stop being
|
|
|
|
* triggered on receiving a video frame from the friend.
|
|
|
|
*/
|
|
|
|
TOXAV_CALL_CONTROL_HIDE_VIDEO,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Calling this control will notify client to start sending video again.
|
|
|
|
*/
|
|
|
|
TOXAV_CALL_CONTROL_SHOW_VIDEO,
|
|
|
|
|
|
|
|
} Toxav_Call_Control;
|
|
|
|
|
|
|
|
typedef enum Toxav_Err_Call_Control {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function returned successfully.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_CONTROL_OK,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Synchronization error occurred.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_CONTROL_SYNC,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The friend_number passed did not designate a valid friend.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_CONTROL_FRIEND_NOT_FOUND,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This client is currently not in a call with the friend. Before the call is
|
|
|
|
* answered, only CANCEL is a valid control.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_CONTROL_FRIEND_NOT_IN_CALL,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Happens if user tried to pause an already paused call or if trying to
|
|
|
|
* resume a call that is not paused.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_CALL_CONTROL_INVALID_TRANSITION,
|
|
|
|
|
|
|
|
} Toxav_Err_Call_Control;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sends a call control command to a friend.
|
|
|
|
*
|
|
|
|
* @param friend_number The friend number of the friend this client is in a call
|
|
|
|
* with.
|
|
|
|
* @param control The control command to send.
|
|
|
|
*
|
|
|
|
* @return true on success.
|
|
|
|
*/
|
|
|
|
bool toxav_call_control(ToxAV *av, uint32_t friend_number, Toxav_Call_Control control, Toxav_Err_Call_Control *error);
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** @{
|
|
|
|
* @brief Controlling bit rates
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef enum Toxav_Err_Bit_Rate_Set {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function returned successfully.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_BIT_RATE_SET_OK,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Synchronization error occurred.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_BIT_RATE_SET_SYNC,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The bit rate passed was not one of the supported values.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_BIT_RATE_SET_INVALID_BIT_RATE,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The friend_number passed did not designate a valid friend.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_BIT_RATE_SET_FRIEND_NOT_FOUND,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This client is currently not in a call with the friend.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_BIT_RATE_SET_FRIEND_NOT_IN_CALL,
|
|
|
|
|
|
|
|
} Toxav_Err_Bit_Rate_Set;
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** @{
|
|
|
|
* @brief A/V sending
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef enum Toxav_Err_Send_Frame {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function returned successfully.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_SEND_FRAME_OK,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* In case of video, one of Y, U, or V was NULL. In case of audio, the samples
|
|
|
|
* data pointer was NULL.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_SEND_FRAME_NULL,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The friend_number passed did not designate a valid friend.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_SEND_FRAME_FRIEND_NOT_FOUND,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This client is currently not in a call with the friend.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_SEND_FRAME_FRIEND_NOT_IN_CALL,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Synchronization error occurred.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_SEND_FRAME_SYNC,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* One of the frame parameters was invalid. E.g. the resolution may be too
|
|
|
|
* small or too large, or the audio sampling rate may be unsupported.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_SEND_FRAME_INVALID,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Either friend turned off audio or video receiving or we turned off sending
|
|
|
|
* for the said payload.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_SEND_FRAME_PAYLOAD_TYPE_DISABLED,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Failed to push frame through rtp interface.
|
|
|
|
*/
|
|
|
|
TOXAV_ERR_SEND_FRAME_RTP_FAILED,
|
|
|
|
|
|
|
|
} Toxav_Err_Send_Frame;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Send an audio frame to a friend.
|
|
|
|
*
|
|
|
|
* The expected format of the PCM data is: `[s1c1][s1c2][...][s2c1][s2c2][...]...`
|
|
|
|
* Meaning: sample 1 for channel 1, sample 1 for channel 2, ...
|
|
|
|
* For mono audio, this has no meaning, every sample is subsequent. For stereo,
|
|
|
|
* this means the expected format is LRLRLR... with samples for left and right
|
|
|
|
* alternating.
|
|
|
|
*
|
|
|
|
* @param friend_number The friend number of the friend to which to send an
|
|
|
|
* audio frame.
|
|
|
|
* @param pcm An array of audio samples. The size of this array must be
|
|
|
|
* `sample_count * channels`.
|
|
|
|
* @param sample_count Number of samples in this frame. Valid numbers here are
|
|
|
|
* `((sample rate) * (audio length) / 1000)`, where audio length can be
|
|
|
|
* 2.5, 5, 10, 20, 40 or 60 millseconds.
|
|
|
|
* @param channels Number of audio channels. Supported values are 1 and 2.
|
|
|
|
* @param sampling_rate Audio sampling rate used in this frame. Valid sampling
|
|
|
|
* rates are 8000, 12000, 16000, 24000, or 48000.
|
|
|
|
*/
|
2024-01-09 16:39:05 +01:00
|
|
|
bool toxav_audio_send_frame(ToxAV *av, uint32_t friend_number, const int16_t pcm[], size_t sample_count,
|
2023-07-25 11:53:09 +02:00
|
|
|
uint8_t channels, uint32_t sampling_rate, Toxav_Err_Send_Frame *error);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the bit rate to be used in subsequent video 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.
|
|
|
|
*
|
|
|
|
* @return true on success.
|
|
|
|
*/
|
|
|
|
bool toxav_audio_set_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t bit_rate, Toxav_Err_Bit_Rate_Set *error);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function type for the audio_bit_rate callback. The event is triggered
|
|
|
|
* when the network becomes too saturated for current bit rates at which
|
|
|
|
* point core suggests new bit rates.
|
|
|
|
*
|
|
|
|
* @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.
|
|
|
|
*/
|
|
|
|
typedef void toxav_audio_bit_rate_cb(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, void *user_data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the callback for the `audio_bit_rate` event. Pass NULL to unset.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void toxav_callback_audio_bit_rate(ToxAV *av, toxav_audio_bit_rate_cb *callback, void *user_data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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)`
|
|
|
|
*
|
|
|
|
* @param friend_number The friend number of the friend to which to send a video
|
|
|
|
* frame.
|
|
|
|
* @param width Width of the frame in pixels.
|
|
|
|
* @param height Height of the frame in pixels.
|
|
|
|
* @param y Y (Luminance) plane data.
|
|
|
|
* @param u U (Chroma) plane data.
|
|
|
|
* @param v V (Chroma) plane data.
|
|
|
|
*/
|
2024-01-09 16:39:05 +01:00
|
|
|
bool toxav_video_send_frame(
|
Squashed 'external/toxcore/c-toxcore/' changes from e2c01e457b..b03b571272
b03b571272 fix: flaky tcp test This only fixes the symptoms, not the real problem. Sometimes or consistently on some platforms a socket might need a moment before it can be written to.
32e67ab4c2 cleanup: use typedef for private message ID's in callback
7b1db6adc1 feat: add message IDs to private group messages
99e0bcc27d refactor: Observers/ignored peers can now send and receive custom packets
b3c3c49d26 fix: Disable IPv6 in Windows cross-compilation tests
e742deddff feat: Check hashes of Windows dependencies when cross-compiling
dfb9a0b02b fix: Test the current Windows Dockerfile, not an old Dockerhub image
14de93ccec chore: Use WineHQ's Wine as Debian Bookworm's crashes
ed37616249 docs: Update the Windows cross-compilation section
9bb79c174f cleanup: Remove a couple of unnecessary misc_tools dependencies
19475adb70 chore: Statically link OpenMP into the cracker fun util on Windows
1be311e51f feat: Build the fun utils when cross-compiling to Windows
88133f8446 chore: Strip Windows binaries
3cc0ae7535 refactor: Copy over all of the required static dependencies
c4fa8f7fb1 feat: Generate .def, .exp and .lib files when building for Windows
74bbac5363 feat: Let CMake create the dll instead of doing so ourselves
246642e9ae feat: Harden Windows cross-compilation
8d431c0d11 chore: Bump Windows build dependency versions
e519f7998b fix: Remove unnecessary wsock32 dependency on Windows
ed2b60c217 chore: Use a specific non-broken slimcc version.
d7f21010a1 chore: Update github actions.
e71a68b7f2 docs: Update the list of CMake options
77e08876ff chore: Remove mod and founder from group API naming scheme
12bc042767 docs: add the experimental api build option to INSTALL.md
e1fa5cae96 refactor: Rename Queries to Query to align with other enums.
be82a3ea30 fix: Correct type for conference offline peer numbers.
0627c36716 test: Add pkgsrc build.
92578afe4b test: Add FreeBSD VM action on GitHub.
52ece0f57b test: Build toxcore on NetBSD (VM).
3fe8ee2c11 chore: Only install tox_private.h on request.
9a8dfa06ab fix: save_compatibility_test failing on big-endian systems
86f5e55578 fix: Don't serve files from websockify.
710eb674a5 fix: Correctly pass extended public keys to group moderation code.
021db7031c refactor: Use `struct`s for extended public/secret keys.
a1e999fd80 chore: Compile libsodium reference implementation with compcert.
fbe3c19cf5 cleanup: correct a few nullable annotations
623e3ee5c3 cleanup: Don't use `memcpy` to cast arbitrary `struct`s to `uint8_t[]`.
c71567dc18 fix: Pass array, not array pointer, to `memcmp`.
9b46a08144 cleanup: Never pass `void*` directly to `memcpy`.
5d7b7a7bbc refactor: Use tox rng to seed the keypair generation.
961891d568 cleanup: Small improvements found by PVS Studio.
8201019f0d chore: Disable NGC saving by default, enable through Tox_Options.
5dd9ee3f65 cleanup: Replace pointer arithmetic with explicit `&arr[i]`.
ca4606d49d refactor: Use strong typedef for NGC peer id.
442213b722 cleanup: Simplify custom packet length check in NGC.
08d3393def fix: Correct a few potential null derefs in bootstrap daemon.
b9877b32b0 fix: Add missing memunlock of local variable when it goes out of scope.
dab5fe44b9 fix: Zero out stack-allocated secret key before return.
f058103299 refactor: Make prune_gc_sanctions_list more obviously correct.
3ba7a0dec9 docs: Add static analysis tool list to README.
8d0811a0f3 docs: Run prettier-markdown on markdown files.
969e3a2bfc refactor: Fix network test not using the strong typedef
93c83fbc7c refactor: Use strong typedef instead of struct for `Socket`.
9fe18b176f fix: Fix some false positive from PVS Studio.
7c44379ccb cleanup: Check that WINXP macro exists before comparing it.
5c93231bef refactor: Make tox mutex non-recursive.
aacff73939 docs: Fix up doxyfile.
d55fc85ff5 docs: Add more documentation to crypto_core.
5bdaaaedb6 refactor: Remove `Tox *` from `tox_dispatch`.
e202341e76 refactor: Don't rely on tox_dispatch passing tox in tests.
34df938f52 chore: Use C++ mode for clang-tidy.
8b05296a78 chore: Check that both gtest and gmock exist for tests.
42010660e1 test: Add slimcc compiler compatibility test.
b473630321 chore: Add some comments to the astyle config.
b7404f24f6 cleanup: Remove implicit bool conversions.
4e2dba4d9f chore: Reformat sources with astyle.
4359e3a6bc chore: Rename C++ headers to .hh suffixes.
0c05566e58 cleanup: Further `#include` cleanups.
8d29935b7a chore: Only check the bootstrap daemon checksum on release.
f70e588bc6 cleanup: Add more `const` where possible.
511bfe39c8 cleanup: Use Bazel modules to enforce proper `#include` hygiene.
1710a0d091 refactor: Move pack/unpack `IP_Port` from DHT into network module.
a975943564 chore: Really fix coverage docker image build.
c08409390f chore: Fix post-submit coverage image.
39aadf8922 fix: Don't use `memcmp` to compare `IP_Port`s.
d94246a906 fix: partially fix a bug that prevented group part messages from sending.
eeaa039222 chore: Fix rpm build; add a CI check for it.
8328449c1a chore: Speed up docker builds a bit by reducing layer count.
d6d67d56f3 cleanup: Add `const` where possible in auto tests.
6aa9e6850d cleanup: Minor cleanup of event unpack code.
bdf460a3a9 refactor: Rename `system_{memory,...}` to `os_{memory,...}`.
203e1af81e fix: a few off by one errors in group autotests
5c093c4888 cleanup: Remove all uses of `SIZEOF_VLA`.
662c2140f3 test: Add goblint static analyser.
8f07755834 cleanup: Use `memzero(x, s)` instead of `memset(x, 0, s)`.
a7258e40cf cleanup: Use explicit 0 instead of `PACKET_ID_PADDING`.
6370d0f15d cleanup: Expand the `Tox_Options` accessor macros.
14a1a0b9bd cleanup: Remove plan9 support.
a05dccad13 test: Add a simple new/delete test for Tox.
1cdcf938b9 cleanup: Add comment after every `#endif`.
ba99d4dc4b test: Fix comment I broke in the events test PR.
e07248debb refactor: Migrate auto_tests to new events API.
bdd42b5452 refactor: Add common msgpack array packer with callback.
3c659f5288 cleanup: Rename group to conference in groupav documentation.
89957be230 cleanup: Ensure handler params are named after callback params.
c650d9d345 refactor: Pass `this` pointer as first param to s11n callbacks.
e7fb91ddb8 refactor: Allow NULL pointers for byte arrays in events.
5e2c8cabc1 cleanup: make some improvements to group moderation test
259de4867e cleanup: Remove `bin_pack_{new,free}`.
21a8ff5895 cleanup: skip a do_gc iteration before removing peers marked for deletion
16809dc36e feat: Add dht_get_nodes_response event to the events system.
git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: b03b5712720de9a9901ea12fd741f177327a7021
2024-03-07 23:12:55 +01:00
|
|
|
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 */],
|
|
|
|
Toxav_Err_Send_Frame *error);
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the bit rate to be used in subsequent video frames.
|
|
|
|
*
|
|
|
|
* @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.
|
|
|
|
*
|
|
|
|
* @return true on success.
|
|
|
|
*/
|
|
|
|
bool toxav_video_set_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t bit_rate, Toxav_Err_Bit_Rate_Set *error);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function type for the video_bit_rate callback. The event is triggered
|
|
|
|
* when the network becomes too saturated for current bit rates at which
|
|
|
|
* point core suggests new bit rates.
|
|
|
|
*
|
|
|
|
* @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.
|
|
|
|
*/
|
|
|
|
typedef void toxav_video_bit_rate_cb(ToxAV *av, uint32_t friend_number, uint32_t video_bit_rate, void *user_data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the callback for the `video_bit_rate` event. Pass NULL to unset.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void toxav_callback_video_bit_rate(ToxAV *av, toxav_video_bit_rate_cb *callback, void *user_data);
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/** @{
|
|
|
|
* @brief A/V receiving
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function type for the audio_receive_frame callback. The callback can be
|
|
|
|
* called multiple times per single iteration depending on the amount of queued
|
|
|
|
* frames in the buffer. The received format is the same as in send function.
|
|
|
|
*
|
|
|
|
* @param friend_number The friend number of the friend who sent an audio frame.
|
|
|
|
* @param pcm An array of audio samples (`sample_count * channels` elements).
|
|
|
|
* @param sample_count The number of audio samples per channel in the PCM array.
|
|
|
|
* @param channels Number of audio channels.
|
|
|
|
* @param sampling_rate Sampling rate used in this frame.
|
|
|
|
*
|
|
|
|
*/
|
2024-01-09 16:39:05 +01:00
|
|
|
typedef void toxav_audio_receive_frame_cb(ToxAV *av, uint32_t friend_number, const int16_t pcm[], size_t sample_count,
|
2023-07-25 11:53:09 +02:00
|
|
|
uint8_t channels, uint32_t sampling_rate, void *user_data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the callback for the `audio_receive_frame` event. Pass NULL to unset.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void toxav_callback_audio_receive_frame(ToxAV *av, toxav_audio_receive_frame_cb *callback, void *user_data);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The function type for the video_receive_frame callback.
|
|
|
|
*
|
|
|
|
* The size of plane data is derived from width and height as documented
|
|
|
|
* below.
|
|
|
|
*
|
|
|
|
* Strides represent padding for each plane that may or may not be present.
|
|
|
|
* You must handle strides in your image processing code. Strides are
|
|
|
|
* negative if the image is bottom-up hence why you MUST `abs()` it when
|
|
|
|
* calculating plane buffer size.
|
|
|
|
*
|
|
|
|
* @param friend_number The friend number of the friend who sent a video frame.
|
|
|
|
* @param width Width of the frame in pixels.
|
|
|
|
* @param height Height of the frame in pixels.
|
|
|
|
* @param y Luminosity plane. `Size = MAX(width, abs(ystride)) * height`.
|
|
|
|
* @param u U chroma plane. `Size = MAX(width/2, abs(ustride)) * (height/2)`.
|
|
|
|
* @param v V chroma plane. `Size = MAX(width/2, abs(vstride)) * (height/2)`.
|
|
|
|
*
|
|
|
|
* @param ystride Luminosity plane stride.
|
|
|
|
* @param ustride U chroma plane stride.
|
|
|
|
* @param vstride V chroma plane stride.
|
|
|
|
*/
|
2024-01-09 16:39:05 +01:00
|
|
|
typedef void toxav_video_receive_frame_cb(
|
Squashed 'external/toxcore/c-toxcore/' changes from e2c01e457b..b03b571272
b03b571272 fix: flaky tcp test This only fixes the symptoms, not the real problem. Sometimes or consistently on some platforms a socket might need a moment before it can be written to.
32e67ab4c2 cleanup: use typedef for private message ID's in callback
7b1db6adc1 feat: add message IDs to private group messages
99e0bcc27d refactor: Observers/ignored peers can now send and receive custom packets
b3c3c49d26 fix: Disable IPv6 in Windows cross-compilation tests
e742deddff feat: Check hashes of Windows dependencies when cross-compiling
dfb9a0b02b fix: Test the current Windows Dockerfile, not an old Dockerhub image
14de93ccec chore: Use WineHQ's Wine as Debian Bookworm's crashes
ed37616249 docs: Update the Windows cross-compilation section
9bb79c174f cleanup: Remove a couple of unnecessary misc_tools dependencies
19475adb70 chore: Statically link OpenMP into the cracker fun util on Windows
1be311e51f feat: Build the fun utils when cross-compiling to Windows
88133f8446 chore: Strip Windows binaries
3cc0ae7535 refactor: Copy over all of the required static dependencies
c4fa8f7fb1 feat: Generate .def, .exp and .lib files when building for Windows
74bbac5363 feat: Let CMake create the dll instead of doing so ourselves
246642e9ae feat: Harden Windows cross-compilation
8d431c0d11 chore: Bump Windows build dependency versions
e519f7998b fix: Remove unnecessary wsock32 dependency on Windows
ed2b60c217 chore: Use a specific non-broken slimcc version.
d7f21010a1 chore: Update github actions.
e71a68b7f2 docs: Update the list of CMake options
77e08876ff chore: Remove mod and founder from group API naming scheme
12bc042767 docs: add the experimental api build option to INSTALL.md
e1fa5cae96 refactor: Rename Queries to Query to align with other enums.
be82a3ea30 fix: Correct type for conference offline peer numbers.
0627c36716 test: Add pkgsrc build.
92578afe4b test: Add FreeBSD VM action on GitHub.
52ece0f57b test: Build toxcore on NetBSD (VM).
3fe8ee2c11 chore: Only install tox_private.h on request.
9a8dfa06ab fix: save_compatibility_test failing on big-endian systems
86f5e55578 fix: Don't serve files from websockify.
710eb674a5 fix: Correctly pass extended public keys to group moderation code.
021db7031c refactor: Use `struct`s for extended public/secret keys.
a1e999fd80 chore: Compile libsodium reference implementation with compcert.
fbe3c19cf5 cleanup: correct a few nullable annotations
623e3ee5c3 cleanup: Don't use `memcpy` to cast arbitrary `struct`s to `uint8_t[]`.
c71567dc18 fix: Pass array, not array pointer, to `memcmp`.
9b46a08144 cleanup: Never pass `void*` directly to `memcpy`.
5d7b7a7bbc refactor: Use tox rng to seed the keypair generation.
961891d568 cleanup: Small improvements found by PVS Studio.
8201019f0d chore: Disable NGC saving by default, enable through Tox_Options.
5dd9ee3f65 cleanup: Replace pointer arithmetic with explicit `&arr[i]`.
ca4606d49d refactor: Use strong typedef for NGC peer id.
442213b722 cleanup: Simplify custom packet length check in NGC.
08d3393def fix: Correct a few potential null derefs in bootstrap daemon.
b9877b32b0 fix: Add missing memunlock of local variable when it goes out of scope.
dab5fe44b9 fix: Zero out stack-allocated secret key before return.
f058103299 refactor: Make prune_gc_sanctions_list more obviously correct.
3ba7a0dec9 docs: Add static analysis tool list to README.
8d0811a0f3 docs: Run prettier-markdown on markdown files.
969e3a2bfc refactor: Fix network test not using the strong typedef
93c83fbc7c refactor: Use strong typedef instead of struct for `Socket`.
9fe18b176f fix: Fix some false positive from PVS Studio.
7c44379ccb cleanup: Check that WINXP macro exists before comparing it.
5c93231bef refactor: Make tox mutex non-recursive.
aacff73939 docs: Fix up doxyfile.
d55fc85ff5 docs: Add more documentation to crypto_core.
5bdaaaedb6 refactor: Remove `Tox *` from `tox_dispatch`.
e202341e76 refactor: Don't rely on tox_dispatch passing tox in tests.
34df938f52 chore: Use C++ mode for clang-tidy.
8b05296a78 chore: Check that both gtest and gmock exist for tests.
42010660e1 test: Add slimcc compiler compatibility test.
b473630321 chore: Add some comments to the astyle config.
b7404f24f6 cleanup: Remove implicit bool conversions.
4e2dba4d9f chore: Reformat sources with astyle.
4359e3a6bc chore: Rename C++ headers to .hh suffixes.
0c05566e58 cleanup: Further `#include` cleanups.
8d29935b7a chore: Only check the bootstrap daemon checksum on release.
f70e588bc6 cleanup: Add more `const` where possible.
511bfe39c8 cleanup: Use Bazel modules to enforce proper `#include` hygiene.
1710a0d091 refactor: Move pack/unpack `IP_Port` from DHT into network module.
a975943564 chore: Really fix coverage docker image build.
c08409390f chore: Fix post-submit coverage image.
39aadf8922 fix: Don't use `memcmp` to compare `IP_Port`s.
d94246a906 fix: partially fix a bug that prevented group part messages from sending.
eeaa039222 chore: Fix rpm build; add a CI check for it.
8328449c1a chore: Speed up docker builds a bit by reducing layer count.
d6d67d56f3 cleanup: Add `const` where possible in auto tests.
6aa9e6850d cleanup: Minor cleanup of event unpack code.
bdf460a3a9 refactor: Rename `system_{memory,...}` to `os_{memory,...}`.
203e1af81e fix: a few off by one errors in group autotests
5c093c4888 cleanup: Remove all uses of `SIZEOF_VLA`.
662c2140f3 test: Add goblint static analyser.
8f07755834 cleanup: Use `memzero(x, s)` instead of `memset(x, 0, s)`.
a7258e40cf cleanup: Use explicit 0 instead of `PACKET_ID_PADDING`.
6370d0f15d cleanup: Expand the `Tox_Options` accessor macros.
14a1a0b9bd cleanup: Remove plan9 support.
a05dccad13 test: Add a simple new/delete test for Tox.
1cdcf938b9 cleanup: Add comment after every `#endif`.
ba99d4dc4b test: Fix comment I broke in the events test PR.
e07248debb refactor: Migrate auto_tests to new events API.
bdd42b5452 refactor: Add common msgpack array packer with callback.
3c659f5288 cleanup: Rename group to conference in groupav documentation.
89957be230 cleanup: Ensure handler params are named after callback params.
c650d9d345 refactor: Pass `this` pointer as first param to s11n callbacks.
e7fb91ddb8 refactor: Allow NULL pointers for byte arrays in events.
5e2c8cabc1 cleanup: make some improvements to group moderation test
259de4867e cleanup: Remove `bin_pack_{new,free}`.
21a8ff5895 cleanup: skip a do_gc iteration before removing peers marked for deletion
16809dc36e feat: Add dht_get_nodes_response event to the events system.
git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: b03b5712720de9a9901ea12fd741f177327a7021
2024-03-07 23:12:55 +01:00
|
|
|
ToxAV *av, uint32_t friend_number,
|
|
|
|
uint16_t width, uint16_t height,
|
|
|
|
const uint8_t y[/*! max(width, abs(ystride)) * height */],
|
|
|
|
const uint8_t u[/*! max(width/2, abs(ustride)) * (height/2) */],
|
|
|
|
const uint8_t v[/*! max(width/2, abs(vstride)) * (height/2) */],
|
|
|
|
int32_t ystride, int32_t ustride, int32_t vstride,
|
|
|
|
void *user_data);
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the callback for the `video_receive_frame` event. Pass NULL to unset.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
void toxav_callback_video_receive_frame(ToxAV *av, toxav_video_receive_frame_cb *callback, void *user_data);
|
|
|
|
|
2024-01-09 16:39:05 +01:00
|
|
|
#ifndef APIGEN_IGNORE
|
|
|
|
|
2023-07-25 11:53:09 +02:00
|
|
|
/***
|
|
|
|
* NOTE Compatibility with old toxav group calls. TODO(iphydf): remove
|
|
|
|
*
|
|
|
|
* TODO(iphydf): Use proper new API guidelines for these. E.g. don't use inline
|
|
|
|
* function types, don't have per-callback userdata, especially don't have one
|
|
|
|
* userdata per group.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// TODO(iphydf): Use this better typed one instead of the void-pointer one below.
|
2024-01-09 16:39:05 +01:00
|
|
|
typedef void toxav_group_audio_cb(Tox *tox, uint32_t groupnumber, uint32_t peernumber, const int16_t pcm[],
|
2023-07-25 11:53:09 +02:00
|
|
|
uint32_t samples, uint8_t channels, uint32_t sample_rate, void *user_data);
|
|
|
|
|
2024-01-09 16:39:05 +01:00
|
|
|
typedef void toxav_audio_data_cb(void *tox, uint32_t groupnumber, uint32_t peernumber, const int16_t pcm[],
|
2023-07-25 11:53:09 +02:00
|
|
|
uint32_t samples, uint8_t channels, uint32_t sample_rate, void *userdata);
|
|
|
|
|
|
|
|
/** @brief Create a new toxav group.
|
|
|
|
*
|
|
|
|
* @return group number on success.
|
|
|
|
* @retval -1 on failure.
|
|
|
|
*
|
|
|
|
* Note that total size of pcm in bytes is equal to `samples * channels * sizeof(int16_t)`.
|
|
|
|
*/
|
2024-01-09 16:39:05 +01:00
|
|
|
int32_t toxav_add_av_groupchat(Tox *tox, toxav_audio_data_cb *audio_callback, void *userdata);
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
/** @brief Join a AV group (you need to have been invited first).
|
|
|
|
*
|
|
|
|
* @return group number on success.
|
|
|
|
* @retval -1 on failure.
|
|
|
|
*
|
|
|
|
* Note that total size of pcm in bytes is equal to `samples * channels * sizeof(int16_t)`.
|
|
|
|
*/
|
2024-01-09 16:39:05 +01:00
|
|
|
int32_t toxav_join_av_groupchat(
|
Squashed 'external/toxcore/c-toxcore/' changes from e2c01e457b..b03b571272
b03b571272 fix: flaky tcp test This only fixes the symptoms, not the real problem. Sometimes or consistently on some platforms a socket might need a moment before it can be written to.
32e67ab4c2 cleanup: use typedef for private message ID's in callback
7b1db6adc1 feat: add message IDs to private group messages
99e0bcc27d refactor: Observers/ignored peers can now send and receive custom packets
b3c3c49d26 fix: Disable IPv6 in Windows cross-compilation tests
e742deddff feat: Check hashes of Windows dependencies when cross-compiling
dfb9a0b02b fix: Test the current Windows Dockerfile, not an old Dockerhub image
14de93ccec chore: Use WineHQ's Wine as Debian Bookworm's crashes
ed37616249 docs: Update the Windows cross-compilation section
9bb79c174f cleanup: Remove a couple of unnecessary misc_tools dependencies
19475adb70 chore: Statically link OpenMP into the cracker fun util on Windows
1be311e51f feat: Build the fun utils when cross-compiling to Windows
88133f8446 chore: Strip Windows binaries
3cc0ae7535 refactor: Copy over all of the required static dependencies
c4fa8f7fb1 feat: Generate .def, .exp and .lib files when building for Windows
74bbac5363 feat: Let CMake create the dll instead of doing so ourselves
246642e9ae feat: Harden Windows cross-compilation
8d431c0d11 chore: Bump Windows build dependency versions
e519f7998b fix: Remove unnecessary wsock32 dependency on Windows
ed2b60c217 chore: Use a specific non-broken slimcc version.
d7f21010a1 chore: Update github actions.
e71a68b7f2 docs: Update the list of CMake options
77e08876ff chore: Remove mod and founder from group API naming scheme
12bc042767 docs: add the experimental api build option to INSTALL.md
e1fa5cae96 refactor: Rename Queries to Query to align with other enums.
be82a3ea30 fix: Correct type for conference offline peer numbers.
0627c36716 test: Add pkgsrc build.
92578afe4b test: Add FreeBSD VM action on GitHub.
52ece0f57b test: Build toxcore on NetBSD (VM).
3fe8ee2c11 chore: Only install tox_private.h on request.
9a8dfa06ab fix: save_compatibility_test failing on big-endian systems
86f5e55578 fix: Don't serve files from websockify.
710eb674a5 fix: Correctly pass extended public keys to group moderation code.
021db7031c refactor: Use `struct`s for extended public/secret keys.
a1e999fd80 chore: Compile libsodium reference implementation with compcert.
fbe3c19cf5 cleanup: correct a few nullable annotations
623e3ee5c3 cleanup: Don't use `memcpy` to cast arbitrary `struct`s to `uint8_t[]`.
c71567dc18 fix: Pass array, not array pointer, to `memcmp`.
9b46a08144 cleanup: Never pass `void*` directly to `memcpy`.
5d7b7a7bbc refactor: Use tox rng to seed the keypair generation.
961891d568 cleanup: Small improvements found by PVS Studio.
8201019f0d chore: Disable NGC saving by default, enable through Tox_Options.
5dd9ee3f65 cleanup: Replace pointer arithmetic with explicit `&arr[i]`.
ca4606d49d refactor: Use strong typedef for NGC peer id.
442213b722 cleanup: Simplify custom packet length check in NGC.
08d3393def fix: Correct a few potential null derefs in bootstrap daemon.
b9877b32b0 fix: Add missing memunlock of local variable when it goes out of scope.
dab5fe44b9 fix: Zero out stack-allocated secret key before return.
f058103299 refactor: Make prune_gc_sanctions_list more obviously correct.
3ba7a0dec9 docs: Add static analysis tool list to README.
8d0811a0f3 docs: Run prettier-markdown on markdown files.
969e3a2bfc refactor: Fix network test not using the strong typedef
93c83fbc7c refactor: Use strong typedef instead of struct for `Socket`.
9fe18b176f fix: Fix some false positive from PVS Studio.
7c44379ccb cleanup: Check that WINXP macro exists before comparing it.
5c93231bef refactor: Make tox mutex non-recursive.
aacff73939 docs: Fix up doxyfile.
d55fc85ff5 docs: Add more documentation to crypto_core.
5bdaaaedb6 refactor: Remove `Tox *` from `tox_dispatch`.
e202341e76 refactor: Don't rely on tox_dispatch passing tox in tests.
34df938f52 chore: Use C++ mode for clang-tidy.
8b05296a78 chore: Check that both gtest and gmock exist for tests.
42010660e1 test: Add slimcc compiler compatibility test.
b473630321 chore: Add some comments to the astyle config.
b7404f24f6 cleanup: Remove implicit bool conversions.
4e2dba4d9f chore: Reformat sources with astyle.
4359e3a6bc chore: Rename C++ headers to .hh suffixes.
0c05566e58 cleanup: Further `#include` cleanups.
8d29935b7a chore: Only check the bootstrap daemon checksum on release.
f70e588bc6 cleanup: Add more `const` where possible.
511bfe39c8 cleanup: Use Bazel modules to enforce proper `#include` hygiene.
1710a0d091 refactor: Move pack/unpack `IP_Port` from DHT into network module.
a975943564 chore: Really fix coverage docker image build.
c08409390f chore: Fix post-submit coverage image.
39aadf8922 fix: Don't use `memcmp` to compare `IP_Port`s.
d94246a906 fix: partially fix a bug that prevented group part messages from sending.
eeaa039222 chore: Fix rpm build; add a CI check for it.
8328449c1a chore: Speed up docker builds a bit by reducing layer count.
d6d67d56f3 cleanup: Add `const` where possible in auto tests.
6aa9e6850d cleanup: Minor cleanup of event unpack code.
bdf460a3a9 refactor: Rename `system_{memory,...}` to `os_{memory,...}`.
203e1af81e fix: a few off by one errors in group autotests
5c093c4888 cleanup: Remove all uses of `SIZEOF_VLA`.
662c2140f3 test: Add goblint static analyser.
8f07755834 cleanup: Use `memzero(x, s)` instead of `memset(x, 0, s)`.
a7258e40cf cleanup: Use explicit 0 instead of `PACKET_ID_PADDING`.
6370d0f15d cleanup: Expand the `Tox_Options` accessor macros.
14a1a0b9bd cleanup: Remove plan9 support.
a05dccad13 test: Add a simple new/delete test for Tox.
1cdcf938b9 cleanup: Add comment after every `#endif`.
ba99d4dc4b test: Fix comment I broke in the events test PR.
e07248debb refactor: Migrate auto_tests to new events API.
bdd42b5452 refactor: Add common msgpack array packer with callback.
3c659f5288 cleanup: Rename group to conference in groupav documentation.
89957be230 cleanup: Ensure handler params are named after callback params.
c650d9d345 refactor: Pass `this` pointer as first param to s11n callbacks.
e7fb91ddb8 refactor: Allow NULL pointers for byte arrays in events.
5e2c8cabc1 cleanup: make some improvements to group moderation test
259de4867e cleanup: Remove `bin_pack_{new,free}`.
21a8ff5895 cleanup: skip a do_gc iteration before removing peers marked for deletion
16809dc36e feat: Add dht_get_nodes_response event to the events system.
git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: b03b5712720de9a9901ea12fd741f177327a7021
2024-03-07 23:12:55 +01:00
|
|
|
Tox *tox, uint32_t friendnumber, const uint8_t data[], uint16_t length,
|
|
|
|
toxav_audio_data_cb *audio_callback, void *userdata);
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
/** @brief Send audio to the group chat.
|
|
|
|
*
|
|
|
|
* @retval 0 on success.
|
|
|
|
* @retval -1 on failure.
|
|
|
|
*
|
|
|
|
* Note that total size of pcm in bytes is equal to `samples * channels * sizeof(int16_t)`.
|
|
|
|
*
|
|
|
|
* Valid number of samples are `(sample rate) * (audio length) / 1000`
|
|
|
|
* (Valid values for audio length are: 2.5, 5, 10, 20, 40 or 60 ms)
|
|
|
|
* Valid number of channels are 1 or 2.
|
|
|
|
* Valid sample rates are 8000, 12000, 16000, 24000, or 48000.
|
|
|
|
*
|
|
|
|
* Recommended values are: samples = 960, channels = 1, sample_rate = 48000
|
|
|
|
*/
|
2024-01-09 16:39:05 +01:00
|
|
|
int32_t toxav_group_send_audio(
|
Squashed 'external/toxcore/c-toxcore/' changes from e2c01e457b..b03b571272
b03b571272 fix: flaky tcp test This only fixes the symptoms, not the real problem. Sometimes or consistently on some platforms a socket might need a moment before it can be written to.
32e67ab4c2 cleanup: use typedef for private message ID's in callback
7b1db6adc1 feat: add message IDs to private group messages
99e0bcc27d refactor: Observers/ignored peers can now send and receive custom packets
b3c3c49d26 fix: Disable IPv6 in Windows cross-compilation tests
e742deddff feat: Check hashes of Windows dependencies when cross-compiling
dfb9a0b02b fix: Test the current Windows Dockerfile, not an old Dockerhub image
14de93ccec chore: Use WineHQ's Wine as Debian Bookworm's crashes
ed37616249 docs: Update the Windows cross-compilation section
9bb79c174f cleanup: Remove a couple of unnecessary misc_tools dependencies
19475adb70 chore: Statically link OpenMP into the cracker fun util on Windows
1be311e51f feat: Build the fun utils when cross-compiling to Windows
88133f8446 chore: Strip Windows binaries
3cc0ae7535 refactor: Copy over all of the required static dependencies
c4fa8f7fb1 feat: Generate .def, .exp and .lib files when building for Windows
74bbac5363 feat: Let CMake create the dll instead of doing so ourselves
246642e9ae feat: Harden Windows cross-compilation
8d431c0d11 chore: Bump Windows build dependency versions
e519f7998b fix: Remove unnecessary wsock32 dependency on Windows
ed2b60c217 chore: Use a specific non-broken slimcc version.
d7f21010a1 chore: Update github actions.
e71a68b7f2 docs: Update the list of CMake options
77e08876ff chore: Remove mod and founder from group API naming scheme
12bc042767 docs: add the experimental api build option to INSTALL.md
e1fa5cae96 refactor: Rename Queries to Query to align with other enums.
be82a3ea30 fix: Correct type for conference offline peer numbers.
0627c36716 test: Add pkgsrc build.
92578afe4b test: Add FreeBSD VM action on GitHub.
52ece0f57b test: Build toxcore on NetBSD (VM).
3fe8ee2c11 chore: Only install tox_private.h on request.
9a8dfa06ab fix: save_compatibility_test failing on big-endian systems
86f5e55578 fix: Don't serve files from websockify.
710eb674a5 fix: Correctly pass extended public keys to group moderation code.
021db7031c refactor: Use `struct`s for extended public/secret keys.
a1e999fd80 chore: Compile libsodium reference implementation with compcert.
fbe3c19cf5 cleanup: correct a few nullable annotations
623e3ee5c3 cleanup: Don't use `memcpy` to cast arbitrary `struct`s to `uint8_t[]`.
c71567dc18 fix: Pass array, not array pointer, to `memcmp`.
9b46a08144 cleanup: Never pass `void*` directly to `memcpy`.
5d7b7a7bbc refactor: Use tox rng to seed the keypair generation.
961891d568 cleanup: Small improvements found by PVS Studio.
8201019f0d chore: Disable NGC saving by default, enable through Tox_Options.
5dd9ee3f65 cleanup: Replace pointer arithmetic with explicit `&arr[i]`.
ca4606d49d refactor: Use strong typedef for NGC peer id.
442213b722 cleanup: Simplify custom packet length check in NGC.
08d3393def fix: Correct a few potential null derefs in bootstrap daemon.
b9877b32b0 fix: Add missing memunlock of local variable when it goes out of scope.
dab5fe44b9 fix: Zero out stack-allocated secret key before return.
f058103299 refactor: Make prune_gc_sanctions_list more obviously correct.
3ba7a0dec9 docs: Add static analysis tool list to README.
8d0811a0f3 docs: Run prettier-markdown on markdown files.
969e3a2bfc refactor: Fix network test not using the strong typedef
93c83fbc7c refactor: Use strong typedef instead of struct for `Socket`.
9fe18b176f fix: Fix some false positive from PVS Studio.
7c44379ccb cleanup: Check that WINXP macro exists before comparing it.
5c93231bef refactor: Make tox mutex non-recursive.
aacff73939 docs: Fix up doxyfile.
d55fc85ff5 docs: Add more documentation to crypto_core.
5bdaaaedb6 refactor: Remove `Tox *` from `tox_dispatch`.
e202341e76 refactor: Don't rely on tox_dispatch passing tox in tests.
34df938f52 chore: Use C++ mode for clang-tidy.
8b05296a78 chore: Check that both gtest and gmock exist for tests.
42010660e1 test: Add slimcc compiler compatibility test.
b473630321 chore: Add some comments to the astyle config.
b7404f24f6 cleanup: Remove implicit bool conversions.
4e2dba4d9f chore: Reformat sources with astyle.
4359e3a6bc chore: Rename C++ headers to .hh suffixes.
0c05566e58 cleanup: Further `#include` cleanups.
8d29935b7a chore: Only check the bootstrap daemon checksum on release.
f70e588bc6 cleanup: Add more `const` where possible.
511bfe39c8 cleanup: Use Bazel modules to enforce proper `#include` hygiene.
1710a0d091 refactor: Move pack/unpack `IP_Port` from DHT into network module.
a975943564 chore: Really fix coverage docker image build.
c08409390f chore: Fix post-submit coverage image.
39aadf8922 fix: Don't use `memcmp` to compare `IP_Port`s.
d94246a906 fix: partially fix a bug that prevented group part messages from sending.
eeaa039222 chore: Fix rpm build; add a CI check for it.
8328449c1a chore: Speed up docker builds a bit by reducing layer count.
d6d67d56f3 cleanup: Add `const` where possible in auto tests.
6aa9e6850d cleanup: Minor cleanup of event unpack code.
bdf460a3a9 refactor: Rename `system_{memory,...}` to `os_{memory,...}`.
203e1af81e fix: a few off by one errors in group autotests
5c093c4888 cleanup: Remove all uses of `SIZEOF_VLA`.
662c2140f3 test: Add goblint static analyser.
8f07755834 cleanup: Use `memzero(x, s)` instead of `memset(x, 0, s)`.
a7258e40cf cleanup: Use explicit 0 instead of `PACKET_ID_PADDING`.
6370d0f15d cleanup: Expand the `Tox_Options` accessor macros.
14a1a0b9bd cleanup: Remove plan9 support.
a05dccad13 test: Add a simple new/delete test for Tox.
1cdcf938b9 cleanup: Add comment after every `#endif`.
ba99d4dc4b test: Fix comment I broke in the events test PR.
e07248debb refactor: Migrate auto_tests to new events API.
bdd42b5452 refactor: Add common msgpack array packer with callback.
3c659f5288 cleanup: Rename group to conference in groupav documentation.
89957be230 cleanup: Ensure handler params are named after callback params.
c650d9d345 refactor: Pass `this` pointer as first param to s11n callbacks.
e7fb91ddb8 refactor: Allow NULL pointers for byte arrays in events.
5e2c8cabc1 cleanup: make some improvements to group moderation test
259de4867e cleanup: Remove `bin_pack_{new,free}`.
21a8ff5895 cleanup: skip a do_gc iteration before removing peers marked for deletion
16809dc36e feat: Add dht_get_nodes_response event to the events system.
git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: b03b5712720de9a9901ea12fd741f177327a7021
2024-03-07 23:12:55 +01:00
|
|
|
Tox *tox, uint32_t groupnumber, const int16_t pcm[], uint32_t samples, uint8_t channels,
|
|
|
|
uint32_t sample_rate);
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
/** @brief Enable A/V in a groupchat.
|
|
|
|
*
|
|
|
|
* A/V must be enabled on a groupchat for audio to be sent to it and for
|
|
|
|
* received audio to be handled.
|
|
|
|
*
|
|
|
|
* An A/V group created with `toxav_add_av_groupchat` or `toxav_join_av_groupchat`
|
|
|
|
* will start with A/V enabled.
|
|
|
|
*
|
|
|
|
* An A/V group loaded from a savefile will start with A/V disabled.
|
|
|
|
*
|
|
|
|
* @retval 0 on success.
|
|
|
|
* @retval -1 on failure.
|
|
|
|
*
|
|
|
|
* Note that total size of pcm in bytes is equal to `samples * channels * sizeof(int16_t)`.
|
|
|
|
*/
|
2024-01-09 16:39:05 +01:00
|
|
|
int32_t toxav_groupchat_enable_av(
|
Squashed 'external/toxcore/c-toxcore/' changes from e2c01e457b..b03b571272
b03b571272 fix: flaky tcp test This only fixes the symptoms, not the real problem. Sometimes or consistently on some platforms a socket might need a moment before it can be written to.
32e67ab4c2 cleanup: use typedef for private message ID's in callback
7b1db6adc1 feat: add message IDs to private group messages
99e0bcc27d refactor: Observers/ignored peers can now send and receive custom packets
b3c3c49d26 fix: Disable IPv6 in Windows cross-compilation tests
e742deddff feat: Check hashes of Windows dependencies when cross-compiling
dfb9a0b02b fix: Test the current Windows Dockerfile, not an old Dockerhub image
14de93ccec chore: Use WineHQ's Wine as Debian Bookworm's crashes
ed37616249 docs: Update the Windows cross-compilation section
9bb79c174f cleanup: Remove a couple of unnecessary misc_tools dependencies
19475adb70 chore: Statically link OpenMP into the cracker fun util on Windows
1be311e51f feat: Build the fun utils when cross-compiling to Windows
88133f8446 chore: Strip Windows binaries
3cc0ae7535 refactor: Copy over all of the required static dependencies
c4fa8f7fb1 feat: Generate .def, .exp and .lib files when building for Windows
74bbac5363 feat: Let CMake create the dll instead of doing so ourselves
246642e9ae feat: Harden Windows cross-compilation
8d431c0d11 chore: Bump Windows build dependency versions
e519f7998b fix: Remove unnecessary wsock32 dependency on Windows
ed2b60c217 chore: Use a specific non-broken slimcc version.
d7f21010a1 chore: Update github actions.
e71a68b7f2 docs: Update the list of CMake options
77e08876ff chore: Remove mod and founder from group API naming scheme
12bc042767 docs: add the experimental api build option to INSTALL.md
e1fa5cae96 refactor: Rename Queries to Query to align with other enums.
be82a3ea30 fix: Correct type for conference offline peer numbers.
0627c36716 test: Add pkgsrc build.
92578afe4b test: Add FreeBSD VM action on GitHub.
52ece0f57b test: Build toxcore on NetBSD (VM).
3fe8ee2c11 chore: Only install tox_private.h on request.
9a8dfa06ab fix: save_compatibility_test failing on big-endian systems
86f5e55578 fix: Don't serve files from websockify.
710eb674a5 fix: Correctly pass extended public keys to group moderation code.
021db7031c refactor: Use `struct`s for extended public/secret keys.
a1e999fd80 chore: Compile libsodium reference implementation with compcert.
fbe3c19cf5 cleanup: correct a few nullable annotations
623e3ee5c3 cleanup: Don't use `memcpy` to cast arbitrary `struct`s to `uint8_t[]`.
c71567dc18 fix: Pass array, not array pointer, to `memcmp`.
9b46a08144 cleanup: Never pass `void*` directly to `memcpy`.
5d7b7a7bbc refactor: Use tox rng to seed the keypair generation.
961891d568 cleanup: Small improvements found by PVS Studio.
8201019f0d chore: Disable NGC saving by default, enable through Tox_Options.
5dd9ee3f65 cleanup: Replace pointer arithmetic with explicit `&arr[i]`.
ca4606d49d refactor: Use strong typedef for NGC peer id.
442213b722 cleanup: Simplify custom packet length check in NGC.
08d3393def fix: Correct a few potential null derefs in bootstrap daemon.
b9877b32b0 fix: Add missing memunlock of local variable when it goes out of scope.
dab5fe44b9 fix: Zero out stack-allocated secret key before return.
f058103299 refactor: Make prune_gc_sanctions_list more obviously correct.
3ba7a0dec9 docs: Add static analysis tool list to README.
8d0811a0f3 docs: Run prettier-markdown on markdown files.
969e3a2bfc refactor: Fix network test not using the strong typedef
93c83fbc7c refactor: Use strong typedef instead of struct for `Socket`.
9fe18b176f fix: Fix some false positive from PVS Studio.
7c44379ccb cleanup: Check that WINXP macro exists before comparing it.
5c93231bef refactor: Make tox mutex non-recursive.
aacff73939 docs: Fix up doxyfile.
d55fc85ff5 docs: Add more documentation to crypto_core.
5bdaaaedb6 refactor: Remove `Tox *` from `tox_dispatch`.
e202341e76 refactor: Don't rely on tox_dispatch passing tox in tests.
34df938f52 chore: Use C++ mode for clang-tidy.
8b05296a78 chore: Check that both gtest and gmock exist for tests.
42010660e1 test: Add slimcc compiler compatibility test.
b473630321 chore: Add some comments to the astyle config.
b7404f24f6 cleanup: Remove implicit bool conversions.
4e2dba4d9f chore: Reformat sources with astyle.
4359e3a6bc chore: Rename C++ headers to .hh suffixes.
0c05566e58 cleanup: Further `#include` cleanups.
8d29935b7a chore: Only check the bootstrap daemon checksum on release.
f70e588bc6 cleanup: Add more `const` where possible.
511bfe39c8 cleanup: Use Bazel modules to enforce proper `#include` hygiene.
1710a0d091 refactor: Move pack/unpack `IP_Port` from DHT into network module.
a975943564 chore: Really fix coverage docker image build.
c08409390f chore: Fix post-submit coverage image.
39aadf8922 fix: Don't use `memcmp` to compare `IP_Port`s.
d94246a906 fix: partially fix a bug that prevented group part messages from sending.
eeaa039222 chore: Fix rpm build; add a CI check for it.
8328449c1a chore: Speed up docker builds a bit by reducing layer count.
d6d67d56f3 cleanup: Add `const` where possible in auto tests.
6aa9e6850d cleanup: Minor cleanup of event unpack code.
bdf460a3a9 refactor: Rename `system_{memory,...}` to `os_{memory,...}`.
203e1af81e fix: a few off by one errors in group autotests
5c093c4888 cleanup: Remove all uses of `SIZEOF_VLA`.
662c2140f3 test: Add goblint static analyser.
8f07755834 cleanup: Use `memzero(x, s)` instead of `memset(x, 0, s)`.
a7258e40cf cleanup: Use explicit 0 instead of `PACKET_ID_PADDING`.
6370d0f15d cleanup: Expand the `Tox_Options` accessor macros.
14a1a0b9bd cleanup: Remove plan9 support.
a05dccad13 test: Add a simple new/delete test for Tox.
1cdcf938b9 cleanup: Add comment after every `#endif`.
ba99d4dc4b test: Fix comment I broke in the events test PR.
e07248debb refactor: Migrate auto_tests to new events API.
bdd42b5452 refactor: Add common msgpack array packer with callback.
3c659f5288 cleanup: Rename group to conference in groupav documentation.
89957be230 cleanup: Ensure handler params are named after callback params.
c650d9d345 refactor: Pass `this` pointer as first param to s11n callbacks.
e7fb91ddb8 refactor: Allow NULL pointers for byte arrays in events.
5e2c8cabc1 cleanup: make some improvements to group moderation test
259de4867e cleanup: Remove `bin_pack_{new,free}`.
21a8ff5895 cleanup: skip a do_gc iteration before removing peers marked for deletion
16809dc36e feat: Add dht_get_nodes_response event to the events system.
git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: b03b5712720de9a9901ea12fd741f177327a7021
2024-03-07 23:12:55 +01:00
|
|
|
Tox *tox, uint32_t groupnumber,
|
|
|
|
toxav_audio_data_cb *audio_callback, void *userdata);
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
/** @brief Disable A/V in a groupchat.
|
|
|
|
*
|
|
|
|
* @retval 0 on success.
|
|
|
|
* @retval -1 on failure.
|
|
|
|
*/
|
2024-01-09 16:39:05 +01:00
|
|
|
int32_t toxav_groupchat_disable_av(Tox *tox, uint32_t groupnumber);
|
2023-07-25 11:53:09 +02:00
|
|
|
|
|
|
|
/** @brief Return whether A/V is enabled in the groupchat. */
|
|
|
|
bool toxav_groupchat_av_enabled(Tox *tox, uint32_t groupnumber);
|
|
|
|
|
2024-01-09 16:39:05 +01:00
|
|
|
#endif /* !APIGEN_IGNORE */
|
|
|
|
|
2023-07-25 11:53:09 +02:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
Squashed 'external/toxcore/c-toxcore/' changes from e2c01e457b..b03b571272
b03b571272 fix: flaky tcp test This only fixes the symptoms, not the real problem. Sometimes or consistently on some platforms a socket might need a moment before it can be written to.
32e67ab4c2 cleanup: use typedef for private message ID's in callback
7b1db6adc1 feat: add message IDs to private group messages
99e0bcc27d refactor: Observers/ignored peers can now send and receive custom packets
b3c3c49d26 fix: Disable IPv6 in Windows cross-compilation tests
e742deddff feat: Check hashes of Windows dependencies when cross-compiling
dfb9a0b02b fix: Test the current Windows Dockerfile, not an old Dockerhub image
14de93ccec chore: Use WineHQ's Wine as Debian Bookworm's crashes
ed37616249 docs: Update the Windows cross-compilation section
9bb79c174f cleanup: Remove a couple of unnecessary misc_tools dependencies
19475adb70 chore: Statically link OpenMP into the cracker fun util on Windows
1be311e51f feat: Build the fun utils when cross-compiling to Windows
88133f8446 chore: Strip Windows binaries
3cc0ae7535 refactor: Copy over all of the required static dependencies
c4fa8f7fb1 feat: Generate .def, .exp and .lib files when building for Windows
74bbac5363 feat: Let CMake create the dll instead of doing so ourselves
246642e9ae feat: Harden Windows cross-compilation
8d431c0d11 chore: Bump Windows build dependency versions
e519f7998b fix: Remove unnecessary wsock32 dependency on Windows
ed2b60c217 chore: Use a specific non-broken slimcc version.
d7f21010a1 chore: Update github actions.
e71a68b7f2 docs: Update the list of CMake options
77e08876ff chore: Remove mod and founder from group API naming scheme
12bc042767 docs: add the experimental api build option to INSTALL.md
e1fa5cae96 refactor: Rename Queries to Query to align with other enums.
be82a3ea30 fix: Correct type for conference offline peer numbers.
0627c36716 test: Add pkgsrc build.
92578afe4b test: Add FreeBSD VM action on GitHub.
52ece0f57b test: Build toxcore on NetBSD (VM).
3fe8ee2c11 chore: Only install tox_private.h on request.
9a8dfa06ab fix: save_compatibility_test failing on big-endian systems
86f5e55578 fix: Don't serve files from websockify.
710eb674a5 fix: Correctly pass extended public keys to group moderation code.
021db7031c refactor: Use `struct`s for extended public/secret keys.
a1e999fd80 chore: Compile libsodium reference implementation with compcert.
fbe3c19cf5 cleanup: correct a few nullable annotations
623e3ee5c3 cleanup: Don't use `memcpy` to cast arbitrary `struct`s to `uint8_t[]`.
c71567dc18 fix: Pass array, not array pointer, to `memcmp`.
9b46a08144 cleanup: Never pass `void*` directly to `memcpy`.
5d7b7a7bbc refactor: Use tox rng to seed the keypair generation.
961891d568 cleanup: Small improvements found by PVS Studio.
8201019f0d chore: Disable NGC saving by default, enable through Tox_Options.
5dd9ee3f65 cleanup: Replace pointer arithmetic with explicit `&arr[i]`.
ca4606d49d refactor: Use strong typedef for NGC peer id.
442213b722 cleanup: Simplify custom packet length check in NGC.
08d3393def fix: Correct a few potential null derefs in bootstrap daemon.
b9877b32b0 fix: Add missing memunlock of local variable when it goes out of scope.
dab5fe44b9 fix: Zero out stack-allocated secret key before return.
f058103299 refactor: Make prune_gc_sanctions_list more obviously correct.
3ba7a0dec9 docs: Add static analysis tool list to README.
8d0811a0f3 docs: Run prettier-markdown on markdown files.
969e3a2bfc refactor: Fix network test not using the strong typedef
93c83fbc7c refactor: Use strong typedef instead of struct for `Socket`.
9fe18b176f fix: Fix some false positive from PVS Studio.
7c44379ccb cleanup: Check that WINXP macro exists before comparing it.
5c93231bef refactor: Make tox mutex non-recursive.
aacff73939 docs: Fix up doxyfile.
d55fc85ff5 docs: Add more documentation to crypto_core.
5bdaaaedb6 refactor: Remove `Tox *` from `tox_dispatch`.
e202341e76 refactor: Don't rely on tox_dispatch passing tox in tests.
34df938f52 chore: Use C++ mode for clang-tidy.
8b05296a78 chore: Check that both gtest and gmock exist for tests.
42010660e1 test: Add slimcc compiler compatibility test.
b473630321 chore: Add some comments to the astyle config.
b7404f24f6 cleanup: Remove implicit bool conversions.
4e2dba4d9f chore: Reformat sources with astyle.
4359e3a6bc chore: Rename C++ headers to .hh suffixes.
0c05566e58 cleanup: Further `#include` cleanups.
8d29935b7a chore: Only check the bootstrap daemon checksum on release.
f70e588bc6 cleanup: Add more `const` where possible.
511bfe39c8 cleanup: Use Bazel modules to enforce proper `#include` hygiene.
1710a0d091 refactor: Move pack/unpack `IP_Port` from DHT into network module.
a975943564 chore: Really fix coverage docker image build.
c08409390f chore: Fix post-submit coverage image.
39aadf8922 fix: Don't use `memcmp` to compare `IP_Port`s.
d94246a906 fix: partially fix a bug that prevented group part messages from sending.
eeaa039222 chore: Fix rpm build; add a CI check for it.
8328449c1a chore: Speed up docker builds a bit by reducing layer count.
d6d67d56f3 cleanup: Add `const` where possible in auto tests.
6aa9e6850d cleanup: Minor cleanup of event unpack code.
bdf460a3a9 refactor: Rename `system_{memory,...}` to `os_{memory,...}`.
203e1af81e fix: a few off by one errors in group autotests
5c093c4888 cleanup: Remove all uses of `SIZEOF_VLA`.
662c2140f3 test: Add goblint static analyser.
8f07755834 cleanup: Use `memzero(x, s)` instead of `memset(x, 0, s)`.
a7258e40cf cleanup: Use explicit 0 instead of `PACKET_ID_PADDING`.
6370d0f15d cleanup: Expand the `Tox_Options` accessor macros.
14a1a0b9bd cleanup: Remove plan9 support.
a05dccad13 test: Add a simple new/delete test for Tox.
1cdcf938b9 cleanup: Add comment after every `#endif`.
ba99d4dc4b test: Fix comment I broke in the events test PR.
e07248debb refactor: Migrate auto_tests to new events API.
bdd42b5452 refactor: Add common msgpack array packer with callback.
3c659f5288 cleanup: Rename group to conference in groupav documentation.
89957be230 cleanup: Ensure handler params are named after callback params.
c650d9d345 refactor: Pass `this` pointer as first param to s11n callbacks.
e7fb91ddb8 refactor: Allow NULL pointers for byte arrays in events.
5e2c8cabc1 cleanup: make some improvements to group moderation test
259de4867e cleanup: Remove `bin_pack_{new,free}`.
21a8ff5895 cleanup: skip a do_gc iteration before removing peers marked for deletion
16809dc36e feat: Add dht_get_nodes_response event to the events system.
git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: b03b5712720de9a9901ea12fd741f177327a7021
2024-03-07 23:12:55 +01:00
|
|
|
} /* extern "C" */
|
2023-07-25 11:53:09 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
//!TOKSTYLE-
|
|
|
|
#ifndef DOXYGEN_IGNORE
|
|
|
|
|
2024-01-09 16:39:05 +01:00
|
|
|
typedef ToxAV Toxav;
|
2023-07-25 11:53:09 +02:00
|
|
|
typedef Toxav_Err_Call TOXAV_ERR_CALL;
|
|
|
|
typedef Toxav_Err_New TOXAV_ERR_NEW;
|
|
|
|
typedef Toxav_Err_Answer TOXAV_ERR_ANSWER;
|
|
|
|
typedef Toxav_Err_Call_Control TOXAV_ERR_CALL_CONTROL;
|
|
|
|
typedef Toxav_Err_Bit_Rate_Set TOXAV_ERR_BIT_RATE_SET;
|
|
|
|
typedef Toxav_Err_Send_Frame TOXAV_ERR_SEND_FRAME;
|
|
|
|
typedef Toxav_Call_Control TOXAV_CALL_CONTROL;
|
|
|
|
typedef enum Toxav_Friend_Call_State TOXAV_FRIEND_CALL_STATE;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
//!TOKSTYLE+
|
|
|
|
|
Squashed 'external/toxcore/c-toxcore/' changes from e2c01e457b..b03b571272
b03b571272 fix: flaky tcp test This only fixes the symptoms, not the real problem. Sometimes or consistently on some platforms a socket might need a moment before it can be written to.
32e67ab4c2 cleanup: use typedef for private message ID's in callback
7b1db6adc1 feat: add message IDs to private group messages
99e0bcc27d refactor: Observers/ignored peers can now send and receive custom packets
b3c3c49d26 fix: Disable IPv6 in Windows cross-compilation tests
e742deddff feat: Check hashes of Windows dependencies when cross-compiling
dfb9a0b02b fix: Test the current Windows Dockerfile, not an old Dockerhub image
14de93ccec chore: Use WineHQ's Wine as Debian Bookworm's crashes
ed37616249 docs: Update the Windows cross-compilation section
9bb79c174f cleanup: Remove a couple of unnecessary misc_tools dependencies
19475adb70 chore: Statically link OpenMP into the cracker fun util on Windows
1be311e51f feat: Build the fun utils when cross-compiling to Windows
88133f8446 chore: Strip Windows binaries
3cc0ae7535 refactor: Copy over all of the required static dependencies
c4fa8f7fb1 feat: Generate .def, .exp and .lib files when building for Windows
74bbac5363 feat: Let CMake create the dll instead of doing so ourselves
246642e9ae feat: Harden Windows cross-compilation
8d431c0d11 chore: Bump Windows build dependency versions
e519f7998b fix: Remove unnecessary wsock32 dependency on Windows
ed2b60c217 chore: Use a specific non-broken slimcc version.
d7f21010a1 chore: Update github actions.
e71a68b7f2 docs: Update the list of CMake options
77e08876ff chore: Remove mod and founder from group API naming scheme
12bc042767 docs: add the experimental api build option to INSTALL.md
e1fa5cae96 refactor: Rename Queries to Query to align with other enums.
be82a3ea30 fix: Correct type for conference offline peer numbers.
0627c36716 test: Add pkgsrc build.
92578afe4b test: Add FreeBSD VM action on GitHub.
52ece0f57b test: Build toxcore on NetBSD (VM).
3fe8ee2c11 chore: Only install tox_private.h on request.
9a8dfa06ab fix: save_compatibility_test failing on big-endian systems
86f5e55578 fix: Don't serve files from websockify.
710eb674a5 fix: Correctly pass extended public keys to group moderation code.
021db7031c refactor: Use `struct`s for extended public/secret keys.
a1e999fd80 chore: Compile libsodium reference implementation with compcert.
fbe3c19cf5 cleanup: correct a few nullable annotations
623e3ee5c3 cleanup: Don't use `memcpy` to cast arbitrary `struct`s to `uint8_t[]`.
c71567dc18 fix: Pass array, not array pointer, to `memcmp`.
9b46a08144 cleanup: Never pass `void*` directly to `memcpy`.
5d7b7a7bbc refactor: Use tox rng to seed the keypair generation.
961891d568 cleanup: Small improvements found by PVS Studio.
8201019f0d chore: Disable NGC saving by default, enable through Tox_Options.
5dd9ee3f65 cleanup: Replace pointer arithmetic with explicit `&arr[i]`.
ca4606d49d refactor: Use strong typedef for NGC peer id.
442213b722 cleanup: Simplify custom packet length check in NGC.
08d3393def fix: Correct a few potential null derefs in bootstrap daemon.
b9877b32b0 fix: Add missing memunlock of local variable when it goes out of scope.
dab5fe44b9 fix: Zero out stack-allocated secret key before return.
f058103299 refactor: Make prune_gc_sanctions_list more obviously correct.
3ba7a0dec9 docs: Add static analysis tool list to README.
8d0811a0f3 docs: Run prettier-markdown on markdown files.
969e3a2bfc refactor: Fix network test not using the strong typedef
93c83fbc7c refactor: Use strong typedef instead of struct for `Socket`.
9fe18b176f fix: Fix some false positive from PVS Studio.
7c44379ccb cleanup: Check that WINXP macro exists before comparing it.
5c93231bef refactor: Make tox mutex non-recursive.
aacff73939 docs: Fix up doxyfile.
d55fc85ff5 docs: Add more documentation to crypto_core.
5bdaaaedb6 refactor: Remove `Tox *` from `tox_dispatch`.
e202341e76 refactor: Don't rely on tox_dispatch passing tox in tests.
34df938f52 chore: Use C++ mode for clang-tidy.
8b05296a78 chore: Check that both gtest and gmock exist for tests.
42010660e1 test: Add slimcc compiler compatibility test.
b473630321 chore: Add some comments to the astyle config.
b7404f24f6 cleanup: Remove implicit bool conversions.
4e2dba4d9f chore: Reformat sources with astyle.
4359e3a6bc chore: Rename C++ headers to .hh suffixes.
0c05566e58 cleanup: Further `#include` cleanups.
8d29935b7a chore: Only check the bootstrap daemon checksum on release.
f70e588bc6 cleanup: Add more `const` where possible.
511bfe39c8 cleanup: Use Bazel modules to enforce proper `#include` hygiene.
1710a0d091 refactor: Move pack/unpack `IP_Port` from DHT into network module.
a975943564 chore: Really fix coverage docker image build.
c08409390f chore: Fix post-submit coverage image.
39aadf8922 fix: Don't use `memcmp` to compare `IP_Port`s.
d94246a906 fix: partially fix a bug that prevented group part messages from sending.
eeaa039222 chore: Fix rpm build; add a CI check for it.
8328449c1a chore: Speed up docker builds a bit by reducing layer count.
d6d67d56f3 cleanup: Add `const` where possible in auto tests.
6aa9e6850d cleanup: Minor cleanup of event unpack code.
bdf460a3a9 refactor: Rename `system_{memory,...}` to `os_{memory,...}`.
203e1af81e fix: a few off by one errors in group autotests
5c093c4888 cleanup: Remove all uses of `SIZEOF_VLA`.
662c2140f3 test: Add goblint static analyser.
8f07755834 cleanup: Use `memzero(x, s)` instead of `memset(x, 0, s)`.
a7258e40cf cleanup: Use explicit 0 instead of `PACKET_ID_PADDING`.
6370d0f15d cleanup: Expand the `Tox_Options` accessor macros.
14a1a0b9bd cleanup: Remove plan9 support.
a05dccad13 test: Add a simple new/delete test for Tox.
1cdcf938b9 cleanup: Add comment after every `#endif`.
ba99d4dc4b test: Fix comment I broke in the events test PR.
e07248debb refactor: Migrate auto_tests to new events API.
bdd42b5452 refactor: Add common msgpack array packer with callback.
3c659f5288 cleanup: Rename group to conference in groupav documentation.
89957be230 cleanup: Ensure handler params are named after callback params.
c650d9d345 refactor: Pass `this` pointer as first param to s11n callbacks.
e7fb91ddb8 refactor: Allow NULL pointers for byte arrays in events.
5e2c8cabc1 cleanup: make some improvements to group moderation test
259de4867e cleanup: Remove `bin_pack_{new,free}`.
21a8ff5895 cleanup: skip a do_gc iteration before removing peers marked for deletion
16809dc36e feat: Add dht_get_nodes_response event to the events system.
git-subtree-dir: external/toxcore/c-toxcore
git-subtree-split: b03b5712720de9a9901ea12fd741f177327a7021
2024-03-07 23:12:55 +01:00
|
|
|
#endif /* C_TOXCORE_TOXAV_TOXAV_H */
|