summaryrefslogtreecommitdiff
path: root/toxav
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2015-03-25 23:31:04 +0100
committermannol <eniz_vukovic@hotmail.com>2015-03-25 23:31:04 +0100
commit9bd20e874141640ed592b2a1ac32e96f57c12510 (patch)
tree0931a392a3fc503f1bed50c8527b9e861e80d916 /toxav
parentc1aa5bac4f6c68eece7e78bc82241df5d30e05bc (diff)
parentcf704616f92cc79c6213da1ffab7577c40d02550 (diff)
Merge branch 'new_api' of github.com:mannol/toxcore into new_api
Diffstat (limited to 'toxav')
-rw-r--r--toxav/av_test.c6
-rw-r--r--toxav/toxav.c12
-rw-r--r--toxav/toxav.h30
3 files changed, 24 insertions, 24 deletions
diff --git a/toxav/av_test.c b/toxav/av_test.c
index 2323588a..249e0ab7 100644
--- a/toxav/av_test.c
+++ b/toxav/av_test.c
@@ -191,8 +191,8 @@ void iterate(Tox* Bsn, ToxAV* AliceAV, ToxAV* BobAV)
191 tox_do(toxav_get_tox(AliceAV)); 191 tox_do(toxav_get_tox(AliceAV));
192 tox_do(toxav_get_tox(BobAV)); 192 tox_do(toxav_get_tox(BobAV));
193 193
194 toxav_iteration(AliceAV); 194 toxav_iterate(AliceAV);
195 toxav_iteration(BobAV); 195 toxav_iterate(BobAV);
196 196
197 int mina = MIN(tox_do_interval(toxav_get_tox(AliceAV)), toxav_iteration_interval(AliceAV)); 197 int mina = MIN(tox_do_interval(toxav_get_tox(AliceAV)), toxav_iteration_interval(AliceAV));
198 int minb = MIN(tox_do_interval(toxav_get_tox(BobAV)), toxav_iteration_interval(BobAV)); 198 int minb = MIN(tox_do_interval(toxav_get_tox(BobAV)), toxav_iteration_interval(BobAV));
@@ -829,4 +829,4 @@ AGAIN:
829 alcCloseDevice(out_device); 829 alcCloseDevice(out_device);
830 alcCaptureCloseDevice(in_device); 830 alcCaptureCloseDevice(in_device);
831 return 0; 831 return 0;
832} \ No newline at end of file 832}
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
205void toxav_iteration(ToxAV* av) 205void 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
490void toxav_callback_request_video_frame(ToxAV* av, toxav_request_video_frame_cb* function, void* user_data) 490void 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
604void toxav_callback_request_audio_frame(ToxAV* av, toxav_request_audio_frame_cb* function, void* user_data) 604void 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 */
88uint32_t toxav_iteration_interval(ToxAV const *av); 88uint32_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 */
94void toxav_iteration(ToxAV *av); 94void 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 */
395typedef void toxav_request_video_frame_cb(ToxAV *av, uint32_t friend_number, void *user_data); 395typedef 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 */
399void toxav_callback_request_video_frame(ToxAV *av, toxav_request_video_frame_cb *function, void *user_data); 399void 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 */
427typedef void toxav_request_audio_frame_cb(ToxAV *av, uint32_t friend_number, void *user_data); 427typedef 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 */
431void toxav_callback_request_audio_frame(ToxAV *av, toxav_request_audio_frame_cb *function, void *user_data); 431void 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 */
511void toxav_callback_receive_audio_frame(ToxAV *av, toxav_receive_audio_frame_cb *function, void *user_data); 511void 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 */