summaryrefslogtreecommitdiff
path: root/toxav/audio.h
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2015-04-29 01:01:25 +0200
committermannol <eniz_vukovic@hotmail.com>2015-04-29 01:01:25 +0200
commit9bba7a0434d0967d5dd76b8afc7783ea2edad0cf (patch)
tree6486c250acb38429a63a62e54cd1e4bcb0a029ee /toxav/audio.h
parente4a020333d76bc30172f54f2545677f01bdd54b6 (diff)
Done
Diffstat (limited to 'toxav/audio.h')
-rw-r--r--toxav/audio.h33
1 files changed, 26 insertions, 7 deletions
diff --git a/toxav/audio.h b/toxav/audio.h
index a36396f1..c003bac0 100644
--- a/toxav/audio.h
+++ b/toxav/audio.h
@@ -31,18 +31,21 @@
31 31
32struct RTPMessage_s; 32struct RTPMessage_s;
33 33
34/*
35 * Base Audio Codec session type.
36 */
34typedef struct ACSession_s { 37typedef struct ACSession_s {
35 /* encoding */ 38 /* encoding */
36 OpusEncoder *encoder; 39 OpusEncoder *encoder;
37 int32_t last_encoding_sampling_rate; 40 int32_t last_encoding_sampling_rate;
38 int32_t last_encoding_channel_count; 41 int32_t last_encoding_channel_count;
39 int32_t last_encoding_bitrate; 42 int32_t last_encoding_bit_rate;
40 43
41 /* Testing encoder for dynamic bitrate streaming */ 44 /* Testing encoder for dynamic bit rate streaming */
42 OpusEncoder *test_encoder; 45 OpusEncoder *test_encoder;
43 int32_t last_test_encoding_sampling_rate; 46 int32_t last_test_encoding_sampling_rate;
44 int32_t last_test_encoding_channel_count; 47 int32_t last_test_encoding_channel_count;
45 int32_t last_test_encoding_bitrate; 48 int32_t last_test_encoding_bit_rate;
46 49
47 /* decoding */ 50 /* decoding */
48 OpusDecoder *decoder; 51 OpusDecoder *decoder;
@@ -57,14 +60,30 @@ typedef struct ACSession_s {
57 pthread_mutex_t queue_mutex[1]; 60 pthread_mutex_t queue_mutex[1];
58 61
59 ToxAV* av; 62 ToxAV* av;
60 uint32_t friend_id; 63 uint32_t friend_number;
61 PAIR(toxav_receive_audio_frame_cb *, void *) acb; /* Audio frame receive callback */ 64 PAIR(toxav_receive_audio_frame_cb *, void *) acb; /* Audio frame receive callback */
62} ACSession; 65} ACSession;
63 66
64ACSession* ac_new(ToxAV* av, uint32_t friend_id, toxav_receive_audio_frame_cb *cb, void *cb_data); 67/*
68 * Create new Audio Codec session.
69 */
70ACSession* ac_new(ToxAV* av, uint32_t friend_number, toxav_receive_audio_frame_cb *cb, void *cb_data);
71/*
72 * Kill the Audio Codec session.
73 */
65void ac_kill(ACSession* ac); 74void ac_kill(ACSession* ac);
75/*
76 * Do periodic work. Work is consisted out of decoding only.
77 */
66void ac_do(ACSession* ac); 78void ac_do(ACSession* ac);
79/*
80 * Queue new rtp message.
81 */
67int ac_queue_message(void *acp, struct RTPMessage_s *msg); 82int ac_queue_message(void *acp, struct RTPMessage_s *msg);
68int ac_reconfigure_encoder(ACSession* ac, int32_t bitrate, int32_t sampling_rate, uint8_t channels); 83/*
69int ac_reconfigure_test_encoder(ACSession* ac, int32_t bitrate, int32_t sampling_rate, uint8_t channels); 84 * Set new values to the encoders.
85 */
86int ac_reconfigure_encoder(ACSession* ac, int32_t bit_rate, int32_t sampling_rate, uint8_t channels);
87int ac_reconfigure_test_encoder(ACSession* ac, int32_t bit_rate, int32_t sampling_rate, uint8_t channels);
88
70#endif /* AUDIO_H */ \ No newline at end of file 89#endif /* AUDIO_H */ \ No newline at end of file