diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-08-11 14:11:55 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-08-13 22:11:48 +0000 |
commit | 2d84681529161fd6add331286483ec58c034ba45 (patch) | |
tree | 3c70c1cd84371637856b567e28719b0e889757a2 /toxav/groupav.h | |
parent | b77e407b6fe4800eb9c7abce405f804429884643 (diff) |
Fix ToxAv's use of `struct Tox`.
* Fix `toxav_get_tox` to return tox, not messenger.
* Fix the casts from Tox* to Messenger* in toxav_old.c.
* Pass Tox instead of Messenger to public group AV callbacks.
Diffstat (limited to 'toxav/groupav.h')
-rw-r--r-- | toxav/groupav.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/toxav/groupav.h b/toxav/groupav.h index 4d9efafb..31c9abba 100644 --- a/toxav/groupav.h +++ b/toxav/groupav.h | |||
@@ -21,12 +21,16 @@ | |||
21 | #define C_TOXCORE_TOXAV_GROUPAV_H | 21 | #define C_TOXCORE_TOXAV_GROUPAV_H |
22 | 22 | ||
23 | #include "../toxcore/group.h" | 23 | #include "../toxcore/group.h" |
24 | #include "../toxcore/tox.h" | ||
24 | 25 | ||
25 | /* Audio encoding/decoding */ | 26 | /* Audio encoding/decoding */ |
26 | #include <opus.h> | 27 | #include <opus.h> |
27 | 28 | ||
28 | #define GROUP_AUDIO_PACKET_ID 192 | 29 | #define GROUP_AUDIO_PACKET_ID 192 |
29 | 30 | ||
31 | // TODO(iphydf): Use this better typed one instead of the void-pointer one below. | ||
32 | // typedef void audio_data_cb(Tox *tox, uint32_t groupnumber, uint32_t peernumber, const int16_t *pcm, | ||
33 | // uint32_t samples, uint8_t channels, uint32_t sample_rate, void *userdata); | ||
30 | typedef void audio_data_cb(void *tox, uint32_t groupnumber, uint32_t peernumber, const int16_t *pcm, | 34 | typedef void audio_data_cb(void *tox, uint32_t groupnumber, uint32_t peernumber, const int16_t *pcm, |
31 | uint32_t samples, uint8_t channels, uint32_t sample_rate, void *userdata); | 35 | uint32_t samples, uint8_t channels, uint32_t sample_rate, void *userdata); |
32 | 36 | ||
@@ -35,14 +39,15 @@ typedef void audio_data_cb(void *tox, uint32_t groupnumber, uint32_t peernumber, | |||
35 | * return group number on success. | 39 | * return group number on success. |
36 | * return -1 on failure. | 40 | * return -1 on failure. |
37 | */ | 41 | */ |
38 | int add_av_groupchat(const Logger *log, Group_Chats *g_c, audio_data_cb *audio_callback, void *userdata); | 42 | int add_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, audio_data_cb *audio_callback, void *userdata); |
39 | 43 | ||
40 | /* Join a AV group (you need to have been invited first.) | 44 | /* Join a AV group (you need to have been invited first.) |
41 | * | 45 | * |
42 | * returns group number on success | 46 | * returns group number on success |
43 | * returns -1 on failure. | 47 | * returns -1 on failure. |
44 | */ | 48 | */ |
45 | int join_av_groupchat(const Logger *log, Group_Chats *g_c, uint32_t friendnumber, const uint8_t *data, uint16_t length, | 49 | int join_av_groupchat(const Logger *log, Tox *tox, Group_Chats *g_c, uint32_t friendnumber, const uint8_t *data, |
50 | uint16_t length, | ||
46 | audio_data_cb *audio_callback, void *userdata); | 51 | audio_data_cb *audio_callback, void *userdata); |
47 | 52 | ||
48 | 53 | ||