From 4d9aeeec3935bf770f6e6103b7f310fe6d31fbf7 Mon Sep 17 00:00:00 2001 From: tux3 Date: Mon, 12 Oct 2015 16:29:46 +0200 Subject: [PATCH] Fix bitrate callback to match toxav update --- src/core/coreav.cpp | 26 +++++--------------------- src/core/coreav.h | 3 +-- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/core/coreav.cpp b/src/core/coreav.cpp index 336660ebb..2b9ce1728 100644 --- a/src/core/coreav.cpp +++ b/src/core/coreav.cpp @@ -51,8 +51,7 @@ CoreAV::CoreAV(Tox *tox) toxav_callback_call(toxav, CoreAV::callCallback, this); toxav_callback_call_state(toxav, CoreAV::stateCallback, this); - toxav_callback_audio_bit_rate_status(toxav, CoreAV::audioBitrateCallback, this); - toxav_callback_video_bit_rate_status(toxav, CoreAV::videoBitrateCallback, this); + toxav_callback_bit_rate_status(toxav, CoreAV::bitrateCallback, this); toxav_callback_audio_receive_frame(toxav, CoreAV::audioFrameCallback, this); toxav_callback_video_receive_frame(toxav, CoreAV::videoFrameCallback, this); @@ -460,34 +459,19 @@ void CoreAV::stateCallback(ToxAV* toxav, uint32_t friendNum, uint32_t state, voi } } -void CoreAV::audioBitrateCallback(ToxAV* toxav, uint32_t friendNum, bool stable, uint32_t rate, void *_self) +void CoreAV::bitrateCallback(ToxAV* toxav, uint32_t friendNum, uint32_t arate, uint32_t vrate, void *_self) { CoreAV* self = static_cast(_self); // Run this slow path callback asynchronously on the AV thread to avoid deadlocks if (QThread::currentThread() != self->coreavThread.get()) { - return (void)QMetaObject::invokeMethod(self, "audioBitrateCallback", Qt::QueuedConnection, + return (void)QMetaObject::invokeMethod(self, "bitrateCallback", Qt::QueuedConnection, Q_ARG(ToxAV*, toxav), Q_ARG(uint32_t, friendNum), - Q_ARG(bool, stable), Q_ARG(uint32_t, rate), Q_ARG(void*, _self)); + Q_ARG(uint32_t, arate), Q_ARG(uint32_t, vrate), Q_ARG(void*, _self)); } - qDebug() << "Audio bitrate with"<(_self); - - // Run this slow path callback asynchronously on the AV thread to avoid deadlocks - if (QThread::currentThread() != self->coreavThread.get()) - { - return (void)QMetaObject::invokeMethod(self, "videoBitrateCallback", Qt::QueuedConnection, - Q_ARG(ToxAV*, toxav), Q_ARG(uint32_t, friendNum), - Q_ARG(bool, stable), Q_ARG(uint32_t, rate), Q_ARG(void*, _self)); - } - - qDebug() << "Video bitrate with"<