diff options
Diffstat (limited to 'toxav/toxav.c')
-rw-r--r-- | toxav/toxav.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/toxav/toxav.c b/toxav/toxav.c index f704bc6b..e0ddc731 100644 --- a/toxav/toxav.c +++ b/toxav/toxav.c | |||
@@ -35,6 +35,16 @@ | |||
35 | 35 | ||
36 | #include "toxav.h" | 36 | #include "toxav.h" |
37 | 37 | ||
38 | /* Default video bitrate in bytes/s */ | ||
39 | #define VIDEO_BITRATE (10*1000*100) | ||
40 | |||
41 | /* Default audio bitrate in bits/s */ | ||
42 | #define AUDIO_BITRATE 64000 | ||
43 | |||
44 | /* Assume 60 fps*/ | ||
45 | #define MAX_ENCODE_TIME_US ((1000 / 60) * 1000) | ||
46 | |||
47 | |||
38 | #define inline__ inline __attribute__((always_inline)) | 48 | #define inline__ inline __attribute__((always_inline)) |
39 | 49 | ||
40 | static const uint8_t audio_index = 0, video_index = 1; | 50 | static const uint8_t audio_index = 0, video_index = 1; |
@@ -474,11 +484,12 @@ inline__ int toxav_send_video ( ToxAv *av, vpx_image_t *input) | |||
474 | * @brief Receive decoded audio frame. | 484 | * @brief Receive decoded audio frame. |
475 | * | 485 | * |
476 | * @param av Handler. | 486 | * @param av Handler. |
477 | * @param frame_size ... | 487 | * @param frame_size The size of dest in frames/samples (one frame/sample is 16 bits or 2 bytes |
478 | * @param dest Destination of the packet. Make sure it has enough space for | 488 | * and corresponds to one sample of audio.) |
479 | * RTP_PAYLOAD_SIZE bytes. | 489 | * @param dest Destination of the raw audio (16 bit signed pcm with AUDIO_CHANNELS channels). |
490 | * Make sure it has enough space for frame_size frames/samples. | ||
480 | * @return int | 491 | * @return int |
481 | * @retval >=0 Size of received packet. | 492 | * @retval >=0 Size of received data in frames/samples. |
482 | * @retval ToxAvError On error. | 493 | * @retval ToxAvError On error. |
483 | */ | 494 | */ |
484 | inline__ int toxav_recv_audio ( ToxAv *av, int frame_size, int16_t *dest ) | 495 | inline__ int toxav_recv_audio ( ToxAv *av, int frame_size, int16_t *dest ) |
@@ -503,8 +514,9 @@ inline__ int toxav_recv_audio ( ToxAv *av, int frame_size, int16_t *dest ) | |||
503 | * @brief Encode and send audio frame. | 514 | * @brief Encode and send audio frame. |
504 | * | 515 | * |
505 | * @param av Handler. | 516 | * @param av Handler. |
506 | * @param frame The frame. | 517 | * @param frame The frame (raw 16 bit signed pcm with AUDIO_CHANNELS channels audio.) |
507 | * @param frame_size It's size. | 518 | * @param frame_size Its size in number of frames/samples (one frame/sample is 16 bits or 2 bytes) |
519 | * frame size should be AUDIO_FRAME_SIZE. | ||
508 | * @return int | 520 | * @return int |
509 | * @retval 0 Success. | 521 | * @retval 0 Success. |
510 | * @retval ToxAvError On error. | 522 | * @retval ToxAvError On error. |