ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
session_host_callbacks_t Struct Reference

Snapshot of the address, identity, activity, and connection time for one host client. 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

Snapshot of the address, identity, activity, and connection time for one host client.

Host-side event hooks for joins, departures, media, and errors.

Definition at line 108 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 142 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 115 of file host.h.

◆ 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 123 of file host.h.

◆ 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 151 of file host.h.

◆ 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 132 of file host.h.


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