summaryrefslogtreecommitdiff
path: root/toxav/toxav.h
diff options
context:
space:
mode:
Diffstat (limited to 'toxav/toxav.h')
-rw-r--r--toxav/toxav.h25
1 files changed, 9 insertions, 16 deletions
diff --git a/toxav/toxav.h b/toxav/toxav.h
index be7a2950..40cd90db 100644
--- a/toxav/toxav.h
+++ b/toxav/toxav.h
@@ -39,12 +39,6 @@ typedef struct Tox Tox;
39 39
40#define RTP_PAYLOAD_SIZE 65535 40#define RTP_PAYLOAD_SIZE 65535
41 41
42/* Default video bitrate in bytes/s */
43#define VIDEO_BITRATE 10*1000*100
44
45/* Default audio bitrate in bits/s */
46#define AUDIO_BITRATE 64000
47
48/* Number of audio channels. */ 42/* Number of audio channels. */
49#define AUDIO_CHANNELS 1 43#define AUDIO_CHANNELS 1
50 44
@@ -55,10 +49,7 @@ typedef struct Tox Tox;
55#define AUDIO_SAMPLE_RATE 48000 49#define AUDIO_SAMPLE_RATE 48000
56 50
57/* The amount of samples in one audio frame */ 51/* The amount of samples in one audio frame */
58#define AUDIO_FRAME_SIZE AUDIO_SAMPLE_RATE*AUDIO_FRAME_DURATION/1000 52#define AUDIO_FRAME_SIZE (AUDIO_SAMPLE_RATE*AUDIO_FRAME_DURATION/1000)
59
60/* Assume 60 fps*/
61#define MAX_ENCODE_TIME_US ((1000 / 60) * 1000)
62 53
63 54
64/** 55/**
@@ -246,11 +237,12 @@ int toxav_recv_video ( ToxAv *av, vpx_image_t **output);
246 * @brief Receive decoded audio frame. 237 * @brief Receive decoded audio frame.
247 * 238 *
248 * @param av Handler. 239 * @param av Handler.
249 * @param frame_size ... 240 * @param frame_size The size of dest in frames/samples (one frame/sample is 16 bits or 2 bytes
250 * @param dest Destination of the packet. Make sure it has enough space for 241 * and corresponds to one sample of audio.)
251 * RTP_PAYLOAD_SIZE bytes. 242 * @param dest Destination of the raw audio (16 bit signed pcm with AUDIO_CHANNELS channels).
243 * Make sure it has enough space for frame_size frames/samples.
252 * @return int 244 * @return int
253 * @retval >=0 Size of received packet. 245 * @retval >=0 Size of received data in frames/samples.
254 * @retval ToxAvError On error. 246 * @retval ToxAvError On error.
255 */ 247 */
256int toxav_recv_audio( ToxAv *av, int frame_size, int16_t *dest ); 248int toxav_recv_audio( ToxAv *av, int frame_size, int16_t *dest );
@@ -270,8 +262,9 @@ int toxav_send_video ( ToxAv *av, vpx_image_t *input);
270 * @brief Encode and send audio frame. 262 * @brief Encode and send audio frame.
271 * 263 *
272 * @param av Handler. 264 * @param av Handler.
273 * @param frame The frame. 265 * @param frame The frame (raw 16 bit signed pcm with AUDIO_CHANNELS channels audio.)
274 * @param frame_size It's size. 266 * @param frame_size Its size in number of frames/samples (one frame/sample is 16 bits or 2 bytes)
267 * frame size should be AUDIO_FRAME_SIZE.
275 * @return int 268 * @return int
276 * @retval 0 Success. 269 * @retval 0 Success.
277 * @retval ToxAvError On error. 270 * @retval ToxAvError On error.