summaryrefslogtreecommitdiff
path: root/toxav/toxav.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxav/toxav.h')
-rw-r--r--toxav/toxav.h42
1 files changed, 20 insertions, 22 deletions
diff --git a/toxav/toxav.h b/toxav/toxav.h
index 947d3c2c..58619c6c 100644
--- a/toxav/toxav.h
+++ b/toxav/toxav.h
@@ -212,12 +212,12 @@ ToxAV *toxav_new(Tox *tox, TOXAV_ERR_NEW *error);
212 * notifying peers. After calling this function, no other functions may be 212 * notifying peers. After calling this function, no other functions may be
213 * called and the av pointer becomes invalid. 213 * called and the av pointer becomes invalid.
214 */ 214 */
215void toxav_kill(ToxAV *toxAV); 215void toxav_kill(ToxAV *av);
216 216
217/** 217/**
218 * Returns the Tox instance the A/V object was created for. 218 * Returns the Tox instance the A/V object was created for.
219 */ 219 */
220Tox *toxav_get_tox(const ToxAV *toxAV); 220Tox *toxav_get_tox(const ToxAV *av);
221 221
222 222
223/******************************************************************************* 223/*******************************************************************************
@@ -232,14 +232,14 @@ Tox *toxav_get_tox(const ToxAV *toxAV);
232 * Returns the interval in milliseconds when the next toxav_iterate call should 232 * Returns the interval in milliseconds when the next toxav_iterate call should
233 * be. If no call is active at the moment, this function returns 200. 233 * be. If no call is active at the moment, this function returns 200.
234 */ 234 */
235uint32_t toxav_iteration_interval(const ToxAV *toxAV); 235uint32_t toxav_iteration_interval(const ToxAV *av);
236 236
237/** 237/**
238 * Main loop for the session. This function needs to be called in intervals of 238 * Main loop for the session. This function needs to be called in intervals of
239 * toxav_iteration_interval() milliseconds. It is best called in the separate 239 * toxav_iteration_interval() milliseconds. It is best called in the separate
240 * thread from tox_iterate. 240 * thread from tox_iterate.
241 */ 241 */
242void toxav_iterate(ToxAV *toxAV); 242void toxav_iterate(ToxAV *av);
243 243
244 244
245/******************************************************************************* 245/*******************************************************************************
@@ -306,7 +306,7 @@ typedef enum TOXAV_ERR_CALL {
306 * @param video_bit_rate Video bit rate in Kb/sec. Set this to 0 to disable 306 * @param video_bit_rate Video bit rate in Kb/sec. Set this to 0 to disable
307 * video sending. 307 * video sending.
308 */ 308 */
309bool toxav_call(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate, 309bool toxav_call(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate,
310 TOXAV_ERR_CALL *error); 310 TOXAV_ERR_CALL *error);
311 311
312/** 312/**
@@ -316,15 +316,14 @@ bool toxav_call(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate, u
316 * @param audio_enabled True if friend is sending audio. 316 * @param audio_enabled True if friend is sending audio.
317 * @param video_enabled True if friend is sending video. 317 * @param video_enabled True if friend is sending video.
318 */ 318 */
319typedef void toxav_call_cb(ToxAV *toxAV, uint32_t friend_number, bool audio_enabled, bool video_enabled, 319typedef void toxav_call_cb(ToxAV *av, uint32_t friend_number, bool audio_enabled, bool video_enabled, void *user_data);
320 void *user_data);
321 320
322 321
323/** 322/**
324 * Set the callback for the `call` event. Pass NULL to unset. 323 * Set the callback for the `call` event. Pass NULL to unset.
325 * 324 *
326 */ 325 */
327void toxav_callback_call(ToxAV *toxAV, toxav_call_cb *callback, void *user_data); 326void toxav_callback_call(ToxAV *av, toxav_call_cb *callback, void *user_data);
328 327
329typedef enum TOXAV_ERR_ANSWER { 328typedef enum TOXAV_ERR_ANSWER {
330 329
@@ -377,7 +376,7 @@ typedef enum TOXAV_ERR_ANSWER {
377 * @param video_bit_rate Video bit rate in Kb/sec. Set this to 0 to disable 376 * @param video_bit_rate Video bit rate in Kb/sec. Set this to 0 to disable
378 * video sending. 377 * video sending.
379 */ 378 */
380bool toxav_answer(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate, 379bool toxav_answer(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate,
381 TOXAV_ERR_ANSWER *error); 380 TOXAV_ERR_ANSWER *error);
382 381
383 382
@@ -438,14 +437,14 @@ enum TOXAV_FRIEND_CALL_STATE {
438 * paused. The bitmask represents all the activities currently performed by the 437 * paused. The bitmask represents all the activities currently performed by the
439 * friend. 438 * friend.
440 */ 439 */
441typedef void toxav_call_state_cb(ToxAV *toxAV, uint32_t friend_number, uint32_t state, void *user_data); 440typedef void toxav_call_state_cb(ToxAV *av, uint32_t friend_number, uint32_t state, void *user_data);
442 441
443 442
444/** 443/**
445 * Set the callback for the `call_state` event. Pass NULL to unset. 444 * Set the callback for the `call_state` event. Pass NULL to unset.
446 * 445 *
447 */ 446 */
448void toxav_callback_call_state(ToxAV *toxAV, toxav_call_state_cb *callback, void *user_data); 447void toxav_callback_call_state(ToxAV *av, toxav_call_state_cb *callback, void *user_data);
449 448
450 449
451/******************************************************************************* 450/*******************************************************************************
@@ -543,8 +542,7 @@ typedef enum TOXAV_ERR_CALL_CONTROL {
543 * 542 *
544 * @return true on success. 543 * @return true on success.
545 */ 544 */
546bool toxav_call_control(ToxAV *toxAV, uint32_t friend_number, TOXAV_CALL_CONTROL control, 545bool toxav_call_control(ToxAV *av, uint32_t friend_number, TOXAV_CALL_CONTROL control, TOXAV_ERR_CALL_CONTROL *error);
547 TOXAV_ERR_CALL_CONTROL *error);
548 546
549 547
550/******************************************************************************* 548/*******************************************************************************
@@ -601,7 +599,7 @@ typedef enum TOXAV_ERR_BIT_RATE_SET {
601 * video sending. Set to -1 to leave unchanged. 599 * video sending. Set to -1 to leave unchanged.
602 * 600 *
603 */ 601 */
604bool toxav_bit_rate_set(ToxAV *toxAV, uint32_t friend_number, int32_t audio_bit_rate, int32_t video_bit_rate, 602bool toxav_bit_rate_set(ToxAV *av, uint32_t friend_number, int32_t audio_bit_rate, int32_t video_bit_rate,
605 TOXAV_ERR_BIT_RATE_SET *error); 603 TOXAV_ERR_BIT_RATE_SET *error);
606 604
607/** 605/**
@@ -614,7 +612,7 @@ bool toxav_bit_rate_set(ToxAV *toxAV, uint32_t friend_number, int32_t audio_bit_
614 * @param audio_bit_rate Suggested maximum audio bit rate in Kb/sec. 612 * @param audio_bit_rate Suggested maximum audio bit rate in Kb/sec.
615 * @param video_bit_rate Suggested maximum video bit rate in Kb/sec. 613 * @param video_bit_rate Suggested maximum video bit rate in Kb/sec.
616 */ 614 */
617typedef void toxav_bit_rate_status_cb(ToxAV *toxAV, uint32_t friend_number, uint32_t audio_bit_rate, 615typedef void toxav_bit_rate_status_cb(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate,
618 uint32_t video_bit_rate, void *user_data); 616 uint32_t video_bit_rate, void *user_data);
619 617
620 618
@@ -622,7 +620,7 @@ typedef void toxav_bit_rate_status_cb(ToxAV *toxAV, uint32_t friend_number, uint
622 * Set the callback for the `bit_rate_status` event. Pass NULL to unset. 620 * Set the callback for the `bit_rate_status` event. Pass NULL to unset.
623 * 621 *
624 */ 622 */
625void toxav_callback_bit_rate_status(ToxAV *toxAV, toxav_bit_rate_status_cb *callback, void *user_data); 623void toxav_callback_bit_rate_status(ToxAV *av, toxav_bit_rate_status_cb *callback, void *user_data);
626 624
627 625
628/******************************************************************************* 626/*******************************************************************************
@@ -701,7 +699,7 @@ typedef enum TOXAV_ERR_SEND_FRAME {
701 * @param sampling_rate Audio sampling rate used in this frame. Valid sampling 699 * @param sampling_rate Audio sampling rate used in this frame. Valid sampling
702 * rates are 8000, 12000, 16000, 24000, or 48000. 700 * rates are 8000, 12000, 16000, 24000, or 48000.
703 */ 701 */
704bool toxav_audio_send_frame(ToxAV *toxAV, uint32_t friend_number, const int16_t *pcm, size_t sample_count, 702bool toxav_audio_send_frame(ToxAV *av, uint32_t friend_number, const int16_t *pcm, size_t sample_count,
705 uint8_t channels, uint32_t sampling_rate, TOXAV_ERR_SEND_FRAME *error); 703 uint8_t channels, uint32_t sampling_rate, TOXAV_ERR_SEND_FRAME *error);
706 704
707/** 705/**
@@ -719,7 +717,7 @@ bool toxav_audio_send_frame(ToxAV *toxAV, uint32_t friend_number, const int16_t
719 * @param u U (Chroma) plane data. 717 * @param u U (Chroma) plane data.
720 * @param v V (Chroma) plane data. 718 * @param v V (Chroma) plane data.
721 */ 719 */
722bool toxav_video_send_frame(ToxAV *toxAV, uint32_t friend_number, uint16_t width, uint16_t height, const uint8_t *y, 720bool toxav_video_send_frame(ToxAV *av, uint32_t friend_number, uint16_t width, uint16_t height, const uint8_t *y,
723 const uint8_t *u, const uint8_t *v, TOXAV_ERR_SEND_FRAME *error); 721 const uint8_t *u, const uint8_t *v, TOXAV_ERR_SEND_FRAME *error);
724 722
725 723
@@ -743,7 +741,7 @@ bool toxav_video_send_frame(ToxAV *toxAV, uint32_t friend_number, uint16_t width
743 * @param sampling_rate Sampling rate used in this frame. 741 * @param sampling_rate Sampling rate used in this frame.
744 * 742 *
745 */ 743 */
746typedef void toxav_audio_receive_frame_cb(ToxAV *toxAV, uint32_t friend_number, const int16_t *pcm, size_t sample_count, 744typedef void toxav_audio_receive_frame_cb(ToxAV *av, uint32_t friend_number, const int16_t *pcm, size_t sample_count,
747 uint8_t channels, uint32_t sampling_rate, void *user_data); 745 uint8_t channels, uint32_t sampling_rate, void *user_data);
748 746
749 747
@@ -751,7 +749,7 @@ typedef void toxav_audio_receive_frame_cb(ToxAV *toxAV, uint32_t friend_number,
751 * Set the callback for the `audio_receive_frame` event. Pass NULL to unset. 749 * Set the callback for the `audio_receive_frame` event. Pass NULL to unset.
752 * 750 *
753 */ 751 */
754void toxav_callback_audio_receive_frame(ToxAV *toxAV, toxav_audio_receive_frame_cb *callback, void *user_data); 752void toxav_callback_audio_receive_frame(ToxAV *av, toxav_audio_receive_frame_cb *callback, void *user_data);
755 753
756/** 754/**
757 * The function type for the video_receive_frame callback. 755 * The function type for the video_receive_frame callback.
@@ -774,7 +772,7 @@ void toxav_callback_audio_receive_frame(ToxAV *toxAV, toxav_audio_receive_frame_
774 * image is bottom-up hence why you MUST abs() it when 772 * image is bottom-up hence why you MUST abs() it when
775 * calculating plane buffer size. 773 * calculating plane buffer size.
776 */ 774 */
777typedef void toxav_video_receive_frame_cb(ToxAV *toxAV, uint32_t friend_number, uint16_t width, uint16_t height, 775typedef void toxav_video_receive_frame_cb(ToxAV *av, uint32_t friend_number, uint16_t width, uint16_t height,
778 const uint8_t *y, const uint8_t *u, const uint8_t *v, int32_t ystride, int32_t ustride, int32_t vstride, 776 const uint8_t *y, const uint8_t *u, const uint8_t *v, int32_t ystride, int32_t ustride, int32_t vstride,
779 void *user_data); 777 void *user_data);
780 778
@@ -783,7 +781,7 @@ typedef void toxav_video_receive_frame_cb(ToxAV *toxAV, uint32_t friend_number,
783 * Set the callback for the `video_receive_frame` event. Pass NULL to unset. 781 * Set the callback for the `video_receive_frame` event. Pass NULL to unset.
784 * 782 *
785 */ 783 */
786void toxav_callback_video_receive_frame(ToxAV *toxAV, toxav_video_receive_frame_cb *callback, void *user_data); 784void toxav_callback_video_receive_frame(ToxAV *av, toxav_video_receive_frame_cb *callback, void *user_data);
787 785
788/** 786/**
789 * NOTE Compatibility with old toxav group calls TODO remove 787 * NOTE Compatibility with old toxav group calls TODO remove