Merge commit '54c0a3c874c96f50462ab3f1c9d32c592e8bae50'
Some checks failed
ContinuousDelivery / linux-ubuntu (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousDelivery / windows (windows-2022, ) (push) Has been cancelled
ContinuousDelivery / windows (windows-2022, asan) (push) Has been cancelled
ContinuousIntegration / on ubuntu-24.04-arm (push) Has been cancelled
ContinuousIntegration / asan on ubuntu-24.04-arm (push) Has been cancelled
ContinuousIntegration / on ubuntu-latest (push) Has been cancelled
ContinuousIntegration / asan on ubuntu-latest (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android-23]) (push) Has been cancelled
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android-23]) (push) Has been cancelled
ContinuousIntegration / macos (push) Has been cancelled
ContinuousIntegration / windows (push) Has been cancelled
ContinuousDelivery / dumpsyms (push) Has been cancelled
ContinuousDelivery / release (push) Has been cancelled

This commit is contained in:
Green Sky
2025-10-08 12:03:02 +02:00
195 changed files with 3148 additions and 5495 deletions

View File

@@ -489,7 +489,7 @@ static bool reconfigure_audio_encoder(const Logger *log, OpusEncoder **e, uint32
*old_sr = new_sr;
*old_ch = new_ch;
LOGGER_DEBUG(log, "Reconfigured audio encoder br: %d sr: %d cc:%d", new_br, new_sr, new_ch);
LOGGER_DEBUG(log, "Reconfigured audio encoder br: %u sr: %u cc:%d", new_br, new_sr, new_ch);
return true;
}
@@ -504,7 +504,7 @@ static bool reconfigure_audio_decoder(ACSession *ac, uint32_t sampling_rate, uin
OpusDecoder *new_dec = opus_decoder_create(sampling_rate, channels, &status);
if (status != OPUS_OK) {
LOGGER_ERROR(ac->log, "Error while starting audio decoder(%d %d): %s", sampling_rate, channels, opus_strerror(status));
LOGGER_ERROR(ac->log, "Error while starting audio decoder(%u %u): %s", sampling_rate, channels, opus_strerror(status));
return false;
}
@@ -515,7 +515,7 @@ static bool reconfigure_audio_decoder(ACSession *ac, uint32_t sampling_rate, uin
opus_decoder_destroy(ac->decoder);
ac->decoder = new_dec;
LOGGER_DEBUG(ac->log, "Reconfigured audio decoder sr: %d cc: %d", sampling_rate, channels);
LOGGER_DEBUG(ac->log, "Reconfigured audio decoder sr: %u cc: %u", sampling_rate, channels);
}
return true;

View File

@@ -156,7 +156,7 @@ static void send_update(BWController *bwc)
tox_friend_send_lossy_packet(bwc->tox, bwc->friend_number, bwc_packet, sizeof(bwc_packet), &error);
if (error != TOX_ERR_FRIEND_CUSTOM_PACKET_OK) {
LOGGER_WARNING(bwc->log, "BWC send failed: %d", error);
LOGGER_WARNING(bwc->log, "BWC send failed: %u", error);
}
}

View File

