diff options
-rw-r--r-- | toxav/av_test.c | 6 | ||||
-rw-r--r-- | toxav/toxav.c | 12 | ||||
-rw-r--r-- | toxav/toxav.h | 30 |
3 files changed, 24 insertions, 24 deletions
diff --git a/toxav/av_test.c b/toxav/av_test.c index 7948445d..42b2fcc4 100644 --- a/toxav/av_test.c +++ b/toxav/av_test.c | |||
@@ -155,8 +155,8 @@ void iterate(Tox* Bsn, ToxAV* AliceAV, ToxAV* BobAV) | |||
155 | tox_do(toxav_get_tox(AliceAV)); | 155 | tox_do(toxav_get_tox(AliceAV)); |
156 | tox_do(toxav_get_tox(BobAV)); | 156 | tox_do(toxav_get_tox(BobAV)); |
157 | 157 | ||
158 | toxav_iteration(AliceAV); | 158 | toxav_iterate(AliceAV); |
159 | toxav_iteration(BobAV); | 159 | toxav_iterate(BobAV); |
160 | 160 | ||
161 | int mina = MIN(tox_do_interval(toxav_get_tox(AliceAV)), toxav_iteration_interval(AliceAV)); | 161 | int mina = MIN(tox_do_interval(toxav_get_tox(AliceAV)), toxav_iteration_interval(AliceAV)); |
162 | int minb = MIN(tox_do_interval(toxav_get_tox(BobAV)), toxav_iteration_interval(BobAV)); | 162 | int minb = MIN(tox_do_interval(toxav_get_tox(BobAV)), toxav_iteration_interval(BobAV)); |
@@ -686,4 +686,4 @@ int main (int argc, char** argv) | |||
686 | alcCloseDevice(out_device); | 686 | alcCloseDevice(out_device); |
687 | alcCaptureCloseDevice(in_device); | 687 | alcCaptureCloseDevice(in_device); |
688 | return 0; | 688 | return 0; |
689 | } \ No newline at end of file | 689 | } |
diff --git a/toxav/toxav.c b/toxav/toxav.c index df6fa833..fcc6e86a 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -78,8 +78,8 @@ struct toxAV { | |||
78 | PAIR(toxav_call_state_cb *, void *) scb; /* Call state callback */ | 78 | PAIR(toxav_call_state_cb *, void *) scb; /* Call state callback */ |
79 | PAIR(toxav_receive_audio_frame_cb *, void *) acb; /* Audio frame receive callback */ | 79 | PAIR(toxav_receive_audio_frame_cb *, void *) acb; /* Audio frame receive callback */ |
80 | PAIR(toxav_receive_video_frame_cb *, void *) vcb; /* Video frame receive callback */ | 80 | PAIR(toxav_receive_video_frame_cb *, void *) vcb; /* Video frame receive callback */ |
81 | PAIR(toxav_request_video_frame_cb *, void *) rvcb; /* Request video callback */ | 81 | PAIR(toxav_video_frame_request_cb *, void *) rvcb; /* Video request callback */ |
82 | PAIR(toxav_request_audio_frame_cb *, void *) racb; /* Request video callback */ | 82 | PAIR(toxav_audio_frame_request_cb *, void *) racb; /* Audio request callback */ |
83 | 83 | ||
84 | /** Decode time measures */ | 84 | /** Decode time measures */ |
85 | int32_t dmssc; /** Measure count */ | 85 | int32_t dmssc; /** Measure count */ |
@@ -202,7 +202,7 @@ uint32_t toxav_iteration_interval(const ToxAV* av) | |||
202 | return av->calls ? av->interval : 200; | 202 | return av->calls ? av->interval : 200; |
203 | } | 203 | } |
204 | 204 | ||
205 | void toxav_iteration(ToxAV* av) | 205 | void toxav_iterate(ToxAV* av) |
206 | { | 206 | { |
207 | if (av->calls == NULL) | 207 | if (av->calls == NULL) |
208 | return; | 208 | return; |
@@ -487,7 +487,7 @@ bool toxav_set_video_bit_rate(ToxAV* av, uint32_t friend_number, uint32_t video_ | |||
487 | /* TODO */ | 487 | /* TODO */ |
488 | } | 488 | } |
489 | 489 | ||
490 | void toxav_callback_request_video_frame(ToxAV* av, toxav_request_video_frame_cb* function, void* user_data) | 490 | void toxav_callback_video_frame_request(ToxAV* av, toxav_video_frame_request_cb* function, void* user_data) |
491 | { | 491 | { |
492 | pthread_mutex_lock(av->mutex); | 492 | pthread_mutex_lock(av->mutex); |
493 | av->rvcb.first = function; | 493 | av->rvcb.first = function; |
@@ -601,7 +601,7 @@ END: | |||
601 | return rc == TOXAV_ERR_SEND_FRAME_OK; | 601 | return rc == TOXAV_ERR_SEND_FRAME_OK; |
602 | } | 602 | } |
603 | 603 | ||
604 | void toxav_callback_request_audio_frame(ToxAV* av, toxav_request_audio_frame_cb* function, void* user_data) | 604 | void toxav_callback_audio_frame_request(ToxAV* av, toxav_audio_frame_request_cb* function, void* user_data) |
605 | { | 605 | { |
606 | pthread_mutex_lock(av->mutex); | 606 | pthread_mutex_lock(av->mutex); |
607 | av->racb.first = function; | 607 | av->racb.first = function; |
@@ -1078,4 +1078,4 @@ CLEAR: | |||
1078 | av->calls_head = av->calls_tail = 0; | 1078 | av->calls_head = av->calls_tail = 0; |
1079 | free(av->calls); | 1079 | free(av->calls); |
1080 | av->calls = NULL; | 1080 | av->calls = NULL; |
1081 | } \ No newline at end of file | 1081 | } |
diff --git a/toxav/toxav.h b/toxav/toxav.h index 571282ed..48bb6b8c 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h | |||
@@ -82,8 +82,8 @@ Tox *toxav_get_tox(ToxAV *av); | |||
82 | * | 82 | * |
83 | ******************************************************************************/ | 83 | ******************************************************************************/ |
84 | /** | 84 | /** |
85 | * Returns the interval in milliseconds when the next toxav_iteration should be | 85 | * Returns the interval in milliseconds when the next toxav_iterate call should |
86 | * called. If no call is active at the moment, this function returns 200. | 86 | * be. If no call is active at the moment, this function returns 200. |
87 | */ | 87 | */ |
88 | uint32_t toxav_iteration_interval(ToxAV const *av); | 88 | uint32_t toxav_iteration_interval(ToxAV const *av); |
89 | /** | 89 | /** |
@@ -91,7 +91,7 @@ uint32_t toxav_iteration_interval(ToxAV const *av); | |||
91 | * toxav_iteration_interval() milliseconds. It is best called in the same loop | 91 | * toxav_iteration_interval() milliseconds. It is best called in the same loop |
92 | * as tox_iteration. | 92 | * as tox_iteration. |
93 | */ | 93 | */ |
94 | void toxav_iteration(ToxAV *av); | 94 | void toxav_iterate(ToxAV *av); |
95 | /******************************************************************************* | 95 | /******************************************************************************* |
96 | * | 96 | * |
97 | * :: Call setup | 97 | * :: Call setup |
@@ -372,7 +372,7 @@ typedef enum TOXAV_ERR_SEND_FRAME { | |||
372 | */ | 372 | */ |
373 | TOXAV_ERR_SEND_FRAME_FRIEND_NOT_IN_CALL, | 373 | TOXAV_ERR_SEND_FRAME_FRIEND_NOT_IN_CALL, |
374 | /** | 374 | /** |
375 | * No video frame had been requested through the `request_video_frame` event, | 375 | * No video frame had been requested through the `video_frame_request` event, |
376 | * but the client tried to send one, anyway. | 376 | * but the client tried to send one, anyway. |
377 | */ | 377 | */ |
378 | TOXAV_ERR_SEND_FRAME_NOT_REQUESTED, | 378 | TOXAV_ERR_SEND_FRAME_NOT_REQUESTED, |
@@ -387,20 +387,20 @@ typedef enum TOXAV_ERR_SEND_FRAME { | |||
387 | TOXAV_ERR_SEND_FRAME_RTP_FAILED | 387 | TOXAV_ERR_SEND_FRAME_RTP_FAILED |
388 | } TOXAV_ERR_SEND_FRAME; | 388 | } TOXAV_ERR_SEND_FRAME; |
389 | /** | 389 | /** |
390 | * The function type for the `request_video_frame` callback. | 390 | * The function type for the `video_frame_request` callback. |
391 | * | 391 | * |
392 | * @param friend_number The friend number of the friend for which the next video | 392 | * @param friend_number The friend number of the friend for which the next video |
393 | * frame should be sent. | 393 | * frame should be sent. |
394 | */ | 394 | */ |
395 | typedef void toxav_request_video_frame_cb(ToxAV *av, uint32_t friend_number, void *user_data); | 395 | typedef void toxav_video_frame_request_cb(ToxAV *av, uint32_t friend_number, void *user_data); |
396 | /** | 396 | /** |
397 | * Set the callback for the `request_video_frame` event. Pass NULL to unset. | 397 | * Set the callback for the `video_frame_request` event. Pass NULL to unset. |
398 | */ | 398 | */ |
399 | void toxav_callback_request_video_frame(ToxAV *av, toxav_request_video_frame_cb *function, void *user_data); | 399 | void toxav_callback_video_frame_request(ToxAV *av, toxav_video_frame_request_cb *function, void *user_data); |
400 | /** | 400 | /** |
401 | * Send a video frame to a friend. | 401 | * Send a video frame to a friend. |
402 | * | 402 | * |
403 | * This is called in response to receiving the `request_video_frame` event. | 403 | * This is called in response to receiving the `video_frame_request` event. |
404 | * | 404 | * |
405 | * Y - plane should be of size: height * width | 405 | * Y - plane should be of size: height * width |
406 | * U - plane should be of size: (height/2) * (width/2) | 406 | * U - plane should be of size: (height/2) * (width/2) |
@@ -419,20 +419,20 @@ bool toxav_send_video_frame(ToxAV *av, uint32_t friend_number, | |||
419 | uint8_t const *y, uint8_t const *u, uint8_t const *v, | 419 | uint8_t const *y, uint8_t const *u, uint8_t const *v, |
420 | TOXAV_ERR_SEND_FRAME *error); | 420 | TOXAV_ERR_SEND_FRAME *error); |
421 | /** | 421 | /** |
422 | * The function type for the `request_audio_frame` callback. | 422 | * The function type for the `audio_frame_request` callback. |
423 | * | 423 | * |
424 | * @param friend_number The friend number of the friend for which the next audio | 424 | * @param friend_number The friend number of the friend for which the next audio |
425 | * frame should be sent. | 425 | * frame should be sent. |
426 | */ | 426 | */ |
427 | typedef void toxav_request_audio_frame_cb(ToxAV *av, uint32_t friend_number, void *user_data); | 427 | typedef void toxav_audio_frame_request_cb(ToxAV *av, uint32_t friend_number, void *user_data); |
428 | /** | 428 | /** |
429 | * Set the callback for the `request_audio_frame` event. Pass NULL to unset. | 429 | * Set the callback for the `audio_frame_request` event. Pass NULL to unset. |
430 | */ | 430 | */ |
431 | void toxav_callback_request_audio_frame(ToxAV *av, toxav_request_audio_frame_cb *function, void *user_data); | 431 | void toxav_callback_audio_frame_request(ToxAV *av, toxav_audio_frame_request_cb *function, void *user_data); |
432 | /** | 432 | /** |
433 | * Send an audio frame to a friend. | 433 | * Send an audio frame to a friend. |
434 | * | 434 | * |
435 | * This is called in response to receiving the `request_audio_frame` event. | 435 | * This is called in response to receiving the `audio_frame_request` event. |
436 | * | 436 | * |
437 | * The expected format of the PCM data is: [s1c1][s1c2][...][s2c1][s2c2][...]... | 437 | * The expected format of the PCM data is: [s1c1][s1c2][...][s2c1][s2c2][...]... |
438 | * Meaning: sample 1 for channel 1, sample 1 for channel 2, ... | 438 | * Meaning: sample 1 for channel 1, sample 1 for channel 2, ... |
@@ -510,4 +510,4 @@ typedef void toxav_receive_audio_frame_cb(ToxAV *av, uint32_t friend_number, | |||
510 | */ | 510 | */ |
511 | void toxav_callback_receive_audio_frame(ToxAV *av, toxav_receive_audio_frame_cb *function, void *user_data); | 511 | void toxav_callback_receive_audio_frame(ToxAV *av, toxav_receive_audio_frame_cb *function, void *user_data); |
512 | 512 | ||
513 | #endif /* TOXAV_H */ \ No newline at end of file | 513 | #endif /* TOXAV_H */ |