From 2ecb71bb1e02a3542700ba9e8bcc372e203b8437 Mon Sep 17 00:00:00 2001 From: mannol Date: Sat, 27 Jun 2015 17:28:07 +0200 Subject: Renamed TOXAV_CALL_STATE to TOXAV_FRIEND_CALL_STATE --- auto_tests/toxav_basic_test.c | 28 ++++++++++++++-------------- other/apidsl/toxav.in.h | 2 +- testing/av_test.c | 4 ++-- toxav/toxav.c | 4 ++-- toxav/toxav.h | 14 +++++++------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/auto_tests/toxav_basic_test.c b/auto_tests/toxav_basic_test.c index 2735635f..305257fb 100644 --- a/auto_tests/toxav_basic_test.c +++ b/auto_tests/toxav_basic_test.c @@ -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); diff --git a/other/apidsl/toxav.in.h b/other/apidsl/toxav.in.h index 6e50d0d5..4a96defc 100644 --- a/other/apidsl/toxav.in.h +++ b/other/apidsl/toxav.in.h @@ -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 diff --git a/testing/av_test.c b/testing/av_test.c index cd9608b6..20e00c12 100644 --- a/testing/av_test.c +++ b/testing/av_test.c @@ -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"); diff --git a/toxav/toxav.c b/toxav/toxav.c index 59afe654..8a39259a 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c @@ -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); diff --git a/toxav/toxav.h b/toxav/toxav.h index 917a6bf5..8362edb3 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h @@ -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, }; -- cgit v1.2.3