2014-09-02 02:45:48 +08:00
|
|
|
/*
|
|
|
|
Copyright (C) 2013 by Maxim Biro <nurupo.contributions@gmail.com>
|
|
|
|
|
|
|
|
This file is part of Tox Qt GUI.
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the COPYING file for more details.
|
|
|
|
*/
|
|
|
|
|
2014-08-28 20:30:38 +08:00
|
|
|
#include "core.h"
|
2015-05-14 10:46:28 +08:00
|
|
|
#include "src/video/camerasource.h"
|
|
|
|
#include "src/video/corevideosource.h"
|
|
|
|
#include "src/video/videoframe.h"
|
2015-04-24 08:32:09 +08:00
|
|
|
#include "src/audio.h"
|
2014-12-14 16:50:18 +08:00
|
|
|
#ifdef QTOX_FILTER_AUDIO
|
2015-04-24 08:32:09 +08:00
|
|
|
#include "src/audiofilterer.h"
|
2014-12-14 16:50:18 +08:00
|
|
|
#endif
|
2015-04-24 08:32:09 +08:00
|
|
|
#include "src/misc/settings.h"
|
2014-09-11 21:44:34 +08:00
|
|
|
#include <QDebug>
|
|
|
|
#include <QTimer>
|
2014-08-28 20:30:38 +08:00
|
|
|
|
|
|
|
ToxCall Core::calls[TOXAV_MAX_CALLS];
|
2014-12-14 16:50:18 +08:00
|
|
|
#ifdef QTOX_FILTER_AUDIO
|
2015-01-30 04:23:33 +08:00
|
|
|
AudioFilterer * Core::filterer[TOXAV_MAX_CALLS] {nullptr};
|
2014-12-14 16:50:18 +08:00
|
|
|
#endif
|
2014-08-28 20:30:38 +08:00
|
|
|
const int Core::videobufsize{TOXAV_MAX_VIDEO_WIDTH * TOXAV_MAX_VIDEO_HEIGHT * 4};
|
|
|
|
uint8_t* Core::videobuf;
|
|
|
|
|
2014-10-15 09:04:53 +08:00
|
|
|
bool Core::anyActiveCalls()
|
|
|
|
{
|
|
|
|
for (auto& call : calls)
|
2015-04-24 19:01:50 +08:00
|
|
|
{
|
2014-10-15 09:04:53 +08:00
|
|
|
if (call.active)
|
|
|
|
return true;
|
2015-04-24 19:01:50 +08:00
|
|
|
}
|
2014-10-15 09:04:53 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-04-20 05:12:44 +08:00
|
|
|
void Core::prepareCall(uint32_t friendId, int32_t callId, ToxAv* toxav, bool videoEnabled)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("preparing call %1").arg(callId);
|
2015-05-10 06:03:05 +08:00
|
|
|
|
|
|
|
if (!videobuf)
|
|
|
|
videobuf = new uint8_t[videobufsize];
|
|
|
|
|
2014-08-28 20:30:38 +08:00
|
|
|
calls[callId].callId = callId;
|
|
|
|
calls[callId].friendId = friendId;
|
2014-08-28 23:46:45 +08:00
|
|
|
calls[callId].muteMic = false;
|
2014-10-28 20:50:30 +08:00
|
|
|
calls[callId].muteVol = false;
|
2014-08-28 20:30:38 +08:00
|
|
|
// the following three lines are also now redundant from startCall, but are
|
|
|
|
// necessary there for outbound and here for inbound
|
|
|
|
calls[callId].codecSettings = av_DefaultSettings;
|
|
|
|
calls[callId].codecSettings.max_video_width = TOXAV_MAX_VIDEO_WIDTH;
|
|
|
|
calls[callId].codecSettings.max_video_height = TOXAV_MAX_VIDEO_HEIGHT;
|
|
|
|
calls[callId].videoEnabled = videoEnabled;
|
2014-11-18 06:17:54 +08:00
|
|
|
int r = toxav_prepare_transmission(toxav, callId, videoEnabled);
|
2014-11-14 08:05:43 +08:00
|
|
|
if (r < 0)
|
|
|
|
qWarning() << QString("Error starting call %1: toxav_prepare_transmission failed with %2").arg(callId).arg(r);
|
2014-08-28 20:30:38 +08:00
|
|
|
|
2014-08-30 20:40:41 +08:00
|
|
|
// Audio
|
2014-11-17 02:04:45 +08:00
|
|
|
Audio::suscribeInput();
|
2014-08-28 23:13:26 +08:00
|
|
|
|
2014-08-28 20:30:38 +08:00
|
|
|
// Go
|
|
|
|
calls[callId].active = true;
|
2014-08-28 23:46:45 +08:00
|
|
|
calls[callId].sendAudioTimer->setInterval(5);
|
|
|
|
calls[callId].sendAudioTimer->setSingleShot(true);
|
|
|
|
connect(calls[callId].sendAudioTimer, &QTimer::timeout, [=](){sendCallAudio(callId,toxav);});
|
|
|
|
calls[callId].sendAudioTimer->start();
|
2014-08-28 20:30:38 +08:00
|
|
|
if (calls[callId].videoEnabled)
|
|
|
|
{
|
2015-05-14 10:46:28 +08:00
|
|
|
calls[callId].videoSource = new CoreVideoSource;
|
|
|
|
calls[callId].camera = new CameraSource;
|
|
|
|
calls[callId].camera->subscribe();
|
|
|
|
connect(calls[callId].camera, &VideoSource::frameAvailable,
|
|
|
|
[=](std::shared_ptr<VideoFrame> frame){sendCallVideo(callId,toxav,frame);});
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
2014-12-14 16:50:18 +08:00
|
|
|
|
|
|
|
#ifdef QTOX_FILTER_AUDIO
|
|
|
|
if (Settings::getInstance().getFilterAudio())
|
|
|
|
{
|
2015-03-12 10:13:18 +08:00
|
|
|
filterer[callId] = new AudioFilterer();
|
2014-12-14 16:50:18 +08:00
|
|
|
filterer[callId]->startFilter(48000);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-12-17 08:05:13 +08:00
|
|
|
delete filterer[callId];
|
2014-12-14 16:50:18 +08:00
|
|
|
filterer[callId] = nullptr;
|
|
|
|
}
|
|
|
|
#endif
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
2014-08-30 01:20:34 +08:00
|
|
|
void Core::onAvMediaChange(void* toxav, int32_t callId, void* core)
|
2014-08-28 21:46:11 +08:00
|
|
|
{
|
2014-10-27 04:31:25 +08:00
|
|
|
int friendId;
|
2015-05-10 04:35:15 +08:00
|
|
|
int cap = toxav_capability_supported((ToxAv*)toxav, callId,
|
|
|
|
(ToxAvCapabilities)(av_VideoEncoding|av_VideoDecoding));
|
|
|
|
if (!cap)
|
2014-10-27 04:31:25 +08:00
|
|
|
goto fail;
|
2015-04-24 19:01:50 +08:00
|
|
|
|
2015-05-10 04:35:15 +08:00
|
|
|
friendId = toxav_get_peer_id((ToxAv*)toxav, callId, 0);
|
2014-10-27 04:31:25 +08:00
|
|
|
if (friendId < 0)
|
|
|
|
goto fail;
|
2014-08-30 01:20:34 +08:00
|
|
|
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << "Received media change from friend "<<friendId;
|
2014-08-30 01:20:34 +08:00
|
|
|
|
2015-05-10 04:35:15 +08:00
|
|
|
if (cap == (av_VideoEncoding|av_VideoDecoding)) // Video call
|
2014-08-30 01:20:34 +08:00
|
|
|
{
|
2015-05-31 04:44:56 +08:00
|
|
|
emit static_cast<Core*>(core)->avMediaChange(friendId, callId, true);
|
2015-05-14 10:46:28 +08:00
|
|
|
calls[callId].videoSource = new CoreVideoSource;
|
|
|
|
calls[callId].camera = new CameraSource;
|
|
|
|
calls[callId].camera->subscribe();
|
|
|
|
calls[callId].videoEnabled = true;
|
2014-08-30 01:20:34 +08:00
|
|
|
}
|
2015-05-10 04:35:15 +08:00
|
|
|
else // Audio call
|
|
|
|
{
|
2015-05-31 04:44:56 +08:00
|
|
|
emit static_cast<Core*>(core)->avMediaChange(friendId, callId, false);
|
2015-05-14 10:46:28 +08:00
|
|
|
calls[callId].videoEnabled = false;
|
|
|
|
delete calls[callId].camera;
|
|
|
|
calls[callId].camera = nullptr;
|
|
|
|
calls[callId].videoSource->setDeleteOnClose(true);
|
|
|
|
calls[callId].videoSource = nullptr;
|
2015-05-10 04:35:15 +08:00
|
|
|
}
|
|
|
|
|
2014-10-27 04:31:25 +08:00
|
|
|
return;
|
|
|
|
|
|
|
|
fail: // Centralized error handling
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "Toxcore error while receiving media change on call "<<callId;
|
2014-10-27 04:31:25 +08:00
|
|
|
return;
|
2014-08-28 21:46:11 +08:00
|
|
|
}
|
|
|
|
|
2015-04-20 05:12:44 +08:00
|
|
|
void Core::answerCall(int32_t callId)
|
2014-08-28 21:46:11 +08:00
|
|
|
{
|
2015-04-24 08:32:09 +08:00
|
|
|
int friendId = toxav_get_peer_id(toxav, callId, 0);
|
2014-08-28 21:46:11 +08:00
|
|
|
if (friendId < 0)
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "Received invalid AV answer peer ID";
|
2014-08-28 21:46:11 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ToxAvCSettings* transSettings = new ToxAvCSettings;
|
|
|
|
int err = toxav_get_peer_csettings(toxav, callId, 0, transSettings);
|
2014-11-18 06:17:54 +08:00
|
|
|
if (err != av_ErrorNone)
|
2014-08-28 21:46:11 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "answerCall: error getting call settings";
|
2014-08-28 21:46:11 +08:00
|
|
|
delete transSettings;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-11-18 06:17:54 +08:00
|
|
|
if (transSettings->call_type == av_TypeVideo)
|
2014-08-28 21:46:11 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("answering call %1 with video").arg(callId);
|
2014-08-28 21:46:11 +08:00
|
|
|
toxav_answer(toxav, callId, transSettings);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("answering call %1 without video").arg(callId);
|
2014-08-28 21:46:11 +08:00
|
|
|
toxav_answer(toxav, callId, transSettings);
|
|
|
|
}
|
|
|
|
|
|
|
|
delete transSettings;
|
|
|
|
}
|
|
|
|
|
2015-04-20 05:12:44 +08:00
|
|
|
void Core::hangupCall(int32_t callId)
|
2014-08-28 21:46:11 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("hanging up call %1").arg(callId);
|
2014-08-28 21:46:11 +08:00
|
|
|
calls[callId].active = false;
|
|
|
|
toxav_hangup(toxav, callId);
|
|
|
|
}
|
|
|
|
|
2015-04-20 05:12:44 +08:00
|
|
|
void Core::rejectCall(int32_t callId)
|
2015-01-25 11:57:20 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("rejecting call %1").arg(callId);
|
2015-01-25 11:57:20 +08:00
|
|
|
calls[callId].active = false;
|
|
|
|
toxav_reject(toxav, callId, nullptr);
|
|
|
|
}
|
|
|
|
|
2015-04-20 05:12:44 +08:00
|
|
|
void Core::startCall(uint32_t friendId, bool video)
|
2014-08-28 21:46:11 +08:00
|
|
|
{
|
2015-04-20 05:12:44 +08:00
|
|
|
int32_t callId;
|
2014-08-28 21:46:11 +08:00
|
|
|
ToxAvCSettings cSettings = av_DefaultSettings;
|
|
|
|
cSettings.max_video_width = TOXAV_MAX_VIDEO_WIDTH;
|
|
|
|
cSettings.max_video_height = TOXAV_MAX_VIDEO_HEIGHT;
|
|
|
|
if (video)
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("Starting new call with %1 with video").arg(friendId);
|
2014-11-18 06:17:54 +08:00
|
|
|
cSettings.call_type = av_TypeVideo;
|
2014-10-25 17:29:25 +08:00
|
|
|
if (toxav_call(toxav, &callId, friendId, &cSettings, TOXAV_RINGING_TIME) == 0)
|
|
|
|
{
|
|
|
|
calls[callId].videoEnabled=true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << QString("Failed to start new video call with %1").arg(friendId);
|
2014-10-25 17:29:25 +08:00
|
|
|
emit avCallFailed(friendId);
|
|
|
|
return;
|
|
|
|
}
|
2014-08-28 21:46:11 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("Starting new call with %1 without video").arg(friendId);
|
2014-11-18 06:17:54 +08:00
|
|
|
cSettings.call_type = av_TypeAudio;
|
2014-10-25 17:29:25 +08:00
|
|
|
if (toxav_call(toxav, &callId, friendId, &cSettings, TOXAV_RINGING_TIME) == 0)
|
|
|
|
{
|
|
|
|
calls[callId].videoEnabled=false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << QString("Failed to start new audio call with %1").arg(friendId);
|
2014-10-25 17:29:25 +08:00
|
|
|
emit avCallFailed(friendId);
|
|
|
|
return;
|
|
|
|
}
|
2014-08-28 21:46:11 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-04-20 05:12:44 +08:00
|
|
|
void Core::cancelCall(int32_t callId, uint32_t friendId)
|
2014-08-28 21:46:11 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("Cancelling call with %1").arg(friendId);
|
2014-08-28 21:46:11 +08:00
|
|
|
calls[callId].active = false;
|
2015-01-25 11:57:20 +08:00
|
|
|
toxav_cancel(toxav, callId, friendId, nullptr);
|
2014-08-28 21:46:11 +08:00
|
|
|
}
|
|
|
|
|
2015-04-20 05:12:44 +08:00
|
|
|
void Core::cleanupCall(int32_t callId)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("cleaning up call %1").arg(callId);
|
2014-08-28 20:30:38 +08:00
|
|
|
calls[callId].active = false;
|
|
|
|
disconnect(calls[callId].sendAudioTimer,0,0,0);
|
|
|
|
calls[callId].sendAudioTimer->stop();
|
|
|
|
if (calls[callId].videoEnabled)
|
2015-05-14 10:46:28 +08:00
|
|
|
{
|
|
|
|
delete calls[callId].camera;
|
|
|
|
calls[callId].camera = nullptr;
|
|
|
|
calls[callId].videoSource->setDeleteOnClose(true);
|
|
|
|
calls[callId].videoSource = nullptr;
|
|
|
|
}
|
2015-04-24 19:01:50 +08:00
|
|
|
|
2014-11-17 02:04:45 +08:00
|
|
|
Audio::unsuscribeInput();
|
2015-01-05 01:53:02 +08:00
|
|
|
toxav_kill_transmission(Core::getInstance()->toxav, callId);
|
2015-05-10 06:03:05 +08:00
|
|
|
|
|
|
|
if (!anyActiveCalls())
|
|
|
|
{
|
|
|
|
delete[] videobuf;
|
|
|
|
videobuf = nullptr;
|
|
|
|
}
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
2014-11-18 06:17:54 +08:00
|
|
|
void Core::playCallAudio(void* toxav, int32_t callId, const int16_t *data, uint16_t samples, void *user_data)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
|
|
|
Q_UNUSED(user_data);
|
|
|
|
|
2015-05-12 08:45:04 +08:00
|
|
|
if (!calls[callId].active || calls[callId].muteVol)
|
2014-08-28 20:30:38 +08:00
|
|
|
return;
|
2014-08-28 21:46:11 +08:00
|
|
|
|
2014-11-17 02:04:45 +08:00
|
|
|
if (!calls[callId].alSource)
|
|
|
|
alGenSources(1, &calls[callId].alSource);
|
|
|
|
|
2014-08-29 05:06:53 +08:00
|
|
|
ToxAvCSettings dest;
|
2014-12-12 02:05:52 +08:00
|
|
|
if (toxav_get_peer_csettings((ToxAv*)toxav, callId, 0, &dest) == 0)
|
2014-11-11 23:15:56 +08:00
|
|
|
playAudioBuffer(calls[callId].alSource, data, samples, dest.audio_channels, dest.audio_sample_rate);
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
2015-04-20 05:12:44 +08:00
|
|
|
void Core::sendCallAudio(int32_t callId, ToxAv* toxav)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
2014-08-28 23:13:26 +08:00
|
|
|
if (!calls[callId].active)
|
2014-08-28 20:30:38 +08:00
|
|
|
return;
|
2014-08-28 23:13:26 +08:00
|
|
|
|
2015-01-05 00:55:39 +08:00
|
|
|
if (calls[callId].muteMic || !Audio::isInputReady())
|
2014-08-28 23:46:45 +08:00
|
|
|
{
|
|
|
|
calls[callId].sendAudioTimer->start();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-11-16 00:04:09 +08:00
|
|
|
const int framesize = (calls[callId].codecSettings.audio_frame_duration * calls[callId].codecSettings.audio_sample_rate) / 1000 * av_DefaultSettings.audio_channels;
|
|
|
|
const int bufsize = framesize * 2 * av_DefaultSettings.audio_channels;
|
2015-01-30 04:23:33 +08:00
|
|
|
uint8_t buf[bufsize];
|
2014-08-28 23:13:26 +08:00
|
|
|
|
2015-01-05 00:55:39 +08:00
|
|
|
if (Audio::tryCaptureSamples(buf, framesize))
|
2014-08-28 23:13:26 +08:00
|
|
|
{
|
2015-02-18 13:20:31 +08:00
|
|
|
#ifdef QTOX_FILTER_AUDIO
|
2015-03-12 10:13:18 +08:00
|
|
|
if (Settings::getInstance().getFilterAudio())
|
2015-02-18 14:25:25 +08:00
|
|
|
{
|
2015-03-12 10:13:18 +08:00
|
|
|
if (!filterer[callId])
|
|
|
|
{
|
|
|
|
filterer[callId] = new AudioFilterer();
|
|
|
|
filterer[callId]->startFilter(48000);
|
|
|
|
}
|
2015-02-18 14:25:25 +08:00
|
|
|
// is a null op #ifndef ALC_LOOPBACK_CAPTURE_SAMPLES
|
|
|
|
Audio::getEchoesToFilter(filterer[callId], framesize);
|
|
|
|
|
2015-02-18 13:20:31 +08:00
|
|
|
filterer[callId]->filterAudio((int16_t*) buf, framesize);
|
2015-02-18 14:25:25 +08:00
|
|
|
}
|
2015-03-12 10:13:18 +08:00
|
|
|
else if (filterer[callId])
|
|
|
|
{
|
|
|
|
delete filterer[callId];
|
|
|
|
filterer[callId] = nullptr;
|
|
|
|
}
|
2015-02-18 13:20:31 +08:00
|
|
|
#endif
|
|
|
|
|
2015-01-30 04:23:33 +08:00
|
|
|
uint8_t dest[bufsize];
|
2014-08-28 23:13:26 +08:00
|
|
|
int r;
|
2014-12-12 02:05:52 +08:00
|
|
|
if ((r = toxav_prepare_audio_frame(toxav, callId, dest, framesize*2, (int16_t*)buf, framesize)) < 0)
|
2014-08-28 23:13:26 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << "toxav_prepare_audio_frame error";
|
2014-08-28 23:13:26 +08:00
|
|
|
calls[callId].sendAudioTimer->start();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-12-12 02:05:52 +08:00
|
|
|
if ((r = toxav_send_audio(toxav, callId, dest, r)) < 0)
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << "toxav_send_audio error";
|
2014-08-28 23:13:26 +08:00
|
|
|
}
|
|
|
|
calls[callId].sendAudioTimer->start();
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
2014-11-18 06:17:54 +08:00
|
|
|
void Core::playCallVideo(void*, int32_t callId, const vpx_image_t* img, void *user_data)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
|
|
|
Q_UNUSED(user_data);
|
|
|
|
|
|
|
|
if (!calls[callId].active || !calls[callId].videoEnabled)
|
|
|
|
return;
|
|
|
|
|
2015-05-14 10:46:28 +08:00
|
|
|
calls[callId].videoSource->pushFrame(img);
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
2015-05-14 10:46:28 +08:00
|
|
|
void Core::sendCallVideo(int32_t callId, ToxAv* toxav, std::shared_ptr<VideoFrame> vframe)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
|
|
|
if (!calls[callId].active || !calls[callId].videoEnabled)
|
|
|
|
return;
|
|
|
|
|
2015-05-14 10:46:28 +08:00
|
|
|
// This frame shares vframe's buffers, we don't call vpx_img_free but just delete it
|
|
|
|
vpx_image* frame = vframe->toVpxImage();
|
|
|
|
if (frame->fmt == VPX_IMG_FMT_NONE)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
2015-05-14 10:46:28 +08:00
|
|
|
qWarning() << "Invalid frame";
|
|
|
|
delete frame;
|
|
|
|
return;
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
2015-05-14 10:46:28 +08:00
|
|
|
|
|
|
|
int result;
|
|
|
|
if ((result = toxav_prepare_video_frame(toxav, callId, videobuf, videobufsize, frame)) < 0)
|
2014-08-30 01:20:34 +08:00
|
|
|
{
|
2015-05-14 10:46:28 +08:00
|
|
|
qDebug() << QString("toxav_prepare_video_frame: error %1").arg(result);
|
|
|
|
delete frame;
|
|
|
|
return;
|
2014-08-30 01:20:34 +08:00
|
|
|
}
|
2014-08-28 20:30:38 +08:00
|
|
|
|
2015-05-14 10:46:28 +08:00
|
|
|
if ((result = toxav_send_video(toxav, callId, (uint8_t*)videobuf, result)) < 0)
|
|
|
|
qDebug() << QString("toxav_send_video error: %1").arg(result);
|
|
|
|
|
|
|
|
delete frame;
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
2015-04-20 05:12:44 +08:00
|
|
|
void Core::micMuteToggle(int32_t callId)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
2014-12-14 16:50:18 +08:00
|
|
|
if (calls[callId].active)
|
2014-09-22 04:33:07 +08:00
|
|
|
calls[callId].muteMic = !calls[callId].muteMic;
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
2015-04-20 05:12:44 +08:00
|
|
|
void Core::volMuteToggle(int32_t callId)
|
2014-10-28 20:50:30 +08:00
|
|
|
{
|
2014-12-14 16:50:18 +08:00
|
|
|
if (calls[callId].active)
|
2014-10-28 20:50:30 +08:00
|
|
|
calls[callId].muteVol = !calls[callId].muteVol;
|
|
|
|
}
|
|
|
|
|
2014-08-30 01:20:34 +08:00
|
|
|
void Core::onAvCancel(void* _toxav, int32_t callId, void* core)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
|
|
|
ToxAv* toxav = static_cast<ToxAv*>(_toxav);
|
|
|
|
|
2015-04-24 08:32:09 +08:00
|
|
|
int friendId = toxav_get_peer_id(toxav, callId, 0);
|
2014-08-28 20:30:38 +08:00
|
|
|
if (friendId < 0)
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "Received invalid AV cancel";
|
2014-08-28 20:30:38 +08:00
|
|
|
return;
|
|
|
|
}
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("AV cancel from %1").arg(friendId);
|
2014-08-28 20:30:38 +08:00
|
|
|
|
2014-08-30 01:20:34 +08:00
|
|
|
calls[callId].active = false;
|
|
|
|
|
2014-12-14 16:50:18 +08:00
|
|
|
#ifdef QTOX_FILTER_AUDIO
|
|
|
|
if (filterer[callId])
|
|
|
|
{
|
|
|
|
filterer[callId]->closeFilter();
|
|
|
|
delete filterer[callId];
|
|
|
|
filterer[callId] = nullptr;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2014-08-30 01:20:34 +08:00
|
|
|
emit static_cast<Core*>(core)->avCancel(friendId, callId);
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
2014-11-02 19:47:42 +08:00
|
|
|
void Core::onAvReject(void* _toxav, int32_t callId, void* core)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
2014-11-02 19:47:42 +08:00
|
|
|
ToxAv* toxav = static_cast<ToxAv*>(_toxav);
|
2015-04-24 08:32:09 +08:00
|
|
|
int friendId = toxav_get_peer_id(toxav, callId, 0);
|
2014-11-02 19:47:42 +08:00
|
|
|
if (friendId < 0)
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "Received invalid AV reject";
|
2014-11-02 19:47:42 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("AV reject from %1").arg(friendId);
|
2014-11-02 19:47:42 +08:00
|
|
|
|
|
|
|
emit static_cast<Core*>(core)->avRejected(friendId, callId);
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void Core::onAvEnd(void* _toxav, int32_t call_index, void* core)
|
|
|
|
{
|
|
|
|
ToxAv* toxav = static_cast<ToxAv*>(_toxav);
|
|
|
|
|
2015-04-24 08:32:09 +08:00
|
|
|
int friendId = toxav_get_peer_id(toxav, call_index, 0);
|
2014-08-28 20:30:38 +08:00
|
|
|
if (friendId < 0)
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "Received invalid AV end";
|
2014-08-28 20:30:38 +08:00
|
|
|
return;
|
|
|
|
}
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("AV end from %1").arg(friendId);
|
2014-08-28 20:30:38 +08:00
|
|
|
|
|
|
|
emit static_cast<Core*>(core)->avEnd(friendId, call_index);
|
2015-05-14 10:46:28 +08:00
|
|
|
|
|
|
|
cleanupCall(call_index);
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void Core::onAvRinging(void* _toxav, int32_t call_index, void* core)
|
|
|
|
{
|
|
|
|
ToxAv* toxav = static_cast<ToxAv*>(_toxav);
|
|
|
|
|
2015-04-24 08:32:09 +08:00
|
|
|
int friendId = toxav_get_peer_id(toxav, call_index, 0);
|
2014-08-28 20:30:38 +08:00
|
|
|
if (friendId < 0)
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "Received invalid AV ringing";
|
2014-08-28 20:30:38 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (calls[call_index].videoEnabled)
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("AV ringing with %1 with video").arg(friendId);
|
2014-08-28 20:30:38 +08:00
|
|
|
emit static_cast<Core*>(core)->avRinging(friendId, call_index, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("AV ringing with %1 without video").arg(friendId);
|
2014-08-28 20:30:38 +08:00
|
|
|
emit static_cast<Core*>(core)->avRinging(friendId, call_index, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::onAvRequestTimeout(void* _toxav, int32_t call_index, void* core)
|
|
|
|
{
|
|
|
|
ToxAv* toxav = static_cast<ToxAv*>(_toxav);
|
|
|
|
|
2015-04-24 08:32:09 +08:00
|
|
|
int friendId = toxav_get_peer_id(toxav, call_index, 0);
|
2014-08-28 20:30:38 +08:00
|
|
|
if (friendId < 0)
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "Received invalid AV request timeout";
|
2014-08-28 20:30:38 +08:00
|
|
|
return;
|
|
|
|
}
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("AV request timeout with %1").arg(friendId);
|
2014-08-28 20:30:38 +08:00
|
|
|
|
|
|
|
emit static_cast<Core*>(core)->avRequestTimeout(friendId, call_index);
|
2015-05-14 10:46:28 +08:00
|
|
|
|
|
|
|
cleanupCall(call_index);
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void Core::onAvPeerTimeout(void* _toxav, int32_t call_index, void* core)
|
|
|
|
{
|
|
|
|
ToxAv* toxav = static_cast<ToxAv*>(_toxav);
|
|
|
|
|
2015-04-24 08:32:09 +08:00
|
|
|
int friendId = toxav_get_peer_id(toxav, call_index, 0);
|
2014-08-28 20:30:38 +08:00
|
|
|
if (friendId < 0)
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "Received invalid AV peer timeout";
|
2014-08-28 20:30:38 +08:00
|
|
|
return;
|
|
|
|
}
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("AV peer timeout with %1").arg(friendId);
|
2014-08-28 20:30:38 +08:00
|
|
|
|
|
|
|
emit static_cast<Core*>(core)->avPeerTimeout(friendId, call_index);
|
2015-05-14 10:46:28 +08:00
|
|
|
|
|
|
|
cleanupCall(call_index);
|
2014-08-28 20:30:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Core::onAvInvite(void* _toxav, int32_t call_index, void* core)
|
|
|
|
{
|
|
|
|
ToxAv* toxav = static_cast<ToxAv*>(_toxav);
|
|
|
|
|
2015-04-24 08:32:09 +08:00
|
|
|
int friendId = toxav_get_peer_id(toxav, call_index, 0);
|
2014-08-28 20:30:38 +08:00
|
|
|
if (friendId < 0)
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "Received invalid AV invite";
|
2014-08-28 20:30:38 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ToxAvCSettings* transSettings = new ToxAvCSettings;
|
|
|
|
int err = toxav_get_peer_csettings(toxav, call_index, 0, transSettings);
|
2014-11-18 06:17:54 +08:00
|
|
|
if (err != av_ErrorNone)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "onAvInvite: error getting call type";
|
2014-08-28 20:30:38 +08:00
|
|
|
delete transSettings;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-11-18 06:17:54 +08:00
|
|
|
if (transSettings->call_type == av_TypeVideo)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("AV invite from %1 with video").arg(friendId);
|
2014-08-28 20:30:38 +08:00
|
|
|
emit static_cast<Core*>(core)->avInvite(friendId, call_index, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("AV invite from %1 without video").arg(friendId);
|
2014-08-28 20:30:38 +08:00
|
|
|
emit static_cast<Core*>(core)->avInvite(friendId, call_index, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
delete transSettings;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::onAvStart(void* _toxav, int32_t call_index, void* core)
|
|
|
|
{
|
|
|
|
ToxAv* toxav = static_cast<ToxAv*>(_toxav);
|
|
|
|
|
2015-04-24 08:32:09 +08:00
|
|
|
int friendId = toxav_get_peer_id(toxav, call_index, 0);
|
2014-08-28 20:30:38 +08:00
|
|
|
if (friendId < 0)
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "Received invalid AV start";
|
2014-08-28 20:30:38 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ToxAvCSettings* transSettings = new ToxAvCSettings;
|
|
|
|
int err = toxav_get_peer_csettings(toxav, call_index, 0, transSettings);
|
2014-11-18 06:17:54 +08:00
|
|
|
if (err != av_ErrorNone)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "onAvStart: error getting call type";
|
2014-08-28 20:30:38 +08:00
|
|
|
delete transSettings;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-11-18 06:17:54 +08:00
|
|
|
if (transSettings->call_type == av_TypeVideo)
|
2014-08-28 20:30:38 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("AV start from %1 with video").arg(friendId);
|
2014-08-28 20:30:38 +08:00
|
|
|
prepareCall(friendId, call_index, toxav, true);
|
|
|
|
emit static_cast<Core*>(core)->avStart(friendId, call_index, true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("AV start from %1 without video").arg(friendId);
|
2014-08-28 20:30:38 +08:00
|
|
|
prepareCall(friendId, call_index, toxav, false);
|
|
|
|
emit static_cast<Core*>(core)->avStart(friendId, call_index, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
delete transSettings;
|
|
|
|
}
|
2014-08-28 21:46:11 +08:00
|
|
|
|
2014-08-28 21:53:58 +08:00
|
|
|
// This function's logic was shamelessly stolen from uTox
|
2014-11-11 23:15:56 +08:00
|
|
|
void Core::playAudioBuffer(ALuint alSource, const int16_t *data, int samples, unsigned channels, int sampleRate)
|
2014-08-28 21:46:11 +08:00
|
|
|
{
|
2014-12-12 02:05:52 +08:00
|
|
|
if (!channels || channels > 2)
|
2014-08-29 05:06:53 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qWarning() << "playAudioBuffer: trying to play on "<<channels<<" channels! Giving up.";
|
2014-08-28 21:46:11 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ALuint bufid;
|
2014-11-14 03:18:02 +08:00
|
|
|
ALint processed = 0, queued = 16;
|
2014-11-11 23:15:56 +08:00
|
|
|
alGetSourcei(alSource, AL_BUFFERS_PROCESSED, &processed);
|
|
|
|
alGetSourcei(alSource, AL_BUFFERS_QUEUED, &queued);
|
|
|
|
alSourcei(alSource, AL_LOOPING, AL_FALSE);
|
2014-08-28 21:46:11 +08:00
|
|
|
|
2014-12-12 02:05:52 +08:00
|
|
|
if (processed)
|
2014-08-28 21:46:11 +08:00
|
|
|
{
|
|
|
|
ALuint bufids[processed];
|
2014-11-11 23:15:56 +08:00
|
|
|
alSourceUnqueueBuffers(alSource, processed, bufids);
|
2014-08-28 21:46:11 +08:00
|
|
|
alDeleteBuffers(processed - 1, bufids + 1);
|
|
|
|
bufid = bufids[0];
|
|
|
|
}
|
2014-12-12 02:05:52 +08:00
|
|
|
else if (queued < 32)
|
2014-08-28 21:46:11 +08:00
|
|
|
{
|
|
|
|
alGenBuffers(1, &bufid);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << "Dropped audio frame";
|
2014-08-28 21:46:11 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
alBufferData(bufid, (channels == 1) ? AL_FORMAT_MONO16 : AL_FORMAT_STEREO16, data,
|
2014-08-29 05:06:53 +08:00
|
|
|
samples * 2 * channels, sampleRate);
|
2014-11-11 23:15:56 +08:00
|
|
|
alSourceQueueBuffers(alSource, 1, &bufid);
|
2014-08-28 21:46:11 +08:00
|
|
|
|
|
|
|
ALint state;
|
2014-11-11 23:15:56 +08:00
|
|
|
alGetSourcei(alSource, AL_SOURCE_STATE, &state);
|
2015-05-12 07:27:32 +08:00
|
|
|
alSourcef(alSource, AL_GAIN, Audio::getOutputVolume());
|
2014-12-12 02:05:52 +08:00
|
|
|
if (state != AL_PLAYING)
|
2014-08-28 21:46:11 +08:00
|
|
|
{
|
2014-11-11 23:15:56 +08:00
|
|
|
alSourcePlay(alSource);
|
2015-05-11 20:54:03 +08:00
|
|
|
//qDebug() << "Starting audio source " << (int)alSource;
|
2014-08-28 21:46:11 +08:00
|
|
|
}
|
|
|
|
}
|
2014-10-15 20:46:01 +08:00
|
|
|
|
|
|
|
VideoSource *Core::getVideoSourceFromCall(int callNumber)
|
|
|
|
{
|
2015-05-14 10:46:28 +08:00
|
|
|
return calls[callNumber].videoSource;
|
2014-10-15 20:46:01 +08:00
|
|
|
}
|
|
|
|
|
2014-11-13 20:11:23 +08:00
|
|
|
void Core::joinGroupCall(int groupId)
|
2014-11-13 19:18:04 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("Joining group call %1").arg(groupId);
|
2014-11-13 19:18:04 +08:00
|
|
|
groupCalls[groupId].groupId = groupId;
|
|
|
|
groupCalls[groupId].muteMic = false;
|
|
|
|
groupCalls[groupId].muteVol = false;
|
|
|
|
// the following three lines are also now redundant from startCall, but are
|
|
|
|
// necessary there for outbound and here for inbound
|
|
|
|
groupCalls[groupId].codecSettings = av_DefaultSettings;
|
|
|
|
groupCalls[groupId].codecSettings.max_video_width = TOXAV_MAX_VIDEO_WIDTH;
|
|
|
|
groupCalls[groupId].codecSettings.max_video_height = TOXAV_MAX_VIDEO_HEIGHT;
|
|
|
|
|
|
|
|
// Audio
|
2014-11-17 02:04:45 +08:00
|
|
|
Audio::suscribeInput();
|
2014-11-13 19:18:04 +08:00
|
|
|
|
|
|
|
// Go
|
2014-11-15 03:55:32 +08:00
|
|
|
Core* core = Core::getInstance();
|
|
|
|
ToxAv* toxav = core->toxav;
|
|
|
|
|
2014-11-13 20:11:23 +08:00
|
|
|
groupCalls[groupId].sendAudioTimer = new QTimer();
|
2014-11-13 19:18:04 +08:00
|
|
|
groupCalls[groupId].active = true;
|
|
|
|
groupCalls[groupId].sendAudioTimer->setInterval(5);
|
|
|
|
groupCalls[groupId].sendAudioTimer->setSingleShot(true);
|
2014-11-15 04:16:28 +08:00
|
|
|
connect(groupCalls[groupId].sendAudioTimer, &QTimer::timeout, [=](){sendGroupCallAudio(groupId,toxav);});
|
2014-11-13 19:18:04 +08:00
|
|
|
groupCalls[groupId].sendAudioTimer->start();
|
|
|
|
}
|
|
|
|
|
2014-11-13 20:11:23 +08:00
|
|
|
void Core::leaveGroupCall(int groupId)
|
2014-11-13 19:18:04 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << QString("Leaving group call %1").arg(groupId);
|
2014-11-13 19:18:04 +08:00
|
|
|
groupCalls[groupId].active = false;
|
|
|
|
disconnect(groupCalls[groupId].sendAudioTimer,0,0,0);
|
|
|
|
groupCalls[groupId].sendAudioTimer->stop();
|
2015-05-26 00:38:52 +08:00
|
|
|
for (ALuint source : groupCalls[groupId].alSources)
|
|
|
|
alDeleteSources(1, &source);
|
2014-11-16 23:41:30 +08:00
|
|
|
groupCalls[groupId].alSources.clear();
|
2014-11-17 02:04:45 +08:00
|
|
|
Audio::unsuscribeInput();
|
2014-11-18 08:25:15 +08:00
|
|
|
delete groupCalls[groupId].sendAudioTimer;
|
2014-11-13 19:18:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void Core::sendGroupCallAudio(int groupId, ToxAv* toxav)
|
|
|
|
{
|
|
|
|
if (!groupCalls[groupId].active)
|
|
|
|
return;
|
|
|
|
|
2015-01-05 00:55:39 +08:00
|
|
|
if (groupCalls[groupId].muteMic || !Audio::isInputReady())
|
2014-11-13 19:18:04 +08:00
|
|
|
{
|
|
|
|
groupCalls[groupId].sendAudioTimer->start();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-11-16 00:04:09 +08:00
|
|
|
const int framesize = (groupCalls[groupId].codecSettings.audio_frame_duration * groupCalls[groupId].codecSettings.audio_sample_rate) / 1000 * av_DefaultSettings.audio_channels;
|
|
|
|
const int bufsize = framesize * 2 * av_DefaultSettings.audio_channels;
|
|
|
|
uint8_t buf[bufsize];
|
2014-11-13 19:18:04 +08:00
|
|
|
|
2015-01-05 00:55:39 +08:00
|
|
|
if (Audio::tryCaptureSamples(buf, framesize))
|
2014-11-13 19:18:04 +08:00
|
|
|
{
|
2015-01-30 04:23:33 +08:00
|
|
|
if (toxav_group_send_audio(toxav_get_tox(toxav), groupId, (int16_t*)buf,
|
|
|
|
framesize, av_DefaultSettings.audio_channels, av_DefaultSettings.audio_sample_rate) < 0)
|
2014-11-13 19:18:04 +08:00
|
|
|
{
|
2015-05-11 20:54:03 +08:00
|
|
|
qDebug() << "toxav_group_send_audio error";
|
2014-11-13 19:18:04 +08:00
|
|
|
groupCalls[groupId].sendAudioTimer->start();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
groupCalls[groupId].sendAudioTimer->start();
|
2014-11-11 23:05:01 +08:00
|
|
|
}
|
2014-11-13 20:11:23 +08:00
|
|
|
|
|
|
|
void Core::disableGroupCallMic(int groupId)
|
|
|
|
{
|
|
|
|
groupCalls[groupId].muteMic = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::disableGroupCallVol(int groupId)
|
|
|
|
{
|
|
|
|
groupCalls[groupId].muteVol = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::enableGroupCallMic(int groupId)
|
|
|
|
{
|
|
|
|
groupCalls[groupId].muteMic = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Core::enableGroupCallVol(int groupId)
|
|
|
|
{
|
|
|
|
groupCalls[groupId].muteVol = false;
|
|
|
|
}
|
2014-11-14 02:20:06 +08:00
|
|
|
|
|
|
|
bool Core::isGroupCallMicEnabled(int groupId)
|
|
|
|
{
|
|
|
|
return !groupCalls[groupId].muteMic;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Core::isGroupCallVolEnabled(int groupId)
|
|
|
|
{
|
|
|
|
return !groupCalls[groupId].muteVol;
|
|
|
|
}
|