diff options
author | xhe <xw897002528@gmail.com> | 2018-01-28 19:14:04 +0800 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-01-28 13:21:57 +0000 |
commit | 651ef3adb6299e66745cc1d1b57feb29fd17090a (patch) | |
tree | c211507a788558db661859a0cc9fdbc81c4c656a /toxav/toxav.api.h | |
parent | b9350bc459fee755c2e3bd566173860115bef640 (diff) |
Make audio/video bit rates "properties"
follow TokTok#731. This commit
completely removed all things in namespace bit_rate, and deprecated
functions are to be added back in another commit. set_xxx() is treadted
as a property of namespace audio&video, same as bit_rate change event.
toxav_basic_test is fixed, either.
Diffstat (limited to 'toxav/toxav.api.h')
-rw-r--r-- | toxav/toxav.api.h | 89 |
1 files changed, 52 insertions, 37 deletions
diff --git a/toxav/toxav.api.h b/toxav/toxav.api.h index 511b9e2d..71cd5aec 100644 --- a/toxav/toxav.api.h +++ b/toxav/toxav.api.h | |||
@@ -405,43 +405,6 @@ error for bit_rate_set { | |||
405 | FRIEND_NOT_IN_CALL, | 405 | FRIEND_NOT_IN_CALL, |
406 | } | 406 | } |
407 | 407 | ||
408 | namespace bit_rate { | ||
409 | /** | ||
410 | * Set the bit rate to be used in subsequent audio frames. | ||
411 | * | ||
412 | * @param friend_number The friend number of the friend for which to set the | ||
413 | * bit rate. | ||
414 | * @param audio_bit_rate The new audio bit rate in Kb/sec. Set to 0 to disable. | ||
415 | * | ||
416 | */ | ||
417 | |||
418 | bool set_audio(uint32_t friend_number, uint32_t audio_bit_rate) with error for bit_rate_set; | ||
419 | /** | ||
420 | * Set the bit rate to be used in subsequent video frames. | ||
421 | * | ||
422 | * @param friend_number The friend number of the friend for which to set the | ||
423 | * bit rate. | ||
424 | * @param video_bit_rate The new video bit rate in Kb/sec. Set to 0 to disable. | ||
425 | * | ||
426 | */ | ||
427 | bool set_video(uint32_t friend_number, uint32_t video_bit_rate) with error for bit_rate_set; | ||
428 | |||
429 | event status { | ||
430 | /** | ||
431 | * The function type for the ${event status} callback. The event is triggered | ||
432 | * when the network becomes too saturated for current bit rates at which | ||
433 | * point core suggests new bit rates. | ||
434 | * | ||
435 | * @param friend_number The friend number of the friend for which to set the | ||
436 | * bit rate. | ||
437 | * @param audio_bit_rate Suggested maximum audio bit rate in Kb/sec. | ||
438 | * @param video_bit_rate Suggested maximum video bit rate in Kb/sec. | ||
439 | */ | ||
440 | typedef void(uint32_t friend_number, uint32_t audio_bit_rate, uint32_t video_bit_rate); | ||
441 | } | ||
442 | } | ||
443 | |||
444 | |||
445 | /******************************************************************************* | 408 | /******************************************************************************* |
446 | * | 409 | * |
447 | * :: A/V sending | 410 | * :: A/V sending |
@@ -506,6 +469,32 @@ namespace audio { | |||
506 | */ | 469 | */ |
507 | bool send_frame(uint32_t friend_number, const int16_t *pcm, size_t sample_count, | 470 | bool send_frame(uint32_t friend_number, const int16_t *pcm, size_t sample_count, |
508 | uint8_t channels, uint32_t sampling_rate) with error for send_frame; | 471 | uint8_t channels, uint32_t sampling_rate) with error for send_frame; |
472 | |||
473 | uint32_t bit_rate { | ||
474 | /** | ||
475 | * Set the bit rate to be used in subsequent video frames. | ||
476 | * | ||
477 | * @param friend_number The friend number of the friend for which to set the | ||
478 | * bit rate. | ||
479 | * @param bit_rate The new audio bit rate in Kb/sec. Set to 0 to disable. | ||
480 | * | ||
481 | * @return true on success. | ||
482 | */ | ||
483 | set(uint32_t friend_number) with error for bit_rate_set; | ||
484 | } | ||
485 | |||
486 | event bit_rate { | ||
487 | /** | ||
488 | * The function type for the ${event bit_rate} callback. The event is triggered | ||
489 | * when the network becomes too saturated for current bit rates at which | ||
490 | * point core suggests new bit rates. | ||
491 | * | ||
492 | * @param friend_number The friend number of the friend for which to set the | ||
493 | * bit rate. | ||
494 | * @param audio_bit_rate Suggested maximum audio bit rate in Kb/sec. | ||
495 | */ | ||
496 | typedef void(uint32_t friend_number, uint32_t audio_bit_rate); | ||
497 | } | ||
509 | } | 498 | } |
510 | 499 | ||
511 | namespace video { | 500 | namespace video { |
@@ -526,6 +515,32 @@ namespace video { | |||
526 | */ | 515 | */ |
527 | bool send_frame(uint32_t friend_number, uint16_t width, uint16_t height, | 516 | bool send_frame(uint32_t friend_number, uint16_t width, uint16_t height, |
528 | const uint8_t *y, const uint8_t *u, const uint8_t *v) with error for send_frame; | 517 | const uint8_t *y, const uint8_t *u, const uint8_t *v) with error for send_frame; |
518 | |||
519 | uint32_t bit_rate { | ||
520 | /** | ||
521 | * Set the bit rate to be used in subsequent video frames. | ||
522 | * | ||
523 | * @param friend_number The friend number of the friend for which to set the | ||
524 | * bit rate. | ||
525 | * @param bit_rate The new video bit rate in Kb/sec. Set to 0 to disable. | ||
526 | * | ||
527 | * @return true on success. | ||
528 | */ | ||
529 | set(uint32_t friend_number) with error for bit_rate_set; | ||
530 | } | ||
531 | |||
532 | event bit_rate { | ||
533 | /** | ||
534 | * The function type for the ${event bit_rate} callback. The event is triggered | ||
535 | * when the network becomes too saturated for current bit rates at which | ||
536 | * point core suggests new bit rates. | ||
537 | * | ||
538 | * @param friend_number The friend number of the friend for which to set the | ||
539 | * bit rate. | ||
540 | * @param video_bit_rate Suggested maximum video bit rate in Kb/sec. | ||
541 | */ | ||
542 | typedef void(uint32_t friend_number, uint32_t video_bit_rate); | ||
543 | } | ||
529 | } | 544 | } |
530 | 545 | ||
531 | 546 | ||