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:
parent
6f853f6997
commit
3069a59b8c
8
core.cpp
8
core.cpp
@ -141,8 +141,8 @@ void Core::start()
|
||||
toxav_register_callstate_callback(toxav, onAvRequestTimeout, av_OnRequestTimeout, this);
|
||||
toxav_register_callstate_callback(toxav, onAvPeerTimeout, av_OnPeerTimeout, this);
|
||||
|
||||
toxav_register_audio_recv_callback(toxav, playCallAudio);
|
||||
toxav_register_video_recv_callback(toxav, playCallVideo);
|
||||
toxav_register_audio_recv_callback(toxav, playCallAudio, this);
|
||||
toxav_register_video_recv_callback(toxav, playCallVideo, this);
|
||||
|
||||
uint8_t friendAddress[TOX_FRIEND_ADDRESS_SIZE];
|
||||
tox_get_address(tox, friendAddress);
|
||||
@ -1381,7 +1381,7 @@ void Core::cleanupCall(int callId)
|
||||
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)
|
||||
return;
|
||||
@ -1427,7 +1427,7 @@ void Core::sendCallAudio(int callId, ToxAv* toxav)
|
||||
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)
|
||||
return;
|
||||
|
4
core.h
4
core.h
@ -266,9 +266,9 @@ private:
|
||||
|
||||
static void prepareCall(int friendId, int callId, ToxAv *toxav, bool videoEnabled);
|
||||
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 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 checkConnection();
|
||||
|
Loading…
x
Reference in New Issue
Block a user