diff options
Diffstat (limited to 'toxav')
-rw-r--r-- | toxav/toxav.h | 45 | ||||
-rw-r--r-- | toxav/toxav_old.c | 2 | ||||
-rw-r--r-- | toxav/toxav_old.h | 66 |
3 files changed, 45 insertions, 68 deletions
diff --git a/toxav/toxav.h b/toxav/toxav.h index d5641d74..f9d29de4 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h | |||
@@ -640,7 +640,50 @@ typedef void toxav_video_receive_frame_cb(ToxAV *toxAV, uint32_t friend_number, | |||
640 | */ | 640 | */ |
641 | void toxav_callback_video_receive_frame(ToxAV *toxAV, toxav_video_receive_frame_cb *callback, void *user_data); | 641 | void toxav_callback_video_receive_frame(ToxAV *toxAV, toxav_video_receive_frame_cb *callback, void *user_data); |
642 | 642 | ||
643 | #include "toxav_old.h" | 643 | /** |
644 | * NOTE Compatibility with old toxav group calls TODO remove | ||
645 | */ | ||
646 | /* Create a new toxav group. | ||
647 | * | ||
648 | * return group number on success. | ||
649 | * return -1 on failure. | ||
650 | * | ||
651 | * Audio data callback format: | ||
652 | * audio_callback(Tox *tox, int groupnumber, int peernumber, const int16_t *pcm, unsigned int samples, uint8_t channels, unsigned int sample_rate, void *userdata) | ||
653 | * | ||
654 | * Note that total size of pcm in bytes is equal to (samples * channels * sizeof(int16_t)). | ||
655 | */ | ||
656 | int toxav_add_av_groupchat(Tox *tox, void (*audio_callback)(void*, int, int, const int16_t *, unsigned int, uint8_t, | ||
657 | unsigned int, void *), void *userdata); | ||
658 | |||
659 | /* Join a AV group (you need to have been invited first.) | ||
660 | * | ||
661 | * returns group number on success | ||
662 | * returns -1 on failure. | ||
663 | * | ||
664 | * Audio data callback format (same as the one for toxav_add_av_groupchat()): | ||
665 | * audio_callback(Tox *tox, int groupnumber, int peernumber, const int16_t *pcm, unsigned int samples, uint8_t channels, unsigned int sample_rate, void *userdata) | ||
666 | * | ||
667 | * Note that total size of pcm in bytes is equal to (samples * channels * sizeof(int16_t)). | ||
668 | */ | ||
669 | int toxav_join_av_groupchat(Tox *tox, int32_t friendnumber, const uint8_t *data, uint16_t length, | ||
670 | void (*audio_callback)(void*, int, int, const int16_t *, unsigned int, uint8_t, unsigned int, void *), void *userdata); | ||
671 | |||
672 | /* Send audio to the group chat. | ||
673 | * | ||
674 | * return 0 on success. | ||
675 | * return -1 on failure. | ||
676 | * | ||
677 | * Note that total size of pcm in bytes is equal to (samples * channels * sizeof(int16_t)). | ||
678 | * | ||
679 | * Valid number of samples are ((sample rate) * (audio length (Valid ones are: 2.5, 5, 10, 20, 40 or 60 ms)) / 1000) | ||
680 | * Valid number of channels are 1 or 2. | ||
681 | * Valid sample rates are 8000, 12000, 16000, 24000, or 48000. | ||
682 | * | ||
683 | * Recommended values are: samples = 960, channels = 1, sample_rate = 48000 | ||
684 | */ | ||
685 | int toxav_group_send_audio(Tox *tox, int groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels, | ||
686 | unsigned int sample_rate); | ||
644 | 687 | ||
645 | #ifdef __cplusplus | 688 | #ifdef __cplusplus |
646 | } | 689 | } |
diff --git a/toxav/toxav_old.c b/toxav/toxav_old.c index 1f553fc3..61c2f020 100644 --- a/toxav/toxav_old.c +++ b/toxav/toxav_old.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * This file contains the group chats code for the backwards compatibility. | 22 | * This file contains the group chats code for the backwards compatibility. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include "toxav_old.h" | 25 | #include "toxav.h" |
26 | #include "group.h" | 26 | #include "group.h" |
27 | 27 | ||
28 | /* Create a new toxav group. | 28 | /* Create a new toxav group. |
diff --git a/toxav/toxav_old.h b/toxav/toxav_old.h deleted file mode 100644 index 89fe3014..00000000 --- a/toxav/toxav_old.h +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /* toxav_old.h | ||
2 | * | ||
3 | * Copyright (C) 2013-2015 Tox project All Rights Reserved. | ||
4 | * | ||
5 | * This file is part of Tox. | ||
6 | * | ||
7 | * Tox is free software: you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation, either version 3 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * Tox is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with Tox. If not, see <http://www.gnu.org/licenses/>. | ||
19 | * | ||
20 | */ | ||
21 | /** | ||
22 | * This file contains the group chats code for the backwards compatibility. | ||
23 | */ | ||
24 | #include "../toxcore/tox.h" | ||
25 | |||
26 | /* Create a new toxav group. | ||
27 | * | ||
28 | * return group number on success. | ||
29 | * return -1 on failure. | ||
30 | * | ||
31 | * Audio data callback format: | ||
32 | * audio_callback(Tox *tox, int groupnumber, int peernumber, const int16_t *pcm, unsigned int samples, uint8_t channels, unsigned int sample_rate, void *userdata) | ||
33 | * | ||
34 | * Note that total size of pcm in bytes is equal to (samples * channels * sizeof(int16_t)). | ||
35 | */ | ||
36 | int toxav_add_av_groupchat(struct Tox *tox, void (*audio_callback)(void*, int, int, const int16_t *, unsigned int, uint8_t, | ||
37 | unsigned int, void *), void *userdata); | ||
38 | |||
39 | /* Join a AV group (you need to have been invited first.) | ||
40 | * | ||
41 | * returns group number on success | ||
42 | * returns -1 on failure. | ||
43 | * | ||
44 | * Audio data callback format (same as the one for toxav_add_av_groupchat()): | ||
45 | * audio_callback(Tox *tox, int groupnumber, int peernumber, const int16_t *pcm, unsigned int samples, uint8_t channels, unsigned int sample_rate, void *userdata) | ||
46 | * | ||
47 | * Note that total size of pcm in bytes is equal to (samples * channels * sizeof(int16_t)). | ||
48 | */ | ||
49 | int toxav_join_av_groupchat(struct Tox *tox, int32_t friendnumber, const uint8_t *data, uint16_t length, | ||
50 | void (*audio_callback)(void*, int, int, const int16_t *, unsigned int, uint8_t, unsigned int, void *), void *userdata); | ||
51 | |||
52 | /* Send audio to the group chat. | ||
53 | * | ||
54 | * return 0 on success. | ||
55 | * return -1 on failure. | ||
56 | * | ||
57 | * Note that total size of pcm in bytes is equal to (samples * channels * sizeof(int16_t)). | ||
58 | * | ||
59 | * Valid number of samples are ((sample rate) * (audio length (Valid ones are: 2.5, 5, 10, 20, 40 or 60 ms)) / 1000) | ||
60 | * Valid number of channels are 1 or 2. | ||
61 | * Valid sample rates are 8000, 12000, 16000, 24000, or 48000. | ||
62 | * | ||
63 | * Recommended values are: samples = 960, channels = 1, sample_rate = 48000 | ||
64 | */ | ||
65 | int toxav_group_send_audio(struct Tox *tox, int groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels, | ||
66 | unsigned int sample_rate); \ No newline at end of file | ||