forked from BearWare/TeamTalk5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TeamTalk.h
8220 lines (7809 loc) · 345 KB
/
TeamTalk.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#if !defined(TEAMTALKDLL_H)
#define TEAMTALKDLL_H
/*
* BearWare.dk TeamTalk 5 SDK.
*
* Copyright 2005-2022, BearWare.dk.
*
* Read the License.txt file included with the TeamTalk 5 SDK for
* terms of use.
*/
/**
* @brief Ensure the header and DLL are exactly the same version. To
* get the version of the loaded DLL call TT_GetVersion(). A remote
* client's version can be seen in the @a szVersion member of the
* #User-struct. */
#define TEAMTALK_VERSION "5.18.0.5151"
#if defined(WIN32)
#ifdef TEAMTALKDLL_EXPORTS
#define TEAMTALKDLL_API __declspec(dllexport)
#else
#define TEAMTALKDLL_API __declspec(dllimport)
#endif
#else
#define TEAMTALKDLL_API
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* OS specific types. */
#if !defined(TEAMTALK_TYPES)
#define TEAMTALK_TYPES 1
#if defined(WIN32)
/* If you get a compiler error here you probably forgot to include
* <windows.h> before this file. */
/** @brief TeamTalk uses Unicode on Windows. @see TT_STRLEN */
typedef WCHAR TTCHAR;
typedef int TTBOOL;
#else
typedef char TTCHAR;
typedef int TTBOOL;
typedef unsigned short UINT16;
typedef int INT32;
typedef long long INT64;
typedef unsigned int UINT32;
typedef void VOID;
/** Windows has macros which tell whether a parameter is used as input
* or output so these are just defined as nothing. */
#define IN
#define OUT
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#endif
/** @def TT_STRLEN
*
* If a string is passed to the client instance is longer than
* TT_STRLEN it will be truncated.
*
* On Windows the client instance converts unicode characters to
* UTF-8 before transmission, so be aware of non-ASCII characters
* if communicating with the TeamTalk server from another
* applications than the TeamTalk client. */
#define TT_STRLEN 512
/** @def TT_USERID_MAX
* The highest user ID */
#define TT_USERID_MAX 0xFFF
/** @def TT_CHANNELID_MAX
* The highest channel ID. Also used for #TT_CLASSROOM_FREEFORALL */
#define TT_CHANNELID_MAX 0xFFF
/** @ingroup videocapture
* @def TT_VIDEOFORMATS_MAX
* The maximum number of video formats which will be queried for a
* #VideoCaptureDevice. */
#define TT_VIDEOFORMATS_MAX 1024
/** @ingroup channels
* @def TT_TRANSMITUSERS_MAX
* The maximum number of users allowed to transmit when a
* #Channel is configured with #CHANNEL_CLASSROOM. */
#define TT_TRANSMITUSERS_MAX 128
/** @ingroup channels
* @def TT_CLASSROOM_FREEFORALL
* If a #Channel is configured with #CHANNEL_CLASSROOM then only
* users certain user IDs are allowed to transmit. If, however, @c
* TT_CLASSROOM_FREEFORALL is put in @c transmitUsers then
* everyone in the channel are allowed to transmit. */
#define TT_CLASSROOM_FREEFORALL 0xFFF
/** @ingroup channels
* User ID index in @c transmitUsers of #Channel */
#define TT_CLASSROOM_USERID_INDEX 0
/** @ingroup channels
* #StreamTypes index in @c transmitUsers of #Channel */
#define TT_CLASSROOM_STREAMTYPE_INDEX 1
/** @ingroup channels
* @def TT_TRANSMITUSERS_FREEFORALL
* Same as #TT_CLASSROOM_FREEFORALL */
#define TT_TRANSMITUSERS_FREEFORALL 0xFFF
/** @ingroup channels
* @def TT_TRANSMITUSERS_USERID_INDEX
* Same as #TT_CLASSROOM_USERID_INDEX */
#define TT_TRANSMITUSERS_USERID_INDEX 0
/** @ingroup channels
* @def TT_TRANSMITUSERS_STREAMTYPE_INDEX
* Same as #TT_CLASSROOM_STREAMTYPE_INDEX */
#define TT_TRANSMITUSERS_STREAMTYPE_INDEX 1
/** @ingroup channels
* @def TT_CHANNELS_OPERATOR_MAX
* The maximum number of channels where a user can automatically become
* channel operator.
* @see #UserAccount */
#define TT_CHANNELS_OPERATOR_MAX 16
/** @ingroup channels
* @def TT_TRANSMITQUEUE_MAX
* The maximum number of users in a #Channel's transmit queue when channel
* is configured with #CHANNEL_SOLO_TRANSMIT */
#define TT_TRANSMITQUEUE_MAX 16
/** @ingroup sounddevices
* The maximum number of sample rates supported by a #SoundDevice. */
#define TT_SAMPLERATES_MAX 16
/** @ingroup desktopshare
* @def TT_DESKTOPINPUT_MAX
*
* The maximum number #DesktopInput instances which can be sent by
* TT_SendDesktopInput(). */
#define TT_DESKTOPINPUT_MAX 16
/** @ingroup desktopshare
* @def TT_DESKTOPINPUT_KEYCODE_IGNORE
*
* If @c uKeyCode in #DesktopInput is set to
* #TT_DESKTOPINPUT_KEYCODE_IGNORE it means no key (or mouse button)
* was pressed in the desktop input event and
* TT_DesktopInput_Execute() will ignore the value. */
#define TT_DESKTOPINPUT_KEYCODE_IGNORE 0xFFFFFFFF
/** @ingroup desktopshare
* @def TT_DESKTOPINPUT_MOUSEPOS_IGNORE
*
* If @c uMousePosX or @c uMousePosY in #DesktopInput are set to
* #TT_DESKTOPINPUT_MOUSEPOS_IGNORE it means the mouse position is
* ignored when calling TT_DesktopInput_Execute(). */
#define TT_DESKTOPINPUT_MOUSEPOS_IGNORE 0xFFFF
/** @ingroup desktopshare
* @def TT_DESKTOPINPUT_KEYCODE_LMOUSEBTN
*
* If @c uKeyCode of #DesktopInput is set to
* #TT_DESKTOPINPUT_KEYCODE_LMOUSEBTN then TT_DesktopInput_Execute()
* will see the key-code as a left mouse button click. */
#define TT_DESKTOPINPUT_KEYCODE_LMOUSEBTN 0x1000
/** @ingroup desktopshare
* @def TT_DESKTOPINPUT_KEYCODE_RMOUSEBTN
*
* If @c uKeyCode of #DesktopInput is set to
* #TT_DESKTOPINPUT_KEYCODE_RMOUSEBTN then TT_DesktopInput_Execute()
* will see the key-code as a right mouse button click. */
#define TT_DESKTOPINPUT_KEYCODE_RMOUSEBTN 0x1001
/** @ingroup desktopshare
* @def TT_DESKTOPINPUT_KEYCODE_MMOUSEBTN
*
* If @c uKeyCode of #DesktopInput is set to
* #TT_DESKTOPINPUT_KEYCODE_MMOUSEBTN then TT_DesktopInput_Execute()
* will see the key-code as a middle mouse button click. */
#define TT_DESKTOPINPUT_KEYCODE_MMOUSEBTN 0x1002
/** @ingroup mediastream
* @def TT_MEDIAPLAYBACK_OFFSET_IGNORE
*
* Specify this value as uOffsetMSec in #MediaFilePlayback when
* calling TT_InitLocalPlayback() and TT_UpdateLocalPlayback() to
* ignore rewind or forward.
*/
#define TT_MEDIAPLAYBACK_OFFSET_IGNORE 0xFFFFFFFF
#endif /* TEAMTALK_TYPES */
/** @addtogroup transmission
* @{ */
/** @brief The types of streams which are available for
* transmission. */
typedef enum StreamType
{
/** @brief No stream. */
STREAMTYPE_NONE = 0x00000000,
/** @brief Voice stream type which is audio recorded from a
* sound input device. @see TT_InitSoundInputDevice() */
STREAMTYPE_VOICE = 0x00000001,
/** @brief Video capture stream type which is video recorded
* from a webcam. @see TT_InitVideoCaptureDevice() */
STREAMTYPE_VIDEOCAPTURE = 0x00000002,
/** @brief Audio stream type from a media file which is being
* streamed. @see TT_StartStreamingMediaFileToChannel() */
STREAMTYPE_MEDIAFILE_AUDIO = 0x00000004,
/** @brief Video stream type from a media file which is being
* streamed. @see TT_StartStreamingMediaFileToChannel() */
STREAMTYPE_MEDIAFILE_VIDEO = 0x00000008,
/** @brief Desktop window stream type which is a window (or
* bitmap) being transmitted. @see TT_SendDesktopWindow() */
STREAMTYPE_DESKTOP = 0x00000010,
/** @brief Desktop input stream type which is keyboard or
* mouse input being transmitted. @see
* TT_SendDesktopInput() */
STREAMTYPE_DESKTOPINPUT = 0x00000020,
/** @brief Shortcut to allow both audio and video media files. */
STREAMTYPE_MEDIAFILE = STREAMTYPE_MEDIAFILE_AUDIO |
STREAMTYPE_MEDIAFILE_VIDEO,
/** @brief Channel text messages as stream type.
*
* A channel text message is not a stream but is only included
* as a stream type in order to be able to block messages
* using @c transmitUsers in #Channel struct.
*
* @see TT_DoUpdateChannel()
* @see CHANNEL_CLASSROOM. */
STREAMTYPE_CHANNELMSG = 0x00000040,
/** @brief Stream type for audio of local playback.
*
* TT_EnableAudioBlockEvent() can be used to intercept audio
* from a local media playback.
* @see TT_InitLocalPlayback() */
STREAMTYPE_LOCALMEDIAPLAYBACK_AUDIO = 0x00000080,
/** @brief Shortcut to allow voice, media files, desktop,
* webcamera and channel messages. */
STREAMTYPE_CLASSROOM_ALL = STREAMTYPE_VOICE |
STREAMTYPE_VIDEOCAPTURE |
STREAMTYPE_DESKTOP |
STREAMTYPE_MEDIAFILE |
STREAMTYPE_CHANNELMSG,
} StreamType;
/** @brief Mask of #StreamType. */
typedef UINT32 StreamTypes;
/** @} */
/** @addtogroup sounddevices
* @{ */
/**
* @brief The supported sound systems.
*
* @see SoundDevice
* @see TT_InitSoundInputDevice()
* @see TT_InitSoundOutputDevice()
* @see TT_InitSoundDuplexDevices() */
typedef enum SoundSystem
{
/** @brief Sound system denoting invalid or not found. */
SOUNDSYSTEM_NONE = 0,
/** @brief Windows legacy audio system. Should be used on Windows Mobile. */
SOUNDSYSTEM_WINMM = 1,
/** @brief DirectSound audio system. Should be used on Windows. */
SOUNDSYSTEM_DSOUND = 2,
/**
* @brief Advanced Linux Sound Architecture (ALSA). Should be used on Linux.
*
* Often ALSA sound devices only support a limited number of
* sample rates so TeamTalk internally use software filters to
* resample the audio to the sample rate used by the selected
* audio codecs. */
SOUNDSYSTEM_ALSA = 3,
/** @brief Core Audio. Should be used on MacOS. */
SOUNDSYSTEM_COREAUDIO = 4,
/** @brief Windows Audio Session API (WASAPI). Should be used
* on Windows Vista/7/8/10.
*
* WASAPI audio devices typically only support a single sample
* rate so internally TeamTalk uses software filters to
* resample audio to the sample rate used by the selected
* audio codecs.
*
* Check @c supportedSampleRates and @c nDefaultSampleRate of
* #SoundDevice to see which sample rates are supported. */
SOUNDSYSTEM_WASAPI = 5,
/** @brief Android sound API.
*
* The OpenSL ES sound API requires Android 4.1 or later.
*
* Duplex mode is not supported by OpenSL ES @see
* TT_InitSoundDuplexDevices() */
SOUNDSYSTEM_OPENSLES_ANDROID = 7,
/** @brief iOS sound API.
*
* The following sound devices will appear when calling
* TT_GetSoundDevices(). Sound device ID
* #TT_SOUNDDEVICE_ID_REMOTEIO will be AudioUnit subtype
* Remote I/O Unit and sound device ID
* #TT_SOUNDDEVICE_ID_VOICEPREPROCESSINGIO will be AudioUnit
* subtype Voice-Processing I/O Unit.
*
* Note that iOS only supports one active Voice-Processing I/O
* Unit, i.e. only one #TTInstance can use the
* Voice-Processing I/O Unit.
*
* Add libraries @c AVFoundation.framework and
* @c AudioToolbox.framework.
*
* Duplex mode is not supported by AudioUnit iOS sound API.
* @see TT_SOUNDDEVICE_ID_REMOTEIO
* @see TT_SOUNDDEVICE_ID_VOICEPREPROCESSINGIO */
SOUNDSYSTEM_AUDIOUNIT = 8,
/** @brief Same as #SOUNDSYSTEM_AUDIOUNIT. */
SOUNDSYSTEM_AUDIOUNIT_IOS = SOUNDSYSTEM_AUDIOUNIT,
/** @brief PulseAudio API.
* PulseAudio is typically used on Ubuntu 22. */
SOUNDSYSTEM_PULSEAUDIO = 10,
} SoundSystem;
/**
* @brief Features available on a sound device.
* Checkout @c uSoundDeviceFeatures on #SoundDevice.
* */
typedef enum SoundDeviceFeature
{
/** @brief No sound device features are available on this
* sound device. */
SOUNDDEVICEFEATURE_NONE = 0x0000,
/** @brief The #SoundDevice can enable Acoustic
* Echo Canceler (AEC).
* Enable AEC use property @c bEnableAEC on
* #SoundDeviceEffects.
* @see TT_SetSoundDeviceEffects() */
SOUNDDEVICEFEATURE_AEC = 0x0001,
/** @brief The #SoundDevice can enable Automatic
* Gain Control (AGC).
* Enable AGC use property @c bEnableAGC on
* #SoundDeviceEffects.
* @see TT_SetSoundDeviceEffects() */
SOUNDDEVICEFEATURE_AGC = 0x0002,
/** @brief The #SoundDevice can enable denoising.
* Enable denoising use property @c bEnableDenoising on
* #SoundDeviceEffects.
* @see TT_SetSoundDeviceEffects() */
SOUNDDEVICEFEATURE_DENOISE = 0x0004,
/** @brief The #SoundDevice can position user in 3D.
* @see TT_SetUserPosition() */
SOUNDDEVICEFEATURE_3DPOSITION = 0x0008,
/** @brief The #SoundDevice can run in duplex mode.
* @see TT_InitSoundDuplexDevices() */
SOUNDDEVICEFEATURE_DUPLEXMODE = 0x0010,
/** @brief The #SoundDevice is the default communication device.
* This feature is only supported on SOUNDSYSTEM_WASAPI. */
SOUNDDEVICEFEATURE_DEFAULTCOMDEVICE = 0x0020,
} SoundDeviceFeature;
/** @brief A bitmask of available #SoundDeviceFeature.
* Checkout @c uSoundDeviceFeatures on #SoundDevice. */
typedef UINT32 SoundDeviceFeatures;
/**
* @brief A struct containing the properties of a sound device
* for either playback or recording.
*
* Use @a nDeviceID to pass to #TT_InitSoundInputDevice or
* #TT_InitSoundOutputDevice.
*
* Note that the @a nDeviceID may change if the user application
* is restarted and a new sound device is added or removed from
* the computer.
*
* @see TT_GetSoundDevices */
typedef struct SoundDevice
{
/** @brief The ID of the sound device. Used for passing to
* #TT_InitSoundInputDevice and
* #TT_InitSoundOutputDevice. Note that @a nDeviceID might change
* if USB sound devices are plugged in or unplugged, therefore
* use @a szDeviceID to ensure proper device is used. */
INT32 nDeviceID;
/** @brief The sound system used by the sound device */
SoundSystem nSoundSystem;
/** @brief The name of the sound device */
TTCHAR szDeviceName[TT_STRLEN];
/** @brief An identifier uniquely identifying the sound device
* even when new sound devices are being added and removed. In
* DirectSound, WASAPI and WinMM it would be the GUID of the sound
* device. Note that it may not always be available. */
TTCHAR szDeviceID[TT_STRLEN];
/**
* @brief A Windows specific ID to the sound device.
*
* For DirectSound and WinMM this is the ID of the device used
* in Win32's waveInGetDevCaps and waveOutGetDevCaps.
* Value will be -1 if no ID could be found This ID can also
* be used to find the corresponding mixer on Windows passing
* it as @a nWaveDeviceID. Note that this ID applies both to
* DirectSound and WinMM.
*
* For WASAPI this ID is the index of
* IMMDeviceEnumerator::EnumAudioEndpoints()
*
* @see TT_Mixer_GetWaveInName
* @see TT_Mixer_GetWaveOutName
* @see TT_Mixer_GetMixerCount */
INT32 nWaveDeviceID;
/** @brief Whether the sound device supports 3D-sound
* effects. @deprecated Use #SOUNDDEVICEFEATURE_3DPOSITION. */
TTBOOL bSupports3D;
/** @brief The maximum number of input channels. */
INT32 nMaxInputChannels;
/** @brief The maximum number of output channels. */
INT32 nMaxOutputChannels;
/** @brief Supported sample rates by device for recording. A
* zero value terminates the list of supported sample rates or
* its maximum size of #TT_SAMPLERATES_MAX. */
INT32 inputSampleRates[TT_SAMPLERATES_MAX];
/** @brief Supported sample rates by device for playback. A
* zero value terminates the list of supported sample rates or
* its maximum size of #TT_SAMPLERATES_MAX. */
INT32 outputSampleRates[TT_SAMPLERATES_MAX];
/** @brief The default sample rate for the sound device. */
INT32 nDefaultSampleRate;
/** @brief Additional features available for this sound
* device. The sound device features can be used to enable
* additional features on the sound device.
* @see SoundDeviceFeature
* @see TT_SetSoundDeviceEffects() */
SoundDeviceFeatures uSoundDeviceFeatures;
} SoundDevice;
/**
* @brief Set up audio effects supported by the sound device.
*
* The effects supported by a sound device are listed in the @c
* uSoundDeviceFeatures property of #SoundDevice.
*
* To apply audio effects on a sound device call
* TT_SetSoundDeviceEffects() */
typedef struct SoundDeviceEffects
{
/**
* @brief Enable Automatic Gain Control.
*
* This effect can be enabled on a #SoundDevice that has
* #SOUNDDEVICEFEATURE_AGC flag in @c uSoundDeviceFeatures.
*
* Supported platforms:
* - Windows
* - Automatic gain control is per #TTInstance.
* - #TTInstance must initialize sound devices using
* TT_InitSoundDuplexDevices()
* - Android
* - Automatic gain control will be applied on all active
* #TTInstance.
* @see SOUNDDEVICEFEATURE_AGC */
TTBOOL bEnableAGC;
/**
* @brief Enable noise suppression.
*
* This effect can be enabled on a #SoundDevice that has
* #SOUNDDEVICEFEATURE_DENOISE flag in @c
* uSoundDeviceFeatures.
*
* Supported platforms:
* - Windows
* - Noise suppression is per #TTInstance.
* - #TTInstance must initialize sound devices using
* TT_InitSoundDuplexDevices()
* - Android
* - Noise suppression will be applied on all active
* #TTInstance.
* @see SOUNDDEVICEFEATURE_DENOISE */
TTBOOL bEnableDenoise;
/**
* @brief Enable echo cancellation.
*
* This effect can be enabled on a #SoundDevice that has
* #SOUNDDEVICEFEATURE_AEC flag in @c uSoundDeviceFeatures.
*
* Supported platforms:
* - Windows
* - Echo cancellation is per #TTInstance.
* - #TTInstance must initialize sound devices using
* TT_InitSoundDuplexDevices()
* - Android
* - Echo cancellation will be applied on all active
* #TTInstance.
* @see SOUNDDEVICEFEATURE_AEC */
TTBOOL bEnableEchoCancellation;
} SoundDeviceEffects;
/**
* @brief Flag/bit in @c nDeviceID telling if the #SoundDevice is a
* shared version of an existing sound device.
*
* On Android the recording device can only be used by one TeamTalk
* instance. As a workaround for this issue a shared recording device
* has been introduced. Internally TeamTalk initializes
* #TT_SOUNDDEVICE_ID_OPENSLES_DEFAULT which then resample and
* distribute the audio data to multiple TeamTalk instances.
*
* The shared audio device on Android will show up as
* (TT_SOUNDDEVICE_ID_OPENSLES_DEFAULT | TT_SOUNDDEVICE_ID_SHARED_FLAG),
* i.e. 2048.
*/
#define TT_SOUNDDEVICE_ID_SHARED_FLAG 0x00000800
/** @brief Extract sound device ID of @c nDeviceID in #SoundDevice by
* and'ing this value.
*
* let PhysicalDeviceID = (SoundDevice.nDeviceID & TT_SOUNDDEVICE_ID_MASK). */
#define TT_SOUNDDEVICE_ID_MASK 0x000007FF
/** @brief Sound device ID for iOS AudioUnit subtype Remote I/O
* Unit. @see SOUNDSYSTEM_AUDIOUNIT */
#define TT_SOUNDDEVICE_ID_REMOTEIO 0
/** @brief Sound device ID for iOS AudioUnit subtype Voice-Processing
* I/O Unit.
*
* This sound device ID include the flag
* #TT_SOUNDDEVICE_ID_SHARED_FLAG since multiple streams cannot be
* recorded/played on the device. @see SOUNDSYSTEM_AUDIOUNIT */
#define TT_SOUNDDEVICE_ID_VOICEPREPROCESSINGIO (1 | TT_SOUNDDEVICE_ID_SHARED_FLAG)
/** @brief Sound device ID for Android OpenSL ES default audio
* device. @see SOUNDSYSTEM_OPENSLES_ANDROID */
#define TT_SOUNDDEVICE_ID_OPENSLES_DEFAULT 0
/** @brief Sound device ID for Android OpenSL ES voice communication
* mode. This device uses the OpenSL ES' AndroidConfiguration @c
* SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION @see
* SOUNDSYSTEM_OPENSLES_ANDROID */
#define TT_SOUNDDEVICE_ID_OPENSLES_VOICECOM 1
/** @brief Sound device ID for virtual TeamTalk sound device.
*
* This is a sound device which decodes received audio packets but
* does not send the decoded audio to a real sound device. When used
* for recording the virtual sound device injects silence.
*
* In duplex mode the virtual TeamTalk sound device can only be used
* as input/output device. @see SOUNDSYSTEM_NONE */
#define TT_SOUNDDEVICE_ID_TEAMTALK_VIRTUAL 1978
/**
* @brief An enum encapsulation the minimum, maximum and default sound
* levels for input and output sound devices. */
typedef enum SoundLevel
{
/**
* @brief The maximum value of recorded audio.
* @see TT_GetSoundInputLevel
* @see TT_SetVoiceActivationLevel
* @see TT_GetVoiceActivationLevel */
SOUND_VU_MAX = 100,
/**
* @brief The minimum value of recorded audio.
* @see TT_GetSoundInputLevel
* @see TT_SetVoiceActivationLevel
* @see TT_GetVoiceActivationLevel */
SOUND_VU_MIN = 0,
/**
* @brief The maximum volume.
*
* @see TT_SetSoundOutputVolume
* @see TT_GetSoundOutputVolume
* @see TT_SetUserVolume
* @see SOUND_VOLUME_DEFAULT */
SOUND_VOLUME_MAX = 32000,
/**
* @brief The default volume. Use this whenever possible since
* it requires the least amount of CPU usage.
*
* @see TT_SetSoundOutputVolume
* @see TT_GetSoundOutputVolume
* @see TT_SetUserVolume */
SOUND_VOLUME_DEFAULT = 1000,
/**
* @brief The minimum volume.
* @see TT_SetSoundOutputVolume
* @see TT_GetSoundOutputVolume
* @see TT_SetUserVolume */
SOUND_VOLUME_MIN = 0,
/**
* @brief The maximum gain level.
*
* A gain level of 32000 gains the volume by a factor 32. A gain
* level of #SOUND_GAIN_DEFAULT means no gain.
*
* @see TT_SetSoundInputGainLevel
* @see TT_GetSoundInputGainLevel */
SOUND_GAIN_MAX = 32000,
/**
* @brief The default gain level.
*
* A gain level of 1000 means no gain. Check #SOUND_GAIN_MAX
* and #SOUND_GAIN_MIN to see how to increase and lower gain
* level.
*
* @see TT_SetSoundInputGainLevel
* @see TT_GetSoundInputGainLevel */
SOUND_GAIN_DEFAULT = 1000,
/**
* @brief The minimum gain level (since it's zero it means
* silence).
*
* A gain level of 100 is 1/10 of the default volume.
*
* @see TT_SetSoundInputGainLevel
* @see TT_GetSoundInputGainLevel */
SOUND_GAIN_MIN = 0
} SoundLevel;
/**
* @brief An audio block containing the raw audio from a user who
* was talking.
*
* To enable audio blocks first call TT_EnableAudioBlockEvent()
* then whenever new audio is played the event
* #CLIENTEVENT_USER_AUDIOBLOCK is generated. Use
* TT_AcquireUserAudioBlock() to retrieve the audio block.
*
* Note that each user is limited to 128 kbytes of audio data.
*
* @see TT_EnableAudioBlockEvent()
* @see TT_AcquireUserAudioBlock()
* @see TT_ReleaseUserAudioBlock() */
typedef struct AudioBlock
{
/** @brief The ID of the stream. The stream id changes every time
* the user enables a new transmission using TT_EnableTransmission()
* or through voice activation. */
INT32 nStreamID;
/** @brief The sample rate of the raw audio. */
INT32 nSampleRate;
/** @brief The number of channels used (1 for mono, 2 for stereo). */
INT32 nChannels;
/** @brief The raw audio in 16-bit integer format array. The
* size of the array in bytes is @c sizeof(short) * @c
* nSamples * @c nChannels. */
VOID* lpRawAudio;
/** @brief The number of samples in the raw audio array. */
INT32 nSamples;
/** @brief The index of the first sample in @c lpRawAudio. Its
* value will be a multiple of @c nSamples. The sample index
* can be used to detect overflows of the internal
* buffer. When a user initially starts talking the @c
* nSampleIndex will be 0 and while the user is talking @c
* nSampleIndex will be greater than 0. When the user stops
* talking @c nSampleIndex will be reset to 0 again. */
UINT32 uSampleIndex;
/** @brief The stream types used to generate the AudioBlock's
* raw audio.
*
* When retrieving audio that has been mixed together from
* multiple sources it can be useful to know what stream types
* were mixed together to generate the AudioBlock.
*
* If 'uStreamTypes' is STREAMTYPE_NONE it means that silence
* was inserted. Silence is inserted if no audio was available
* for mixing or the duration from last audio packet was
* received and until @c nStoppedDelayVoice of #User has
* expired. @see TT_MUXED_USERID */
StreamTypes uStreamTypes;
} AudioBlock;
/**
* @brief User ID passed to TT_EnableAudioBlockEvent() in order to
* receive #AudioBlock directly from sound input device after joining
* a channel.
*
* When this user ID is passed then the #AudioBlock received will be
* prior to audio preprocessing (#AudioPreprocessor).
*
* Note, however, that #CLIENTEVENT_USER_AUDIOBLOCK will not be
* triggered until the #TTInstance is in a channel. This is because
* the sound input device is not started until it knows the
* #AudioCodec's sample rate, number of channels and transmit
* interval. */
#define TT_LOCAL_USERID 0
/**
* @brief User ID passed to TT_EnableAudioBlockEvent() in order to
* receive #AudioBlock when voice transmission is activated.
*
* Either through TT_EnableVoiceActivation() or
* TT_EnableVoiceTransmission().
*/
#define TT_LOCAL_TX_USERID 0x1002
/**
* @brief User ID used to identify muxed audio that has been mixed
* into a single stream.
*
* This user ID is passed to TT_EnableAudioBlockEvent() in order to
* receive #AudioBlock of audio that is played by the #TTInstance. */
#define TT_MUXED_USERID 0x1001 /* TT_USERID_MAX + 2 */
/** @} */
/** @addtogroup mediastream
* @{ */
/**
* @brief Status of media file being written to disk.
* @see CLIENTEVENT_USER_RECORD_MEDIAFILE */
typedef enum MediaFileStatus
{
MFS_CLOSED = 0,
/** @brief Error while processing media file. */
MFS_ERROR = 1,
/** @brief Started processing media file. */
MFS_STARTED = 2,
/** @brief Finished processing media file. */
MFS_FINISHED = 3,
/** @brief Aborted processing of media file. */
MFS_ABORTED = 4,
/** @brief Paused processing of media file. */
MFS_PAUSED = 5,
/** @brief Playing media file with updated @c uElapsedMSec of
* #MediaFileInfo. */
MFS_PLAYING = 6
} MediaFileStatus;
/**
* @brief Media file formats supported for muxed audio recordings.
* @see TT_StartRecordingMuxedAudioFile() */
typedef enum AudioFileFormat
{
/** @brief Used to denote nothing selected. */
AFF_NONE = 0,
/** @brief Store audio in the same format as the #Channel's
* configured audio codec.
*
* Audio is stored in OGG format. OGG format is supported by
* https://www.xiph.org/ogg and can be played using VLC media player
* http://www.videolan.org
*
* Requires TeamTalk version 5.2.0.4730.
* @see TT_SetUserMediaStorageDir()
* @see TT_StartRecordingMuxedAudioFile() */
AFF_CHANNELCODEC_FORMAT = 1,
/** @brief Store in PCM 16-bit wave format. */
AFF_WAVE_FORMAT = 2,
/** @brief Store in MP3-format. */
AFF_MP3_16KBIT_FORMAT = 3,
/** @see #AFF_MP3_16KBIT_FORMAT */
AFF_MP3_32KBIT_FORMAT = 4,
/** @see #AFF_MP3_16KBIT_FORMAT */
AFF_MP3_64KBIT_FORMAT = 5,
/** @see #AFF_MP3_16KBIT_FORMAT */
AFF_MP3_128KBIT_FORMAT = 6,
/** @see #AFF_MP3_16KBIT_FORMAT */
AFF_MP3_256KBIT_FORMAT = 7,
/** @see #AFF_MP3_16KBIT_FORMAT */
AFF_MP3_320KBIT_FORMAT = 8,
} AudioFileFormat;
/**
* @brief Struct describing the audio format used by a
* media file.
*
* @see TT_GetMediaFileInfo()
* @see MediaFileInfo
*/
typedef struct AudioFormat
{
/** @brief The audio file format, e.g. wave or MP3. */
AudioFileFormat nAudioFmt;
/** @brief Sample rate of media file. */
INT32 nSampleRate;
/** @brief Channels used by media file, mono = 1, stereo = 2. */
INT32 nChannels;
} AudioFormat;
/** @} */
/** @addtogroup videocapture
* @{ */
/**
* @brief The picture format used by a capture device.
*
* @see VideoFormat
* @see VideoCaptureDevice */
typedef enum FourCC
{
/** @brief Internal use to denote no supported formats. */
FOURCC_NONE = 0,
/** @brief Prefered image format with the lowest bandwidth
* usage. A 640x480 pixel image takes up 460.800 bytes. */
FOURCC_I420 = 100,
/** @brief Image format where a 640x480 pixel images takes up
* 614.400 bytes. */
FOURCC_YUY2 = 101,
/** @brief The image format with the highest bandwidth
* usage. A 640x480 pixel images takes up 1.228.880 bytes. */
FOURCC_RGB32 = 102
} FourCC;
/**
* @brief A struct containing the properties of a video capture
* format.
*
* A struct for holding a supported video capture format by a
* #VideoCaptureDevice. */
typedef struct VideoFormat
{
/** @brief The width in pixels of the video device supported
* video format. */
INT32 nWidth;
/** @brief The height in pixels of the video device supported
* video format. */
INT32 nHeight;
/** @brief The numerator of the video capture device's video
* format. Divinding @a nFPS_Numerator with @a
* nFPS_Denominator gives the frame-rate. */
INT32 nFPS_Numerator;
/** @brief The denominator of the video capture device's video
* format. Divinding @a nFPS_Numerator with @a
* nFPS_Denominator gives the frame-rate.*/
INT32 nFPS_Denominator;
/** @brief Picture format for capturing. */
FourCC picFourCC;
} VideoFormat;
/**
* @brief A RGB32 image where the pixels can be accessed directly
* in an allocated @a frameBuffer.
*
* Use TT_AcquireUserVideoCaptureFrame() to acquire a user's image and
* remember to call TT_ReleaseUserVideoCaptureFrame() when the image has
* been processed so TeamTalk can release its resources. */
typedef struct VideoFrame
{
/** @brief The width in pixels of the image contained in @a
* frameBuffer. */
INT32 nWidth;
/** @brief The height in pixels of the image contained in @a
* imageBuffer. */
INT32 nHeight;
/** @brief A unique identifier for the frames which are part of the
* same video sequence. If the stream ID changes it means the
* frames which are being received are part of a new video sequence
* and @a nWidth and @a nHeight may have changed. The @a nStreamID
* will always be a positive integer value.*/
INT32 nStreamID;
/** @brief Whether the image acquired is a key-frame. If it is
* not a key-frame and there has been packet loss or a
* key-frame has not been acquired prior then the image may
* look blurred. */
TTBOOL bKeyFrame;
/** @brief A buffer allocated internally by client instance. */
VOID* frameBuffer;
/** @brief The size in bytes of the buffer allocate in @a
* frameBuffer. */
INT32 nFrameBufferSize;
} VideoFrame;
/**
* @brief A struct containing the properties of a video capture
* device.
*
* The information retrieved from the video capture device is used
* to initialize the video capture device using the
* #TT_InitVideoCaptureDevice function.
*
* @see TT_GetVideoCaptureDevices */
typedef struct VideoCaptureDevice
{
/** @brief A string identifying the device. */
TTCHAR szDeviceID[TT_STRLEN];
/** @brief The name of the capture device. */
TTCHAR szDeviceName[TT_STRLEN];
/** @brief The name of the API used to capture video.
*
* The following video capture APIs are supported:
* - AVFoundation (Mac OS)
* - DirectShow (Windows)
* - V4L2 (Linux)
*
* Mac OS's QTkit video capture API was removed in TeamTalk
* 5.2 because Apple's AppStore will reject apps which have
* dependencies to it.
*
* V4L support was removed in TeamTalk 5.2. */
TTCHAR szCaptureAPI[TT_STRLEN];
/** @brief The supported capture formats. */
VideoFormat videoFormats[TT_VIDEOFORMATS_MAX];
/** @brief The number of capture formats available in @a
* videoFormats array. */
INT32 nVideoFormatsCount;
} VideoCaptureDevice;
/** @} */
/** @addtogroup desktopshare
* @{ */
/**
* @brief The bitmap format used for a #DesktopWindow. */
typedef enum BitmapFormat
{
/** @brief Used to denote nothing selected. */
BMP_NONE = 0,
/** @brief The bitmap is a 256-colored bitmap requiring a
* palette. The default 256 colored palette is the Netscape
* browser-safe palette. Use TT_Palette_GetColorTable() to
* access or change the palette. The maximum size of a
* 8-bit bitmap is 4095 blocks of 120 by 34 pixels. */
BMP_RGB8_PALETTE = 1,
/** @brief The bitmap is a 16-bit colored bitmap. The maximum
* pixels. */
BMP_RGB16_555 = 2,
/** @brief The bitmap is a 24-bit colored bitmap. The maximum
* size of a 24-bit bitmap is 4095 blocks of 85 by 16
* pixels. */
BMP_RGB24 = 3,
/** @brief The bitmap is a 32-bit colored bitmap. The maximum
* size of a 32-bit bitmap is 4095 blocks of 51 by 20
* pixels. */
BMP_RGB32 = 4
} BitmapFormat;
/** @brief The protocols supported for transferring a
* #DesktopWindow.
*
* So far only one, UDP-based, protocol is supported. */
typedef enum DesktopProtocol
{
/** @brief Desktop protocol based on ZLIB for image
* compression and UDP for data transmission. */
DESKTOPPROTOCOL_ZLIB_1 = 1
} DesktopProtocol;
/**
* @brief A struct containing the properties of a shared desktop window.
*
* The desktop window is a description of the bitmap which can be retrieved using
* TT_AcquireUserDesktopWindow() or the bitmap which should be transmitted using
* TT_SendDesktopWindow(). */
typedef struct DesktopWindow
{
/** @brief The width in pixels of the bitmap. */
INT32 nWidth;
/** @brief The height in pixels of the bitmap. */
INT32 nHeight;
/** @brief The format of the bitmap. */
BitmapFormat bmpFormat;
/** @brief The number of bytes for each scan-line in the
* bitmap. Zero means 4-byte aligned. */
INT32 nBytesPerLine;
/** @brief The ID of the session which the bitmap belongs
* to. If the session ID changes it means the user has started
* a new session. This e.g. happens if the desktop session has
* been closed and restart or if the bitmap has been
* resized. Set @c nSessionID to 0 if the desktop window is
* used with TT_SendDesktopWindow(). */
INT32 nSessionID;
/** @brief The desktop protocol used for transmitting the desktop window. */
DesktopProtocol nProtocol;
/** @brief A buffer pointing to the bitmap data (often refered to as Scan0). */
VOID* frameBuffer;
/** @brief The size in bytes of the buffer allocate in @a
* frameBuffer. Typically @c nBytesPerLine * @c nHeight. */
INT32 nFrameBufferSize;
} DesktopWindow;