mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Renamed TOXAV_CALL_STATE to TOXAV_FRIEND_CALL_STATE
This commit is contained in:
parent
1ba55d0ca7
commit
2ecb71bb1e
|
@ -215,7 +215,7 @@ START_TEST(test_AV_flows)
|
|||
long long unsigned int start_time = time(NULL); \
|
||||
\
|
||||
\
|
||||
while (BobCC.state != TOXAV_CALL_STATE_FINISHED) { \
|
||||
while (BobCC.state != TOXAV_FRIEND_CALL_STATE_FINISHED) { \
|
||||
\
|
||||
if (BobCC.incoming) { \
|
||||
TOXAV_ERR_ANSWER rc; \
|
||||
|
@ -293,7 +293,7 @@ START_TEST(test_AV_flows)
|
|||
}
|
||||
}
|
||||
|
||||
while (AliceCC.state != TOXAV_CALL_STATE_FINISHED)
|
||||
while (AliceCC.state != TOXAV_FRIEND_CALL_STATE_FINISHED)
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
|
||||
printf("Success!\n");
|
||||
|
@ -330,7 +330,7 @@ START_TEST(test_AV_flows)
|
|||
}
|
||||
|
||||
/* Alice will not receive end state */
|
||||
while (BobCC.state != TOXAV_CALL_STATE_FINISHED)
|
||||
while (BobCC.state != TOXAV_FRIEND_CALL_STATE_FINISHED)
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
|
||||
printf("Success!\n");
|
||||
|
@ -383,31 +383,31 @@ START_TEST(test_AV_flows)
|
|||
ck_assert(BobCC.state == 0);
|
||||
ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_RESUME, NULL));
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
ck_assert(BobCC.state & (TOXAV_CALL_STATE_SENDING_A | TOXAV_CALL_STATE_SENDING_V));
|
||||
ck_assert(BobCC.state & (TOXAV_FRIEND_CALL_STATE_SENDING_A | TOXAV_FRIEND_CALL_STATE_SENDING_V));
|
||||
|
||||
/* Mute/Unmute single */
|
||||
printf("Mute/Unmute single\n");
|
||||
ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_MUTE_AUDIO, NULL));
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
ck_assert(BobCC.state ^ TOXAV_CALL_STATE_RECEIVING_A);
|
||||
ck_assert(BobCC.state ^ TOXAV_FRIEND_CALL_STATE_RECEIVING_A);
|
||||
ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_UNMUTE_AUDIO, NULL));
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
ck_assert(BobCC.state & TOXAV_CALL_STATE_RECEIVING_A);
|
||||
ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_RECEIVING_A);
|
||||
|
||||
/* Mute/Unmute both */
|
||||
printf("Mute/Unmute both\n");
|
||||
ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_MUTE_AUDIO, NULL));
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
ck_assert(BobCC.state ^ TOXAV_CALL_STATE_RECEIVING_A);
|
||||
ck_assert(BobCC.state ^ TOXAV_FRIEND_CALL_STATE_RECEIVING_A);
|
||||
ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_HIDE_VIDEO, NULL));
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
ck_assert(BobCC.state ^ TOXAV_CALL_STATE_RECEIVING_V);
|
||||
ck_assert(BobCC.state ^ TOXAV_FRIEND_CALL_STATE_RECEIVING_V);
|
||||
ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_UNMUTE_AUDIO, NULL));
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
ck_assert(BobCC.state & TOXAV_CALL_STATE_RECEIVING_A);
|
||||
ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_RECEIVING_A);
|
||||
ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_SHOW_VIDEO, NULL));
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
ck_assert(BobCC.state & TOXAV_CALL_STATE_RECEIVING_V);
|
||||
ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_RECEIVING_V);
|
||||
|
||||
{
|
||||
TOXAV_ERR_CALL_CONTROL rc;
|
||||
|
@ -420,7 +420,7 @@ START_TEST(test_AV_flows)
|
|||
}
|
||||
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
ck_assert(BobCC.state == TOXAV_CALL_STATE_FINISHED);
|
||||
ck_assert(BobCC.state == TOXAV_FRIEND_CALL_STATE_FINISHED);
|
||||
|
||||
printf("Success!\n");
|
||||
}
|
||||
|
@ -462,19 +462,19 @@ START_TEST(test_AV_flows)
|
|||
ck_assert(toxav_video_bit_rate_set(AliceAV, 0, 1000, false, NULL));
|
||||
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
ck_assert(BobCC.state & TOXAV_CALL_STATE_SENDING_V);
|
||||
ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_V);
|
||||
|
||||
printf("Turning off video for Alice...\n");
|
||||
ck_assert(toxav_video_bit_rate_set(AliceAV, 0, 0, false, NULL));
|
||||
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
ck_assert(!(BobCC.state & TOXAV_CALL_STATE_SENDING_V));
|
||||
ck_assert(!(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_V));
|
||||
|
||||
printf("Turning off audio for Alice...\n");
|
||||
ck_assert(toxav_audio_bit_rate_set(AliceAV, 0, 0, false, NULL));
|
||||
|
||||
iterate_tox(bootstrap, Alice, Bob);
|
||||
ck_assert(!(BobCC.state & TOXAV_CALL_STATE_SENDING_A));
|
||||
ck_assert(!(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_A));
|
||||
}
|
||||
|
||||
toxav_kill(BobAV);
|
||||
|
|
|
@ -296,7 +296,7 @@ bool answer(uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_
|
|||
* :: Call state graph
|
||||
*
|
||||
******************************************************************************/
|
||||
bitmask CALL_STATE {
|
||||
bitmask FRIEND_CALL_STATE {
|
||||
/**
|
||||
* Set by the AV core if an error occurred on the remote end or if friend
|
||||
* timed out. This is the final state after which no more state
|
||||
|
|
|
@ -627,7 +627,7 @@ int main (int argc, char** argv)
|
|||
}
|
||||
|
||||
iterate_tox(bootstrap, AliceAV, BobAV);
|
||||
assert(BobCC.state == TOXAV_CALL_STATE_FINISHED);
|
||||
assert(BobCC.state == TOXAV_FRIEND_CALL_STATE_FINISHED);
|
||||
|
||||
/* Stop decode thread */
|
||||
data.sig = -1;
|
||||
|
@ -721,7 +721,7 @@ int main (int argc, char** argv)
|
|||
}
|
||||
|
||||
iterate_tox(bootstrap, AliceAV, BobAV);
|
||||
assert(BobCC.state == TOXAV_CALL_STATE_FINISHED);
|
||||
assert(BobCC.state == TOXAV_FRIEND_CALL_STATE_FINISHED);
|
||||
|
||||
/* Stop decode thread */
|
||||
printf("Stopping decode thread\n");
|
||||
|
|
|
@ -1115,7 +1115,7 @@ int callback_end(void* toxav_inst, MSICall* call)
|
|||
ToxAV* toxav = toxav_inst;
|
||||
pthread_mutex_lock(toxav->mutex);
|
||||
|
||||
invoke_call_state(toxav, call->friend_number, TOXAV_CALL_STATE_FINISHED);
|
||||
invoke_call_state(toxav, call->friend_number, TOXAV_FRIEND_CALL_STATE_FINISHED);
|
||||
|
||||
call_kill_transmission(call->av_call);
|
||||
call_remove(call->av_call);
|
||||
|
@ -1129,7 +1129,7 @@ int callback_error(void* toxav_inst, MSICall* call)
|
|||
ToxAV* toxav = toxav_inst;
|
||||
pthread_mutex_lock(toxav->mutex);
|
||||
|
||||
invoke_call_state(toxav, call->friend_number, TOXAV_CALL_STATE_ERROR);
|
||||
invoke_call_state(toxav, call->friend_number, TOXAV_FRIEND_CALL_STATE_ERROR);
|
||||
|
||||
call_kill_transmission(call->av_call);
|
||||
call_remove(call->av_call);
|
||||
|
|
|
@ -302,36 +302,36 @@ bool toxav_answer(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate,
|
|||
* :: Call state graph
|
||||
*
|
||||
******************************************************************************/
|
||||
enum TOXAV_CALL_STATE {
|
||||
enum TOXAV_FRIEND_CALL_STATE {
|
||||
/**
|
||||
* Set by the AV core if an error occurred on the remote end or if friend
|
||||
* timed out. This is the final state after which no more state
|
||||
* transitions can occur for the call. This call state will never be triggered
|
||||
* in combination with other call states.
|
||||
*/
|
||||
TOXAV_CALL_STATE_ERROR = 1,
|
||||
TOXAV_FRIEND_CALL_STATE_ERROR = 1,
|
||||
/**
|
||||
* The call has finished. This is the final state after which no more state
|
||||
* transitions can occur for the call. This call state will never be
|
||||
* triggered in combination with other call states.
|
||||
*/
|
||||
TOXAV_CALL_STATE_FINISHED = 2,
|
||||
TOXAV_FRIEND_CALL_STATE_FINISHED = 2,
|
||||
/**
|
||||
* The flag that marks that friend is sending audio.
|
||||
*/
|
||||
TOXAV_CALL_STATE_SENDING_A = 4,
|
||||
TOXAV_FRIEND_CALL_STATE_SENDING_A = 4,
|
||||
/**
|
||||
* The flag that marks that friend is sending video.
|
||||
*/
|
||||
TOXAV_CALL_STATE_SENDING_V = 8,
|
||||
TOXAV_FRIEND_CALL_STATE_SENDING_V = 8,
|
||||
/**
|
||||
* The flag that marks that friend is receiving audio.
|
||||
*/
|
||||
TOXAV_CALL_STATE_RECEIVING_A = 16,
|
||||
TOXAV_FRIEND_CALL_STATE_RECEIVING_A = 16,
|
||||
/**
|
||||
* The flag that marks that friend is receiving video.
|
||||
*/
|
||||
TOXAV_CALL_STATE_RECEIVING_V = 32,
|
||||
TOXAV_FRIEND_CALL_STATE_RECEIVING_V = 32,
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user