summaryrefslogtreecommitdiff
path: root/toxav/audio.h
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-08-26 20:34:26 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-09-03 20:03:47 +0000
commit6872c14e1a02445d945623ee6e85230c5d7ecbce (patch)
tree30d90b93445976e56b96946b6e87b764eddd48a8 /toxav/audio.h
parentd296490a742b226fc17a71cf96ab73fc16719b20 (diff)
Avoid use of global mutable state in mono_time on win32.
This uses a trick to get read-write access to `this` from a `const` member function, similar to C++ `mutable`, but uglier.
Diffstat (limited to 'toxav/audio.h')
-rw-r--r--toxav/audio.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/toxav/audio.h b/toxav/audio.h
index 1a33a2ae..a323a08e 100644
--- a/toxav/audio.h
+++ b/toxav/audio.h
@@ -50,7 +50,7 @@
50#define AUDIO_MAX_BUFFER_SIZE_BYTES (AUDIO_MAX_BUFFER_SIZE_PCM16 * 2) 50#define AUDIO_MAX_BUFFER_SIZE_BYTES (AUDIO_MAX_BUFFER_SIZE_PCM16 * 2)
51 51
52typedef struct ACSession_s { 52typedef struct ACSession_s {
53 const Mono_Time *mono_time; 53 Mono_Time *mono_time;
54 const Logger *log; 54 const Logger *log;
55 55
56 /* encoding */ 56 /* encoding */
@@ -78,11 +78,11 @@ typedef struct ACSession_s {
78 void *acb_user_data; 78 void *acb_user_data;
79} ACSession; 79} ACSession;
80 80
81ACSession *ac_new(const Mono_Time *mono_time, const Logger *log, ToxAV *av, uint32_t friend_number, 81ACSession *ac_new(Mono_Time *mono_time, const Logger *log, ToxAV *av, uint32_t friend_number,
82 toxav_audio_receive_frame_cb *cb, void *cb_data); 82 toxav_audio_receive_frame_cb *cb, void *cb_data);
83void ac_kill(ACSession *ac); 83void ac_kill(ACSession *ac);
84void ac_iterate(ACSession *ac); 84void ac_iterate(ACSession *ac);
85int ac_queue_message(const Mono_Time *mono_time, void *acp, struct RTPMessage *msg); 85int ac_queue_message(Mono_Time *mono_time, void *acp, struct RTPMessage *msg);
86int ac_reconfigure_encoder(ACSession *ac, int32_t bit_rate, int32_t sampling_rate, uint8_t channels); 86int ac_reconfigure_encoder(ACSession *ac, int32_t bit_rate, int32_t sampling_rate, uint8_t channels);
87 87
88#endif /* AUDIO_H */ 88#endif /* AUDIO_H */