diff options
author | mannol <eniz_vukovic@hotmail.com> | 2015-04-21 02:31:12 +0200 |
---|---|---|
committer | mannol <eniz_vukovic@hotmail.com> | 2015-04-21 02:31:12 +0200 |
commit | 3fd0ee5f0873924b4881b0e33eb1c17ea877ab4a (patch) | |
tree | 6a4ee64a3ea7f0191ccfd0205a68411cf0b84063 /toxav/audio.h | |
parent | cbb8fdd4eab3bae4db1179f1fa04cdaa35957aeb (diff) |
Final touchups
Diffstat (limited to 'toxav/audio.h')
-rw-r--r-- | toxav/audio.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/toxav/audio.h b/toxav/audio.h new file mode 100644 index 00000000..62a28cdf --- /dev/null +++ b/toxav/audio.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /** audio.h | ||
2 | * | ||
3 | * Copyright (C) 2013-2015 Tox project All Rights Reserved. | ||
4 | * | ||
5 | * This file is part of Tox. | ||
6 | * | ||
7 | * Tox is free software: you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation, either version 3 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * Tox is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with Tox. If not, see <http://www.gnu.org/licenses/>. | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #ifndef AUDIO_H | ||
23 | #define AUDIO_H | ||
24 | |||
25 | #include <opus.h> | ||
26 | #include <pthread.h> | ||
27 | |||
28 | #include "toxav.h" | ||
29 | |||
30 | #include "../toxcore/util.h" | ||
31 | |||
32 | typedef struct ACSession_s { | ||
33 | /* encoding */ | ||
34 | OpusEncoder *encoder; | ||
35 | int32_t last_encoding_sampling_rate; | ||
36 | int32_t last_encoding_channel_count; | ||
37 | int32_t last_encoding_bitrate; | ||
38 | |||
39 | /* decoding */ | ||
40 | OpusDecoder *decoder; | ||
41 | int32_t last_packet_channel_count; | ||
42 | int32_t last_packet_sampling_rate; | ||
43 | int32_t last_packet_frame_duration; | ||
44 | int32_t last_decoding_sampling_rate; | ||
45 | int32_t last_decoding_channel_count; | ||
46 | uint64_t last_decoder_reconfiguration; | ||
47 | void *j_buf; | ||
48 | |||
49 | pthread_mutex_t queue_mutex[1]; | ||
50 | |||
51 | ToxAV* av; | ||
52 | uint32_t friend_id; | ||
53 | PAIR(toxav_receive_audio_frame_cb *, void *) acb; /* Audio frame receive callback */ | ||
54 | } ACSession; | ||
55 | |||
56 | ACSession* ac_new(ToxAV* av, uint32_t friend_id, toxav_receive_audio_frame_cb *cb, void *cb_data); | ||
57 | void ac_kill(ACSession* ac); | ||
58 | void ac_do(ACSession* ac); | ||
59 | int ac_reconfigure_encoder(ACSession* ac, int32_t bitrate, int32_t sampling_rate, uint8_t channels); | ||
60 | #endif /* AUDIO_H */ \ No newline at end of file | ||