@@ -183,7 +183,7 @@ bool check_peer_offline_status(const Logger *log, const Tox *tox, MSISession *se
if (f_con_status == TOX_CONNECTION_NONE) {
/* Friend is now offline */
LOGGER_DEBUG(log, "Friend %d is now offline", friend_number);
LOGGER_DEBUG(log, "Friend %u is now offline", friend_number);
pthread_mutex_lock(session->mutex);
MSICall *call = get_call(session, friend_number);
@@ -575,7 +575,7 @@ static int send_error(const Logger *log, Tox *tox, uint32_t friend_number, MSIEr
assert(tox != nullptr);
/* Send error message */
LOGGER_DEBUG(log, "Sending error: %d to friend: %d", error, friend_number);
LOGGER_DEBUG(log, "Sending error: %u to friend: %u", error, friend_number);
MSIMessage msg;
msg_init(&msg, REQU_POP);
@@ -590,7 +590,7 @@ static int send_error(const Logger *log, Tox *tox, uint32_t friend_number, MSIEr
static int invoke_callback_inner(const Logger *log, MSICall *call, MSICallbackID id)
{
MSISession *session = call->session;
LOGGER_DEBUG(log, "invoking callback function: %d", id);
LOGGER_DEBUG(log, "invoking callback function: %u", id);
switch (id) {
case MSI_ON_INVITE:
@@ -612,7 +612,7 @@ static int invoke_callback_inner(const Logger *log, MSICall *call, MSICallbackID
return session->capabilities_callback(session->av, call);
}
LOGGER_FATAL(log, "invalid callback id: %d", id);
LOGGER_FATAL(log, "invalid callback id: %u", id);
return -1;
}
@@ -803,7 +803,7 @@ static void handle_init(const Logger *log, MSICall *call, const MSIMessage *msg)
{
assert(call != nullptr);
LOGGER_DEBUG(log,
"Session: %p Handling 'init' friend: %d", (void *)call->session, call->friend_number);
"Session: %p Handling 'init' friend: %u", (void *)call->session, call->friend_number);
if (!try_handle_init(log, call, msg)) {
send_error(log, call->session->tox, call->friend_number, call->error);
@@ -815,7 +815,7 @@ static void handle_push(const Logger *log, MSICall *call, const MSIMessage *msg)
{
assert(call != nullptr);
LOGGER_DEBUG(log, "Session: %p Handling 'push' friend: %d", (void *)call->session,
LOGGER_DEBUG(log, "Session: %p Handling 'push' friend: %u", (void *)call->session,
call->friend_number);
if (!msg->capabilities.exists) {
@@ -871,13 +871,13 @@ static void handle_pop(const Logger *log, MSICall *call, const MSIMessage *msg)
{
assert(call != nullptr);
LOGGER_DEBUG(log, "Session: %p Handling 'pop', friend id: %d", (void *)call->session,
LOGGER_DEBUG(log, "Session: %p Handling 'pop', friend id: %u", (void *)call->session,
call->friend_number);
/* callback errors are ignored */
if (msg->error.exists) {
LOGGER_WARNING(log, "Friend detected an error: %d", msg->error.value);
LOGGER_WARNING(log, "Friend detected an error: %u", msg->error.value);
call->error = msg->error.value;
invoke_callback(log, call, MSI_ON_ERROR);
} else {

View File

@@ -308,7 +308,7 @@ static void update_bwc_values(RTPSession *session, const struct RTPMessage *msg)
bwc_add_recv(session->bwc, data_length_full);
if (received_length_full < data_length_full) {
LOGGER_DEBUG(session->log, "BWC: full length=%u received length=%d", data_length_full, received_length_full);
LOGGER_DEBUG(session->log, "BWC: full length=%u received length=%u", data_length_full, received_length_full);
bwc_add_lost(session->bwc, data_length_full - received_length_full);
}
}

View File

@@ -78,9 +78,9 @@ struct RTPHeader {
uint64_t flags;
/**
* The full 32 bit data offset of the current data chunk. The @ref
* offset_lower data member contains the lower 16 bits of this value. For
* frames smaller than 64KiB, @ref offset_full and @ref offset_lower are
* The full 32 bit data offset of the current data chunk. The
* @ref offset_lower data member contains the lower 16 bits of this value.
* For frames smaller than 64KiB, @ref offset_full and @ref offset_lower are
* equal.
*/
uint32_t offset_full;

View File

@@ -737,10 +737,10 @@ bool toxav_audio_set_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t bit_ra
goto RETURN;
}
LOGGER_DEBUG(av->log, "Setting new audio bitrate to: %d", bit_rate);
LOGGER_DEBUG(av->log, "Setting new audio bitrate to: %u", bit_rate);
if (call->audio_bit_rate == bit_rate) {
LOGGER_DEBUG(av->log, "Audio bitrate already set to: %d", bit_rate);
LOGGER_DEBUG(av->log, "Audio bitrate already set to: %u", bit_rate);
} else if (bit_rate == 0) {
LOGGER_DEBUG(av->log, "Turned off audio sending");
@@ -768,7 +768,7 @@ bool toxav_audio_set_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t bit_ra
goto RETURN;
}
} else {
LOGGER_DEBUG(av->log, "Set new audio bit rate %d", bit_rate);
LOGGER_DEBUG(av->log, "Set new audio bit rate %u", bit_rate);
}
call->audio_bit_rate = bit_rate;
@@ -810,10 +810,10 @@ bool toxav_video_set_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t bit_ra
goto RETURN;
}
LOGGER_DEBUG(av->log, "Setting new video bitrate to: %d", bit_rate);
LOGGER_DEBUG(av->log, "Setting new video bitrate to: %u", bit_rate);
if (call->video_bit_rate == bit_rate) {
LOGGER_DEBUG(av->log, "Video bitrate already set to: %d", bit_rate);
LOGGER_DEBUG(av->log, "Video bitrate already set to: %u", bit_rate);
} else if (bit_rate == 0) {
LOGGER_DEBUG(av->log, "Turned off video sending");
@@ -841,7 +841,7 @@ bool toxav_video_set_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t bit_ra
goto RETURN;
}
} else {
LOGGER_DEBUG(av->log, "Set new video bit rate %d", bit_rate);
LOGGER_DEBUG(av->log, "Set new video bit rate %u", bit_rate);
}
call->video_bit_rate = bit_rate;
@@ -1048,13 +1048,13 @@ bool toxav_video_send_frame(ToxAV *av, uint32_t friend_number, uint16_t width, u
if (call->video_rtp->ssrc < VIDEO_SEND_X_KEYFRAMES_FIRST) {
// Key frame flag for first frames
vpx_encode_flags = VPX_EFLAG_FORCE_KF;
LOGGER_DEBUG(av->log, "I_FRAME_FLAG:%d only-i-frame mode", call->video_rtp->ssrc);
LOGGER_DEBUG(av->log, "I_FRAME_FLAG:%u only-i-frame mode", call->video_rtp->ssrc);
++call->video_rtp->ssrc;
} else if (call->video_rtp->ssrc == VIDEO_SEND_X_KEYFRAMES_FIRST) {
// normal keyframe placement
vpx_encode_flags = 0;
LOGGER_DEBUG(av->log, "I_FRAME_FLAG:%d normal mode", call->video_rtp->ssrc);
LOGGER_DEBUG(av->log, "I_FRAME_FLAG:%u normal mode", call->video_rtp->ssrc);
++call->video_rtp->ssrc;
}
@@ -1083,11 +1083,8 @@ bool toxav_video_send_frame(ToxAV *av, uint32_t friend_number, uint16_t width, u
memcpy(img.planes[VPX_PLANE_V], v, (width / 2) * (height / 2));
}
// TODO(zoff99): don't hardcode this, let the application choose it
const unsigned long deadline = VPX_DL_REALTIME;
const vpx_codec_err_t vrc = vpx_codec_encode(call->video->encoder, &img,
call->video->frame_counter, 1, vpx_encode_flags, deadline);
call->video->frame_counter, 1, vpx_encode_flags, VPX_DL_REALTIME);
vpx_img_free(&img);

View File

@@ -14,22 +14,16 @@
typedef struct ToxAVCall ToxAVCall;
#endif /* TOXAV_CALL_DEFINED */
non_null()
ToxAVCall *call_get(ToxAV *av, uint32_t friend_number);
ToxAVCall *_Nullable call_get(ToxAV *_Nonnull av, uint32_t friend_number);
non_null()
RTPSession *rtp_session_get(ToxAVCall *call, int payload_type);
RTPSession *_Nullable rtp_session_get(ToxAVCall *_Nonnull call, int payload_type);
non_null()
MSISession *tox_av_msi_get(const ToxAV *av);
MSISession *_Nullable tox_av_msi_get(const ToxAV *_Nonnull av);
non_null()
BWController *bwc_controller_get(const ToxAVCall *call);
BWController *_Nullable bwc_controller_get(const ToxAVCall *_Nonnull call);
non_null()
Mono_Time *toxav_get_av_mono_time(const ToxAV *av);
Mono_Time *_Nullable toxav_get_av_mono_time(const ToxAV *_Nonnull av);
non_null()
const Logger *toxav_get_logger(const ToxAV *av);
const Logger *_Nonnull toxav_get_logger(const ToxAV *_Nonnull av);
#endif /* C_TOXCORE_TOXAV_HACKS_H */

View File

@@ -91,10 +91,10 @@ static void vc_init_encoder_cfg(const Logger *log, vpx_codec_enc_cfg_t *cfg, int
*/
if (kf_max_dist > 1) {
cfg->kf_max_dist = kf_max_dist; // a full frame every x frames minimum (can be more often, codec decides automatically)
LOGGER_DEBUG(log, "kf_max_dist=%d (1)", cfg->kf_max_dist);
LOGGER_DEBUG(log, "kf_max_dist=%u (1)", cfg->kf_max_dist);
} else {
cfg->kf_max_dist = VPX_MAX_DIST_START;
LOGGER_DEBUG(log, "kf_max_dist=%d (2)", cfg->kf_max_dist);
LOGGER_DEBUG(log, "kf_max_dist=%u (2)", cfg->kf_max_dist);
}
cfg->g_threads = VPX_MAX_ENCODER_THREADS; // Maximum number of threads to use
@@ -213,7 +213,7 @@ VCSession *vc_new(const Logger *log, const Mono_Time *mono_time, ToxAV *av, uint
}
/*
* VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int)
* VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int)
* control function to set noise sensitivity
* 0: off, 1: OnYOnly, 2: OnYUV, 3: OnYUVAggressive, 4: Adaptive
*/