1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Update to latest toxav

Fix new callbacks including user data
Thanks to @suhr in #178 for reporting the breakage.
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-08-03 00:29:56 +02:00
parent 6f853f6997
commit 3069a59b8c
2 changed files with 6 additions and 6 deletions

View File

@ -141,8 +141,8 @@ void Core::start()
toxav_register_callstate_callback(toxav, onAvRequestTimeout, av_OnRequestTimeout, this); toxav_register_callstate_callback(toxav, onAvRequestTimeout, av_OnRequestTimeout, this);
toxav_register_callstate_callback(toxav, onAvPeerTimeout, av_OnPeerTimeout, this); toxav_register_callstate_callback(toxav, onAvPeerTimeout, av_OnPeerTimeout, this);
toxav_register_audio_recv_callback(toxav, playCallAudio); toxav_register_audio_recv_callback(toxav, playCallAudio, this);
toxav_register_video_recv_callback(toxav, playCallVideo); toxav_register_video_recv_callback(toxav, playCallVideo, this);
uint8_t friendAddress[TOX_FRIEND_ADDRESS_SIZE]; uint8_t friendAddress[TOX_FRIEND_ADDRESS_SIZE];
tox_get_address(tox, friendAddress); tox_get_address(tox, friendAddress);
@ -1381,7 +1381,7 @@ void Core::cleanupCall(int callId)
calls[callId].audioBuffer.clear(); calls[callId].audioBuffer.clear();
} }
void Core::playCallAudio(ToxAv*, int32_t callId, int16_t *data, int length) void Core::playCallAudio(ToxAv*, int32_t callId, int16_t *data, int length, void *user_data)
{ {
if (!calls[callId].active || calls[callId].audioOutput == nullptr) if (!calls[callId].active || calls[callId].audioOutput == nullptr)
return; return;
@ -1427,7 +1427,7 @@ void Core::sendCallAudio(int callId, ToxAv* toxav)
calls[callId].sendAudioTimer->start(); calls[callId].sendAudioTimer->start();
} }
void Core::playCallVideo(ToxAv*, int32_t callId, vpx_image_t* img) void Core::playCallVideo(ToxAv*, int32_t callId, vpx_image_t* img, void *user_data)
{ {
if (!calls[callId].active || !calls[callId].videoEnabled) if (!calls[callId].active || !calls[callId].videoEnabled)
return; return;

4
core.h
View File

@ -266,9 +266,9 @@ private:
static void prepareCall(int friendId, int callId, ToxAv *toxav, bool videoEnabled); static void prepareCall(int friendId, int callId, ToxAv *toxav, bool videoEnabled);
static void cleanupCall(int callId); static void cleanupCall(int callId);
static void playCallAudio(ToxAv *toxav, int32_t callId, int16_t *data, int length); // Callback static void playCallAudio(ToxAv *toxav, int32_t callId, int16_t *data, int length, void *user_data); // Callback
static void sendCallAudio(int callId, ToxAv* toxav); static void sendCallAudio(int callId, ToxAv* toxav);
static void playCallVideo(ToxAv* toxav, int32_t callId, vpx_image_t* img); static void playCallVideo(ToxAv* toxav, int32_t callId, vpx_image_t* img, void *user_data);
void sendCallVideo(int callId); void sendCallVideo(int callId);
void checkConnection(); void checkConnection();