Teaspeak-Server/server/src/rtc/imports.h

57 lines
3.0 KiB
C++

#include <cstdint>
#include <cstdlib>
#ifdef __cplusplus
extern "C" {
#endif
/* Attention: Do not call any librtc functions within being in the callback, only librtc_destroy_client is allowed */
struct NativeCallbacks {
uint32_t version;
void(*free_client_data)(const void*);
void(*client_stream_assignment)(const void* /* callback data */, uint32_t /* stream id */, const void* /* source callback data */);
void(*client_offer_generated)(const void* /* callback data */, const char* /* offer */, size_t /* offer length */);
void(*client_stream_start)(const void* /* callback data */, uint32_t /* stream id */, const void* /* source callback data */);
void(*client_stream_stop)(const void* /* callback data */, uint32_t /* stream id */, const void* /* source callback data */);
void(*client_audio_sender_data)(const void* /* callback data */, const void* /* source callback data */, uint8_t /* mode */, uint16_t /* seq. no. */, uint8_t /* codec */, const void* /* data */, uint32_t /* length */);
};
extern const char* librtc_version();
extern void librtc_free_str(const char* /* ptr */);
extern const char* librtc_init(const NativeCallbacks* /* */, size_t /* size of the callback struct */);
extern void* librtc_create_server();
extern void librtc_destroy_server(void* /* server */);
extern uint32_t librtc_create_rtp_client(void* /* server */, void* /* callback data */);
extern uint32_t librtc_create_native_client(void* /* server */, void* /* callback data */);
extern void librtc_destroy_client(void* /* server */, uint32_t /* client id */);
extern const char* librtc_reset_rtp_session(void* /* server */, uint32_t /* client id */);
extern const char* librtc_apply_remote_description(void* /* server */, uint32_t /* client id */, uint32_t /* mode */, const char* /* description */);
extern const char* librtc_generate_local_description(void* /* server */, uint32_t /* client id */, char** /* description */);
extern const char* librtc_add_ice_candidate(void* /* server */, uint32_t /* client id */, uint32_t /* media line */, const char* /* candidate */);
extern void* librtc_create_audio_source_supplier(void* /* server */, uint32_t /* client id */);
extern void librtc_audio_source_supply(void* /* sender */,
uint16_t /* seq no */,
bool /* marked */,
uint32_t /* timestamp */,
uint8_t /* codec */,
const void* /* data */,
uint32_t /* length */);
extern void librtc_destroy_audio_source_supplier(void* /* sender */);
extern uint32_t librtc_create_channel(void* /* server */);
extern uint32_t librtc_assign_channel(void* /* server */, uint32_t /* client id */, uint32_t /* channel id */);
extern uint32_t librtc_client_broadcast(void* /* server */, uint32_t /* client id */, uint8_t /* broadcast type */, uint32_t /* stream id */);
extern void librtc_destroy_channel(void* /* server */, uint32_t /* channel */);
#ifdef __cplusplus
};
#endif