2020-03-12 09:10:33 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-3.0-or-later
|
2018-08-26 07:36:42 +08:00
|
|
|
* Copyright © 2016-2018 The TokTok team.
|
2017-01-14 23:46:31 +08:00
|
|
|
* Copyright © 2013-2015 Tox project.
|
2015-06-28 01:20:52 +08:00
|
|
|
*/
|
2020-03-12 09:10:33 +08:00
|
|
|
|
2022-02-05 07:19:58 +08:00
|
|
|
/**
|
2015-06-28 01:20:52 +08:00
|
|
|
* This file contains the group chats code for the backwards compatibility.
|
|
|
|
*/
|
2016-09-01 07:33:20 +08:00
|
|
|
#include "toxav.h"
|
2015-06-28 01:20:52 +08:00
|
|
|
|
2022-03-16 06:01:17 +08:00
|
|
|
#include "../toxcore/tox_struct.h"
|
2016-10-29 04:11:48 +08:00
|
|
|
#include "groupav.h"
|
2016-09-11 22:47:51 +08:00
|
|
|
|
2018-08-13 05:48:48 +08:00
|
|
|
int toxav_add_av_groupchat(Tox *tox, audio_data_cb *audio_callback, void *userdata)
|
2015-06-28 01:20:52 +08:00
|
|
|
{
|
2022-03-16 06:01:17 +08:00
|
|
|
return add_av_groupchat(tox->m->log, tox, tox->m->conferences_object, audio_callback, userdata);
|
2015-06-28 01:20:52 +08:00
|
|
|
}
|
|
|
|
|
2018-02-20 05:58:03 +08:00
|
|
|
int toxav_join_av_groupchat(Tox *tox, uint32_t friendnumber, const uint8_t *data, uint16_t length,
|
2018-08-13 05:48:48 +08:00
|
|
|
audio_data_cb *audio_callback, void *userdata)
|
2015-06-28 01:20:52 +08:00
|
|
|
{
|
2022-03-16 06:01:17 +08:00
|
|
|
return join_av_groupchat(tox->m->log, tox, tox->m->conferences_object, friendnumber, data, length, audio_callback, userdata);
|
2015-06-28 01:20:52 +08:00
|
|
|
}
|
|
|
|
|
2018-02-20 05:58:03 +08:00
|
|
|
int toxav_group_send_audio(Tox *tox, uint32_t groupnumber, const int16_t *pcm, unsigned int samples, uint8_t channels,
|
|
|
|
uint32_t sample_rate)
|
2015-06-28 01:20:52 +08:00
|
|
|
{
|
2022-03-16 06:01:17 +08:00
|
|
|
return group_send_audio(tox->m->conferences_object, groupnumber, pcm, samples, channels, sample_rate);
|
2016-08-10 20:52:40 +08:00
|
|
|
}
|
2019-02-10 08:00:00 +08:00
|
|
|
|
|
|
|
int toxav_groupchat_enable_av(Tox *tox, uint32_t groupnumber, audio_data_cb *audio_callback, void *userdata)
|
|
|
|
{
|
2022-03-16 06:01:17 +08:00
|
|
|
return groupchat_enable_av(tox->m->log, tox, tox->m->conferences_object, groupnumber, audio_callback, userdata);
|
2019-02-10 08:00:00 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int toxav_groupchat_disable_av(Tox *tox, uint32_t groupnumber)
|
|
|
|
{
|
2022-03-16 06:01:17 +08:00
|
|
|
return groupchat_disable_av(tox->m->conferences_object, groupnumber);
|
2019-02-10 08:00:00 +08:00
|
|
|
}
|
2019-02-10 08:00:00 +08:00
|
|
|
|
2022-03-05 08:57:20 +08:00
|
|
|
/** @brief Return whether A/V is enabled in the groupchat. */
|
2019-02-10 08:00:00 +08:00
|
|
|
bool toxav_groupchat_av_enabled(Tox *tox, uint32_t groupnumber)
|
|
|
|
{
|
2022-03-16 06:01:17 +08:00
|
|
|
return groupchat_av_enabled(tox->m->conferences_object, groupnumber);
|
2019-02-10 08:00:00 +08:00
|
|
|
}
|