summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2015-06-27 17:28:07 +0200
committermannol <eniz_vukovic@hotmail.com>2015-06-27 17:28:07 +0200
commit2ecb71bb1e02a3542700ba9e8bcc372e203b8437 (patch)
treecd0d6b6690da75191c8c14c0756e90f743785c3a
parent1ba55d0ca737c21b78471180e90e6e81780aa52c (diff)
Renamed TOXAV_CALL_STATE to TOXAV_FRIEND_CALL_STATE
-rw-r--r--auto_tests/toxav_basic_test.c28
-rw-r--r--other/apidsl/toxav.in.h2
-rw-r--r--testing/av_test.c4
-rw-r--r--toxav/toxav.c4
-rw-r--r--toxav/toxav.h14
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)
215 long long unsigned int start_time = time(NULL); \ 215 long long unsigned int start_time = time(NULL); \
216 \ 216 \
217 \ 217 \
218 while (BobCC.state != TOXAV_CALL_STATE_FINISHED) { \ 218 while (BobCC.state != TOXAV_FRIEND_CALL_STATE_FINISHED) { \
219 \ 219 \
220 if (BobCC.incoming) { \ 220 if (BobCC.incoming) { \
221 TOXAV_ERR_ANSWER rc; \ 221 TOXAV_ERR_ANSWER rc; \
@@ -293,7 +293,7 @@ START_TEST(test_AV_flows)
293 } 293 }
294 } 294 }
295 295
296 while (AliceCC.state != TOXAV_CALL_STATE_FINISHED) 296 while (AliceCC.state != TOXAV_FRIEND_CALL_STATE_FINISHED)
297 iterate_tox(bootstrap, Alice, Bob); 297 iterate_tox(bootstrap, Alice, Bob);
298 298
299 printf("Success!\n"); 299 printf("Success!\n");
@@ -330,7 +330,7 @@ START_TEST(test_AV_flows)
330 } 330 }
331 331
332 /* Alice will not receive end state */ 332 /* Alice will not receive end state */
333 while (BobCC.state != TOXAV_CALL_STATE_FINISHED) 333 while (BobCC.state != TOXAV_FRIEND_CALL_STATE_FINISHED)
334 iterate_tox(bootstrap, Alice, Bob); 334 iterate_tox(bootstrap, Alice, Bob);
335 335
336 printf("Success!\n"); 336 printf("Success!\n");
@@ -383,31 +383,31 @@ START_TEST(test_AV_flows)
383 ck_assert(BobCC.state == 0); 383 ck_assert(BobCC.state == 0);
384 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_RESUME, NULL)); 384 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_RESUME, NULL));
385 iterate_tox(bootstrap, Alice, Bob); 385 iterate_tox(bootstrap, Alice, Bob);
386 ck_assert(BobCC.state & (TOXAV_CALL_STATE_SENDING_A | TOXAV_CALL_STATE_SENDING_V)); 386 ck_assert(BobCC.state & (TOXAV_FRIEND_CALL_STATE_SENDING_A | TOXAV_FRIEND_CALL_STATE_SENDING_V));
387 387
388 /* Mute/Unmute single */ 388 /* Mute/Unmute single */
389 printf("Mute/Unmute single\n"); 389 printf("Mute/Unmute single\n");
390 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_MUTE_AUDIO, NULL)); 390 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_MUTE_AUDIO, NULL));
391 iterate_tox(bootstrap, Alice, Bob); 391 iterate_tox(bootstrap, Alice, Bob);
392 ck_assert(BobCC.state ^ TOXAV_CALL_STATE_RECEIVING_A); 392 ck_assert(BobCC.state ^ TOXAV_FRIEND_CALL_STATE_RECEIVING_A);
393 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_UNMUTE_AUDIO, NULL)); 393 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_UNMUTE_AUDIO, NULL));
394 iterate_tox(bootstrap, Alice, Bob); 394 iterate_tox(bootstrap, Alice, Bob);
395 ck_assert(BobCC.state & TOXAV_CALL_STATE_RECEIVING_A); 395 ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_RECEIVING_A);
396 396
397 /* Mute/Unmute both */ 397 /* Mute/Unmute both */
398 printf("Mute/Unmute both\n"); 398 printf("Mute/Unmute both\n");
399 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_MUTE_AUDIO, NULL)); 399 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_MUTE_AUDIO, NULL));
400 iterate_tox(bootstrap, Alice, Bob); 400 iterate_tox(bootstrap, Alice, Bob);
401 ck_assert(BobCC.state ^ TOXAV_CALL_STATE_RECEIVING_A); 401 ck_assert(BobCC.state ^ TOXAV_FRIEND_CALL_STATE_RECEIVING_A);
402 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_HIDE_VIDEO, NULL)); 402 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_HIDE_VIDEO, NULL));
403 iterate_tox(bootstrap, Alice, Bob); 403 iterate_tox(bootstrap, Alice, Bob);
404 ck_assert(BobCC.state ^ TOXAV_CALL_STATE_RECEIVING_V); 404 ck_assert(BobCC.state ^ TOXAV_FRIEND_CALL_STATE_RECEIVING_V);
405 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_UNMUTE_AUDIO, NULL)); 405 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_UNMUTE_AUDIO, NULL));
406 iterate_tox(bootstrap, Alice, Bob); 406 iterate_tox(bootstrap, Alice, Bob);
407 ck_assert(BobCC.state & TOXAV_CALL_STATE_RECEIVING_A); 407 ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_RECEIVING_A);
408 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_SHOW_VIDEO, NULL)); 408 ck_assert(toxav_call_control(AliceAV, 0, TOXAV_CALL_CONTROL_SHOW_VIDEO, NULL));
409 iterate_tox(bootstrap, Alice, Bob); 409 iterate_tox(bootstrap, Alice, Bob);
410 ck_assert(BobCC.state & TOXAV_CALL_STATE_RECEIVING_V); 410 ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_RECEIVING_V);
411 411
412 { 412 {
413 TOXAV_ERR_CALL_CONTROL rc; 413 TOXAV_ERR_CALL_CONTROL rc;
@@ -420,7 +420,7 @@ START_TEST(test_AV_flows)
420 } 420 }
421 421
422 iterate_tox(bootstrap, Alice, Bob); 422 iterate_tox(bootstrap, Alice, Bob);
423 ck_assert(BobCC.state == TOXAV_CALL_STATE_FINISHED); 423 ck_assert(BobCC.state == TOXAV_FRIEND_CALL_STATE_FINISHED);
424 424
425 printf("Success!\n"); 425 printf("Success!\n");
426 } 426 }
@@ -462,19 +462,19 @@ START_TEST(test_AV_flows)
462 ck_assert(toxav_video_bit_rate_set(AliceAV, 0, 1000, false, NULL)); 462 ck_assert(toxav_video_bit_rate_set(AliceAV, 0, 1000, false, NULL));
463 463
464 iterate_tox(bootstrap, Alice, Bob); 464 iterate_tox(bootstrap, Alice, Bob);
465 ck_assert(BobCC.state & TOXAV_CALL_STATE_SENDING_V); 465 ck_assert(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_V);
466 466
467 printf("Turning off video for Alice...\n"); 467 printf("Turning off video for Alice...\n");
468 ck_assert(toxav_video_bit_rate_set(AliceAV, 0, 0, false, NULL)); 468 ck_assert(toxav_video_bit_rate_set(AliceAV, 0, 0, false, NULL));
469 469
470 iterate_tox(bootstrap, Alice, Bob); 470 iterate_tox(bootstrap, Alice, Bob);
471 ck_assert(!(BobCC.state & TOXAV_CALL_STATE_SENDING_V)); 471 ck_assert(!(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_V));
472 472
473 printf("Turning off audio for Alice...\n"); 473 printf("Turning off audio for Alice...\n");
474 ck_assert(toxav_audio_bit_rate_set(AliceAV, 0, 0, false, NULL)); 474 ck_assert(toxav_audio_bit_rate_set(AliceAV, 0, 0, false, NULL));
475 475
476 iterate_tox(bootstrap, Alice, Bob); 476 iterate_tox(bootstrap, Alice, Bob);
477 ck_assert(!(BobCC.state & TOXAV_CALL_STATE_SENDING_A)); 477 ck_assert(!(BobCC.state & TOXAV_FRIEND_CALL_STATE_SENDING_A));
478 } 478 }
479 479
480 toxav_kill(BobAV); 480 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_
296 * :: Call state graph 296 * :: Call state graph
297 * 297 *
298 ******************************************************************************/ 298 ******************************************************************************/
299bitmask CALL_STATE { 299bitmask FRIEND_CALL_STATE {
300 /** 300 /**
301 * Set by the AV core if an error occurred on the remote end or if friend 301 * Set by the AV core if an error occurred on the remote end or if friend
302 * timed out. This is the final state after which no more state 302 * 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)
627 } 627 }
628 628
629 iterate_tox(bootstrap, AliceAV, BobAV); 629 iterate_tox(bootstrap, AliceAV, BobAV);
630 assert(BobCC.state == TOXAV_CALL_STATE_FINISHED); 630 assert(BobCC.state == TOXAV_FRIEND_CALL_STATE_FINISHED);
631 631
632 /* Stop decode thread */ 632 /* Stop decode thread */
633 data.sig = -1; 633 data.sig = -1;
@@ -721,7 +721,7 @@ int main (int argc, char** argv)
721 } 721 }
722 722
723 iterate_tox(bootstrap, AliceAV, BobAV); 723 iterate_tox(bootstrap, AliceAV, BobAV);
724 assert(BobCC.state == TOXAV_CALL_STATE_FINISHED); 724 assert(BobCC.state == TOXAV_FRIEND_CALL_STATE_FINISHED);
725 725
726 /* Stop decode thread */ 726 /* Stop decode thread */
727 printf("Stopping decode thread\n"); 727 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)
1115 ToxAV* toxav = toxav_inst; 1115 ToxAV* toxav = toxav_inst;
1116 pthread_mutex_lock(toxav->mutex); 1116 pthread_mutex_lock(toxav->mutex);
1117 1117
1118 invoke_call_state(toxav, call->friend_number, TOXAV_CALL_STATE_FINISHED); 1118 invoke_call_state(toxav, call->friend_number, TOXAV_FRIEND_CALL_STATE_FINISHED);
1119 1119
1120 call_kill_transmission(call->av_call); 1120 call_kill_transmission(call->av_call);
1121 call_remove(call->av_call); 1121 call_remove(call->av_call);
@@ -1129,7 +1129,7 @@ int callback_error(void* toxav_inst, MSICall* call)
1129 ToxAV* toxav = toxav_inst; 1129 ToxAV* toxav = toxav_inst;
1130 pthread_mutex_lock(toxav->mutex); 1130 pthread_mutex_lock(toxav->mutex);
1131 1131
1132 invoke_call_state(toxav, call->friend_number, TOXAV_CALL_STATE_ERROR); 1132 invoke_call_state(toxav, call->friend_number, TOXAV_FRIEND_CALL_STATE_ERROR);
1133 1133
1134 call_kill_transmission(call->av_call); 1134 call_kill_transmission(call->av_call);
1135 call_remove(call->av_call); 1135 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,
302 * :: Call state graph 302 * :: Call state graph
303 * 303 *
304 ******************************************************************************/ 304 ******************************************************************************/
305enum TOXAV_CALL_STATE { 305enum TOXAV_FRIEND_CALL_STATE {
306 /** 306 /**
307 * Set by the AV core if an error occurred on the remote end or if friend 307 * Set by the AV core if an error occurred on the remote end or if friend
308 * timed out. This is the final state after which no more state 308 * timed out. This is the final state after which no more state
309 * transitions can occur for the call. This call state will never be triggered 309 * transitions can occur for the call. This call state will never be triggered
310 * in combination with other call states. 310 * in combination with other call states.
311 */ 311 */
312 TOXAV_CALL_STATE_ERROR = 1, 312 TOXAV_FRIEND_CALL_STATE_ERROR = 1,
313 /** 313 /**
314 * The call has finished. This is the final state after which no more state 314 * The call has finished. This is the final state after which no more state
315 * transitions can occur for the call. This call state will never be 315 * transitions can occur for the call. This call state will never be
316 * triggered in combination with other call states. 316 * triggered in combination with other call states.
317 */ 317 */
318 TOXAV_CALL_STATE_FINISHED = 2, 318 TOXAV_FRIEND_CALL_STATE_FINISHED = 2,
319 /** 319 /**
320 * The flag that marks that friend is sending audio. 320 * The flag that marks that friend is sending audio.
321 */ 321 */
322 TOXAV_CALL_STATE_SENDING_A = 4, 322 TOXAV_FRIEND_CALL_STATE_SENDING_A = 4,
323 /** 323 /**
324 * The flag that marks that friend is sending video. 324 * The flag that marks that friend is sending video.
325 */ 325 */
326 TOXAV_CALL_STATE_SENDING_V = 8, 326 TOXAV_FRIEND_CALL_STATE_SENDING_V = 8,
327 /** 327 /**
328 * The flag that marks that friend is receiving audio. 328 * The flag that marks that friend is receiving audio.
329 */ 329 */
330 TOXAV_CALL_STATE_RECEIVING_A = 16, 330 TOXAV_FRIEND_CALL_STATE_RECEIVING_A = 16,
331 /** 331 /**
332 * The flag that marks that friend is receiving video. 332 * The flag that marks that friend is receiving video.
333 */ 333 */
334 TOXAV_CALL_STATE_RECEIVING_V = 32, 334 TOXAV_FRIEND_CALL_STATE_RECEIVING_V = 32,
335}; 335};
336 336
337 337