add docs folder.

Signed-off-by: chaoq <chaoq@gxtech.ltd>
This commit is contained in:
2025-09-17 15:55:45 +08:00
parent 0ca9d5011f
commit 202ebef35d
8 changed files with 4991 additions and 0 deletions

118
docs/livekit-structs.md Normal file
View File

@@ -0,0 +1,118 @@
结构体定义
## VideoLayer
```json
{
"quality": "int", //0: "LOW",1: "MEDIUM",2: "HIGH",3: "OFF",
"width": "uint32", // 视频宽度
"height":"uint32", //视频高度
"bitrate": "uint32", //target bitrate in bit per second (bps), server will measure actual
"ssrc": "uint32", //
}
```
## ParticipantPermission
```json
{
"can_subscribe": "boolean",// 是否可订阅
"can_publish":"boolean",// 是否可以发布
"can_publish_data":"boolean",//是否可以发数据
"can_publish_sources":"[]int32", // 可发布的源类型可用的值有0: "UNKNOWN",1: "CAMERA",2: "MICROPHONE",3: "SCREEN_SHARE",4: "SCREEN_SHARE_AUDIO",
"hidden":"boolean",//是否可以隐藏
"can_update_metadata":"boolean",//是否可以更新元数据
"can_subscribe_metrics":"boolean",//是否可以订阅指标
}
```
## SimulcastCodecInfo
```json
{
"mime_type":"string", //mime type of codec
"mid":"string", //
"cid":"string", //
"layers": "[]VideoLayer"
}
```
## TimedVersion
```json
{
"unix_micro":"int64", // Unix时间戳
"ticks":"int32"
}
```
## TrackInfo
流信息source是track的输入Meida Stream是track的集合
```json
{
"sid": "string", // 轨道的唯一标识符
"type": "string", // 轨道类型
"muted": "boolean", // 是否静音
"name": "string", // 轨道名称
"width": "uint32", // 视频宽度
"height":"uint32", //视频高度
"simulcast":"boolean", //true if track is simulcasted
"disable_dtx": "boolean", //true if DTX (Discontinuous Transmission) is disabled for audio
"source": "int32",// 源类型0: "UNKNOWN",1: "CAMERA",2: "MICROPHONE",3: "SCREEN_SHARE",4: "SCREEN_SHARE_AUDIO",
"layers": "[]VideoLayer",
"mime_type":"string", //mime type of codec
"mid":"string", //
"codecs": "[]SimulcastCodecInfo" , //SimulcastCodecInfo列表
"stereo": "boolean",
"disableRed":"boolean",
"encryption":"int32",//加密类型0: "NONE",1: "GCM",2: "CUSTOM",
"stream":"string",// 流名称
"version":"TimedVersion",
"audio_features":"int32",//音频功能0: "TF_STEREO",1: "TF_NO_DTX",2: "TF_AUTO_GAIN_CONTROL",3: "TF_ECHO_CANCELLATION",4: "TF_NOISE_SUPPRESSION",5: "TF_ENHANCED_NOISE_CANCELLATION"
}
```
## ParticipantInfo
用户信息
```json
{
"sid": "string", // 参与者的唯一标识符
"identity": "string", // 参与者的ID
"state": "int32", // 参与者的状态0: "JOINING",1: "JOINED",2: "ACTIVE",3: "DISCONNECTED",
"tracks": "[]TrackInfo", //
"metadata": "string", // 元数据
"joined_at": "number", // 加入时间
"is_speaking": "boolean", // 是否正在讲话
"permission": "ParticipantPermission",// 权限
"is_publisher":"boolean", // 是否是发布者
"name": "string", // 名称
"version": "string", // 版本
"region": "string", // 区域
"kind": "string" // 类型
}
```
## Room
房间信息
```json
{
"sid": "string", // 房间的唯一标识符
"name": "string", // 房间的名称
"empty_timeout": "uint32", // 空房间关闭前的持续时间(以秒为单位)
"departure_timeout": "uint32", // 参与者被认为离开的持续时间(以秒为单位)
"max_participants": "uint32", // 房间允许的最大参与者数量
"creation_time": "int64", // 房间创建时的时间戳
"turn_password": "string", // 用于TURN服务器认证的密码
"enabled_codecs": "[]Codec", // 房间启用的编解码器列表
"metadata": "string", // 房间的附加信息
"num_participants": "uint32", // 房间当前的参与者数量
"num_publishers": "uint32", // 房间当前的发布者数量
"active_recording": "boolean", // 房间是否正在录制
"version": "TimedVersion" // 房间的版本信息
}
```