ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
session_host_callbacks_t Struct Reference

Callback function prototypes for session host events. More...

#include <src/common/session/host.h>

Data Fields

void(* on_client_join )(session_host_t *h, uint32_t client_id, void *user_data)
 Called when a client joins the session.
 
void(* on_client_leave )(session_host_t *h, uint32_t client_id, void *user_data)
 Called when a client leaves the session.
 
void(* on_frame_received )(session_host_t *h, uint32_t client_id, const image_t *frame, void *user_data)
 Called when video frame received from a client.
 
void(* on_audio_received )(session_host_t *h, uint32_t client_id, const float *samples, size_t count, void *user_data)
 Called when audio samples received from a client.
 
void(* on_error )(session_host_t *h, asciichat_error_t error, const char *message, void *user_data)
 Called when an error occurs.
 

Detailed Description

Callback function prototypes for session host events.

Definition at line 104 of file host.h.

Field Documentation

◆ on_audio_received

void(* session_host_callbacks_t::on_audio_received) (session_host_t *h, uint32_t client_id, const float *samples, size_t count, void *user_data)

Called when audio samples received from a client.

Parameters
hHost handle
client_idSource client's ID
samplesAudio sample buffer (float format)
countNumber of samples
user_dataUser-provided context pointer

Definition at line 138 of file host.h.

◆ on_client_join

void(* session_host_callbacks_t::on_client_join) (session_host_t *h, uint32_t client_id, void *user_data)

Called when a client joins the session.

Parameters
hHost handle
client_idNew client's ID
user_dataUser-provided context pointer

Definition at line 111 of file host.h.

Referenced by session_host_add_client(), and session_host_add_memory_participant().

◆ on_client_leave

void(* session_host_callbacks_t::on_client_leave) (session_host_t *h, uint32_t client_id, void *user_data)

Called when a client leaves the session.

Parameters
hHost handle
client_idDeparting client's ID
user_dataUser-provided context pointer

Definition at line 119 of file host.h.

Referenced by session_host_remove_client(), and session_host_stop().

◆ on_error

void(* session_host_callbacks_t::on_error) (session_host_t *h, asciichat_error_t error, const char *message, void *user_data)

Called when an error occurs.

Parameters
hHost handle
errorError code
messageError message
user_dataUser-provided context pointer

Definition at line 147 of file host.h.

Referenced by session_host_start().

◆ on_frame_received

void(* session_host_callbacks_t::on_frame_received) (session_host_t *h, uint32_t client_id, const image_t *frame, void *user_data)

Called when video frame received from a client.

Parameters
hHost handle
client_idSource client's ID
frameVideo frame image
user_dataUser-provided context pointer

Definition at line 128 of file host.h.


The documentation for this struct was generated from the following file: