mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
feat(core): Add error parsing for Toxav_Err_Bit_Rate_Set
This commit is contained in:
parent
47a05c7592
commit
a5660fb6e3
|
@ -407,7 +407,11 @@ void CoreAV::sendCallVideo(uint32_t callId, std::shared_ptr<VideoFrame> vframe)
|
|||
if (call.getNullVideoBitrate()) {
|
||||
qDebug() << "Restarting video stream to friend" << callId;
|
||||
QMutexLocker coreLocker{&coreLock};
|
||||
toxav_video_set_bit_rate(toxav.get(), callId, VIDEO_DEFAULT_BITRATE, nullptr);
|
||||
Toxav_Err_Bit_Rate_Set err;
|
||||
toxav_video_set_bit_rate(toxav.get(), callId, VIDEO_DEFAULT_BITRATE, &err);
|
||||
if (!PARSE_ERR(err)) {
|
||||
return;
|
||||
}
|
||||
call.setNullVideoBitrate(false);
|
||||
}
|
||||
|
||||
|
@ -724,7 +728,11 @@ void CoreAV::sendNoVideo()
|
|||
qDebug() << "CoreAV: Signaling end of video sending";
|
||||
for (auto& kv : calls) {
|
||||
ToxFriendCall& call = *kv.second;
|
||||
toxav_video_set_bit_rate(toxav.get(), kv.first, 0, nullptr);
|
||||
Toxav_Err_Bit_Rate_Set err;
|
||||
toxav_video_set_bit_rate(toxav.get(), kv.first, 0, &err);
|
||||
if (!PARSE_ERR(err)) {
|
||||
continue;
|
||||
}
|
||||
call.setNullVideoBitrate(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ namespace ToxcoreErrorParser {
|
|||
bool parseErr(Tox_Err_File_Get error, int line);
|
||||
bool parseErr(Tox_Err_File_Send error, int line);
|
||||
bool parseErr(Tox_Err_File_Send_Chunk error, int line);
|
||||
bool parseErr(Toxav_Err_Bit_Rate_Set error, int line);
|
||||
bool parseErr(Toxav_Err_Call_Control error, int line);
|
||||
bool parseErr(Toxav_Err_Call error, int line);
|
||||
} // namespace ToxcoreErrorParser
|
||||
|
|
|
@ -544,6 +544,32 @@ bool ToxcoreErrorParser::parseErr(Tox_Err_File_Send_Chunk error, int line)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ToxcoreErrorParser::parseErr(Toxav_Err_Bit_Rate_Set error, int line)
|
||||
{
|
||||
switch (error) {
|
||||
case TOXAV_ERR_BIT_RATE_SET_OK:
|
||||
return true;
|
||||
|
||||
case TOXAV_ERR_BIT_RATE_SET_SYNC:
|
||||
qCritical() << line << ": Synchronization error occurred.";
|
||||
return false;
|
||||
|
||||
case TOXAV_ERR_BIT_RATE_SET_INVALID_BIT_RATE:
|
||||
qCritical() << line << ": The bit rate passed was not one of the supported values.";
|
||||
return false;
|
||||
|
||||
case TOXAV_ERR_BIT_RATE_SET_FRIEND_NOT_FOUND:
|
||||
qCritical() << line << ": The friend_number passed did not designate a valid friend.";
|
||||
return false;
|
||||
|
||||
case TOXAV_ERR_BIT_RATE_SET_FRIEND_NOT_IN_CALL:
|
||||
qCritical() << line << ": This client is currently not in a call with the friend.";
|
||||
return false;
|
||||
}
|
||||
qCritical() << line << "Unknown Toxav_Err_Bit_Rate_Set error code:" << error;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ToxcoreErrorParser::parseErr(Toxav_Err_Call_Control error, int line)
|
||||
{
|
||||
switch (error) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user