diff options
author | mannol <eniz_vukovic@hotmail.com> | 2015-04-26 00:31:03 +0200 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2015-04-26 00:31:03 +0200 |
commit | 144fc94d6987c8c6f74d8024af5a5c1738fe4678 (patch) | |
tree | bc5ad70ea24dafb8e358911ba118fc599f3f9999 /toxav/toxav.h | |
parent | 1bfd93e64a2a6d3bf9c90a9aa89abd29f3d826a7 (diff) |
Almost done
Diffstat (limited to 'toxav/toxav.h')
-rw-r--r-- | toxav/toxav.h | 78 |
1 files changed, 38 insertions, 40 deletions
diff --git a/toxav/toxav.h b/toxav/toxav.h index bf8756eb..f2c3b2b3 100644 --- a/toxav/toxav.h +++ b/toxav/toxav.h | |||
@@ -217,22 +217,6 @@ typedef enum TOXAV_CALL_STATE { | |||
217 | */ | 217 | */ |
218 | TOXAV_CALL_STATE_END = 16, | 218 | TOXAV_CALL_STATE_END = 16, |
219 | /** | 219 | /** |
220 | * AV core suggests you to lower bitrate for audio. | ||
221 | */ | ||
222 | TOXAV_CALL_STATE_DECREASE_AUDIO_BITRATE = 32, | ||
223 | /** | ||
224 | * AV core suggests you to lower bitrate for video. | ||
225 | */ | ||
226 | TOXAV_CALL_STATE_DECREASE_VIDEO_BITRATE = 64, | ||
227 | /** | ||
228 | * AV core suggests you to increase bitrate for audio. | ||
229 | */ | ||
230 | TOXAV_CALL_STATE_INCREASE_AUDIO_BITRATE = 128, | ||
231 | /** | ||
232 | * AV core suggests you to increase bitrate for video. | ||
233 | */ | ||
234 | TOXAV_CALL_STATE_INCREASE_VIDEO_BITRATE = 256, | ||
235 | /** | ||
236 | * Set by the AV core if an error occurred on the remote end. | 220 | * Set by the AV core if an error occurred on the remote end. |
237 | */ | 221 | */ |
238 | TOXAV_CALL_STATE_ERROR = 32768 | 222 | TOXAV_CALL_STATE_ERROR = 32768 |
@@ -349,6 +333,24 @@ typedef enum TOXAV_ERR_BIT_RATE { | |||
349 | TOXAV_ERR_BIT_RATE_FRIEND_NOT_IN_CALL | 333 | TOXAV_ERR_BIT_RATE_FRIEND_NOT_IN_CALL |
350 | } TOXAV_ERR_BIT_RATE; | 334 | } TOXAV_ERR_BIT_RATE; |
351 | /** | 335 | /** |
336 | * The function type for the `audio_bitrate_control` callback. | ||
337 | * | ||
338 | * @param friend_number The friend number of the friend for which to set the | ||
339 | * audio bit rate. | ||
340 | * @param good Is the stream good enough to keep the said bitrate. Upon failed | ||
341 | * non forceful bit rate setup this will be set to false and 'bit_rate' | ||
342 | * will be set to the bit rate that failed, otherwise 'good' will be set to | ||
343 | * true with 'bit_rate' set to new bit rate. If the stream becomes bad, | ||
344 | * the 'good' wil be set to false with 'bit_rate' set to the current bit rate. | ||
345 | * This callback will never be called when the stream is good. | ||
346 | * @param bit_rate The bit rate in Kb/sec. | ||
347 | */ | ||
348 | typedef void toxav_audio_bitrate_control_cb(ToxAV *av, uint32_t friend_number, bool good, uint32_t bit_rate, void *user_data); | ||
349 | /** | ||
350 | * Set the callback for the `audio_bitrate_control` event. Pass NULL to unset. | ||
351 | */ | ||
352 | void toxav_callback_audio_bitrate_control(ToxAV *av, toxav_audio_bitrate_control_cb *function, void *user_data); | ||
353 | /** | ||
352 | * Set the audio bit rate to be used in subsequent audio frames. | 354 | * Set the audio bit rate to be used in subsequent audio frames. |
353 | * | 355 | * |
354 | * @param friend_number The friend number of the friend for which to set the | 356 | * @param friend_number The friend number of the friend for which to set the |
@@ -358,7 +360,25 @@ typedef enum TOXAV_ERR_BIT_RATE { | |||
358 | * | 360 | * |
359 | * @see toxav_call for the valid bit rates. | 361 | * @see toxav_call for the valid bit rates. |
360 | */ | 362 | */ |
361 | bool toxav_set_audio_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, TOXAV_ERR_BIT_RATE *error); | 363 | bool toxav_set_audio_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t audio_bit_rate, bool force, TOXAV_ERR_BIT_RATE *error); |
364 | /** | ||
365 | * The function type for the `video_bitrate_control` callback. | ||
366 | * | ||
367 | * @param friend_number The friend number of the friend for which to set the | ||
368 | * video bit rate. | ||
369 | * @param good Is the stream good enough to keep the said bitrate. Upon failed | ||
370 | * non forceful bit rate setup this will be set to false and 'bit_rate' | ||
371 | * will be set to the bit rate that failed, otherwise 'good' will be set to | ||
372 | * true with 'bit_rate' set to new bit rate. If the stream becomes bad, | ||
373 | * the 'good' wil be set to false with 'bit_rate' set to the current bit rate. | ||
374 | * This callback will never be called when the stream is good. | ||
375 | * @param bit_rate The bit rate in Kb/sec. | ||
376 | */ | ||
377 | typedef void toxav_video_bitrate_control_cb(ToxAV *av, uint32_t friend_number, bool good, uint32_t bit_rate, void *user_data); | ||
378 | /** | ||
379 | * Set the callback for the `video_bitrate_control` event. Pass NULL to unset. | ||
380 | */ | ||
381 | void toxav_callback_video_bitrate_control(ToxAV *av, toxav_video_bitrate_control_cb *function, void *user_data); | ||
362 | /** | 382 | /** |
363 | * Set the video bit rate to be used in subsequent video frames. | 383 | * Set the video bit rate to be used in subsequent video frames. |
364 | * | 384 | * |
@@ -369,7 +389,7 @@ bool toxav_set_audio_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t audio_ | |||
369 | * | 389 | * |
370 | * @see toxav_call for the valid bit rates. | 390 | * @see toxav_call for the valid bit rates. |
371 | */ | 391 | */ |
372 | bool toxav_set_video_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t video_bit_rate, TOXAV_ERR_BIT_RATE *error); | 392 | bool toxav_set_video_bit_rate(ToxAV *av, uint32_t friend_number, uint32_t video_bit_rate, bool force, TOXAV_ERR_BIT_RATE *error); |
373 | /******************************************************************************* | 393 | /******************************************************************************* |
374 | * | 394 | * |
375 | * :: A/V sending | 395 | * :: A/V sending |
@@ -409,17 +429,6 @@ typedef enum TOXAV_ERR_SEND_FRAME { | |||
409 | TOXAV_ERR_SEND_FRAME_RTP_FAILED | 429 | TOXAV_ERR_SEND_FRAME_RTP_FAILED |
410 | } TOXAV_ERR_SEND_FRAME; | 430 | } TOXAV_ERR_SEND_FRAME; |
411 | /** | 431 | /** |
412 | * The function type for the `video_frame_request` callback. | ||
413 | * | ||
414 | * @param friend_number The friend number of the friend for which the next video | ||
415 | * frame should be sent. | ||
416 | */ | ||
417 | typedef void toxav_video_frame_request_cb(ToxAV *av, uint32_t friend_number, void *user_data); | ||
418 | /** | ||
419 | * Set the callback for the `video_frame_request` event. Pass NULL to unset. | ||
420 | */ | ||
421 | void toxav_callback_video_frame_request(ToxAV *av, toxav_video_frame_request_cb *function, void *user_data); | ||
422 | /** | ||
423 | * Send a video frame to a friend. | 432 | * Send a video frame to a friend. |
424 | * | 433 | * |
425 | * This is called in response to receiving the `video_frame_request` event. | 434 | * This is called in response to receiving the `video_frame_request` event. |
@@ -441,17 +450,6 @@ bool toxav_send_video_frame(ToxAV *av, uint32_t friend_number, | |||
441 | uint8_t const *y, uint8_t const *u, uint8_t const *v, | 450 | uint8_t const *y, uint8_t const *u, uint8_t const *v, |
442 | TOXAV_ERR_SEND_FRAME *error); | 451 | TOXAV_ERR_SEND_FRAME *error); |
443 | /** | 452 | /** |
444 | * The function type for the `audio_frame_request` callback. | ||
445 | * | ||
446 | * @param friend_number The friend number of the friend for which the next audio | ||
447 | * frame should be sent. | ||
448 | */ | ||
449 | typedef void toxav_audio_frame_request_cb(ToxAV *av, uint32_t friend_number, void *user_data); | ||
450 | /** | ||
451 | * Set the callback for the `audio_frame_request` event. Pass NULL to unset. | ||
452 | */ | ||
453 | void toxav_callback_audio_frame_request(ToxAV *av, toxav_audio_frame_request_cb *function, void *user_data); | ||
454 | /** | ||
455 | * Send an audio frame to a friend. | 453 | * Send an audio frame to a friend. |
456 | * | 454 | * |
457 | * This is called in response to receiving the `audio_frame_request` event. | 455 | * This is called in response to receiving the `audio_frame_request` event. |