diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-01-19 18:43:28 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-01-19 20:20:36 +0000 |
commit | f1d726a3a8d2515b08fd58a80650bb21fe0b3e67 (patch) | |
tree | a73dafc4714a122bc022d1579756bf0d682bbf8b /toxav/audio.h | |
parent | 25d30015563196d06fc30644556beb12250683db (diff) |
Extract named constants from magic numbers in toxav/audio.c.
By @zoff99.
Diffstat (limited to 'toxav/audio.h')
-rw-r--r-- | toxav/audio.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/toxav/audio.h b/toxav/audio.h index 8330a974..73f1b19e 100644 --- a/toxav/audio.h +++ b/toxav/audio.h | |||
@@ -28,6 +28,26 @@ | |||
28 | #include <opus.h> | 28 | #include <opus.h> |
29 | #include <pthread.h> | 29 | #include <pthread.h> |
30 | 30 | ||
31 | #define AUDIO_JITTERBUFFER_COUNT 3 | ||
32 | #define AUDIO_MAX_SAMPLE_RATE 48000 | ||
33 | #define AUDIO_MAX_CHANNEL_COUNT 2 | ||
34 | |||
35 | #define AUDIO_START_SAMPLE_RATE 48000 | ||
36 | #define AUDIO_START_BITRATE 48000 | ||
37 | #define AUDIO_START_CHANNEL_COUNT 2 | ||
38 | #define AUDIO_OPUS_PACKET_LOSS_PERC 10 | ||
39 | #define AUDIO_OPUS_COMPLEXITY 10 | ||
40 | |||
41 | #define AUDIO_DECODER_START_SAMPLE_RATE 48000 | ||
42 | #define AUDIO_DECODER_START_CHANNEL_COUNT 1 | ||
43 | |||
44 | #define AUDIO_MAX_FRAME_DURATION_MS 120 | ||
45 | |||
46 | // ((sampling_rate_in_hz * frame_duration_in_ms) / 1000) * 2 // because PCM16 needs 2 bytes for 1 sample | ||
47 | // These are per frame and per channel. | ||
48 | #define AUDIO_MAX_BUFFER_SIZE_PCM16 ((AUDIO_MAX_SAMPLE_RATE * AUDIO_MAX_FRAME_DURATION_MS) / 1000) | ||
49 | #define AUDIO_MAX_BUFFER_SIZE_BYTES (AUDIO_MAX_BUFFER_SIZE_PCM16 * 2) | ||
50 | |||
31 | struct RTPMessage; | 51 | struct RTPMessage; |
32 | 52 | ||
33 | typedef struct ACSession_s { | 53 | typedef struct ACSession_s { |