rtc_write_sample → the SDK packetizes and sends.
Standard flow:
rtc_create_local_track
NULL on failure.
Whether the track is audio or video is determined by the codec; you don’t need to specify it separately.
rtc_destroy_local_track
rtc_unpublish_local_track before it’s destroyed.
Starting with 0.0.11, it first removes the keyframe request callback and waits for any running keyframe callback to return before returning; after that you can safely free the context passed to rtc_set_keyframe_request_callback. In 0.0.10 and earlier, the keyframe callback may still fire after the track is destroyed.
rtc_publish_local_track
Publish options
rtc_publish_options_t
If
props fails to parse, the SDK only logs a warning and continues publishing as if there were no custom properties; it doesn’t fail the publish.rtc_unpublish_local_track
rtc_publish_mcu_video_track / rtc_publish_mcu_audio_track
Publishes the channel-level composite stream; see Composite stream (program).rtc_write_sample
Compute
samples from each codec’s clock rate:
Returns
The SDK copies the data you pass in, so you can reuse or free the
data buffer as soon as the call returns.rtc_set_keyframe_request_callback
rtc_write_sample.
Complete example
The C interface doesn’t support publishing multi-layer simulcast streams—server-side scenarios (recording / MCU / AI agents) almost never need to publish multiple layers. Multi-layer switching on the subscriber side is done automatically by the SDK with no configuration. If you do need to publish multiple layers, contact us.