rtc_switch_layer) return an error. The engine is determined by the channel configuration sent down by the server, so your code doesn’t need to check it—just make sure it still works without these callbacks.
The three features map to three separate strongly typed callbacks, in the same style as track_event / track_sample, so there’s no JSON to parse on the C side.
Layer switching (simulcast)
When the publisher pushes a multi-layer simulcast stream, layer switching on the subscriber side is fully automatic: the SDK registers the available layers as candidates, and the SFU switches between them based on bandwidth estimation (BWE). You don’t need to configure anything; usually you only listen for the switching results.Layer switched callback
reason values:
Which layer is currently in use? The subscription handle (the
track_id in sub_key) stays stable for the whole subscription, but the layer actually in use is switched dynamically. The to_track_id you get from layer_switched is the current layer; if you need it, cache a sub_key → current layer mapping yourself.rtc_switch_layer
Returns:
RTC_OK (request sent) / RTC_INVALID_PARAM (invalid handle or a parameter is NULL) / RTC_NOT_CONNECTED (not joined) / RTC_ERROR (rejected by the engine).
A successful return only means the request was sent; the switch to the target layer is complete when the
layer_switched callback fires.This SDK only supports multi-layer switching on the subscriber side; it doesn’t support publishing multi-layer simulcast streams.Network quality
Periodic report callback
The SFU periodically (typically at 1 Hz) reports uplink and downlink quality.rtc_get_connection_quality
out is provided by the caller; the SDK fills in the fields directly, and nothing needs to be freed.
Returns
Active speaker
level in descending order, so you can simply overwrite the whole UI without merging deltas yourself. When no one is speaking, speakers_count = 0 and speakers = NULL.