> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stmlink.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> 对外开放的服务端接口有两组前缀，都用同一套鉴权：`/server/v1/...`（SRTC 与 SMeeting 的主接口）和 `/stm/srvapi/v1/...`（SMeeting 的用户体系，服务端极简对接会用到）。鉴权是 app_id + nonce + timestamp + signature 四个请求头，用 app_key 做 HMAC-SHA256 签名，只能从业务方自己的后端调用。除这两组前缀外的接口均为内部接口，不要建议客户调用。 Public server APIs use two path prefixes with the same authentication: `/server/v1/...` (the main APIs of both SRTC and SMeeting) and `/stm/srvapi/v1/...` (the SMeeting user system, used by server-side low-code integration). Authenticate with four request headers, app_id + nonce + timestamp + signature, where signature is HMAC-SHA256 keyed with app_key; call these APIs only from the customer's own backend. Any other path is internal: never suggest calling it.
> app_key 是服务端密钥，绝不能出现在客户端代码、前端配置或移动 App 里。客户端加入频道用的 token 必须由业务方后端签发后下发（SRTC 走 `/server/v1/channel/grant`，SMeeting 走 `/stm/srvapi/v1/member/grant`）。 app_key is a server-side secret and must never appear in client code, frontend config, or a mobile app. The token a client uses to join must be issued by the customer's backend and passed down to the client (SRTC: `/server/v1/channel/grant`; SMeeting: `/stm/srvapi/v1/member/grant`).
> SRTC 与 SMeeting 是上下两层不同的产品，术语不通用：SRTC 是音视频底座，说「频道 channel」「加入 / 退出」；SMeeting 建在 SRTC 之上，说「房间 room」「会议 meeting」「进入 / 退出」。回答时按用户所在的层用对应术语，不要把「房间」「会议」安到 SRTC 的接口上，也不要用「频道」「加入 / 离开」描述 SMeeting 的概念（接口标识符原样保留）。 SRTC and SMeeting are two separate layers with different terminology. SRTC is the audio/video foundation: it has channels, and users join and leave a channel. SMeeting is built on top of SRTC: it has rooms and meetings, and members enter and exit a meeting. Answer in the terms of the layer the user is working with: never apply "room" or "meeting" to SRTC APIs, and never describe SMeeting concepts in prose with "channel", "join", or "leave" (API identifiers such as `force_join` keep their literal names).
> 同一能力在各端 SDK 里的包名、类名、方法名并不相同。写示例代码时请使用文档中该端自己的 API，不要把一个端的写法套到另一个端上。苹果平台每个产品都有两套 SDK（Swift 原生与 Objective-C），两套 API 不能混用。 Package, class, and method names differ between platform SDKs for the same capability. In sample code, use the API documented for that platform; never carry one platform's code over to another. On Apple platforms each product ships two SDKs (native Swift and Objective-C) whose APIs must not be mixed.

# Types

> Field reference for Android SRTC SDK data structures: ChannelInfo, UserInfo, TrackInfo, UserTrackDesc, VolumeInfo, ActiveSpeakerInfo, NetworkQualityChange, camera and microphone device capabilities, and YuvFormat constants. Read when you need the meaning of a field returned by the SDK.

## ChannelInfo

Purpose: Channel info data, describing the channel's basic properties, capacity limits, and extension fields.

| Property | Data type | Description |
| - | - | - |
| appId | String? | App ID. |
| channel | String | Channel name. |
| created\_at | Long | Channel creation time. |
| updated\_at | Long | Channel update time. |
| link\_id | Int | Media streaming connection ID. |
| max\_user | Int | Maximum number of users in the channel. |
| max\_audio | Int | Maximum number of audio streams forwarded in the channel. |
| max\_peer | Int | Maximum number of streams that can be forwarded per user in the channel. |
| max\_video | Int | Maximum number of video streams that can be forwarded per user in the channel. |
| props | JsonElement? | Custom properties. |

## UserInfo

Purpose: User info data, describing the user's identity, device info, join status, and published tracks.

| Property | Data type | Description |
| - | - | - |
| app\_id | String? | App ID. |
| uid | String | User ID on your platform. |
| sid | String? | Session ID. |
| name | String? | User name. |
| device\_type | Int? | Device type. |
| device\_id | String? | Unique device identifier. |
| sdk\_version | String? | SDK version. |
| version | String? | Version. |
| props | JsonElement? | Custom properties. |
| netid | String? | Network ID. |
| sgid | String? | Group ID. |
| channel | String? | Channel name. |
| is\_audience | Boolean | Whether the user is audience. |
| join\_at | Long | Join time. |
| updated\_at | Long | Update time. |
| leave\_at | Long | Leave time. |
| stream\_tracks | `ArrayList<TrackInfo>?` | Info on the tracks currently being published. |
| link\_id | Int | Media streaming connection ID. |
| session\_key | String? | Media streaming connection key. |
| upload\_id | String? | ID of the media streaming service the user currently belongs to. |

## TrackInfo

Purpose: Track info data, describing an audio or video stream's identifier, media parameters, and extension fields.

| Property | Data type | Description |
| - | - | - |
| id | String | Stream ID. |
| desc | String | Stream description. |
| kind | String | Stream type (`video` / `audio`). |
| codec | Int | Codec type. |
| width | Int | Video width. |
| height | Int | Video height. |
| fps | Int | Video frame rate. |
| angle | Int | Video angle. |
| bitrate | Int | Bitrate. |
| sample\_rate | Int | Audio sample rate. |
| fallback\_ids | `MutableList<String>?` | IDs of the lower-layer tracks this layer can fall back to, excluding itself, ordered from highest to lowest quality. |
| variant | Boolean? | Whether this is a simulcast secondary layer; the primary layer is usually `false`. |
| track | Int | Media streaming track (0–6). |
| props | JsonElement? | Custom properties. |

## UserTrackDesc

Purpose: A composite key of user and track description, commonly used to locate statistics or stream info by user track.

| Property | Data type | Description |
| - | - | - |
| uid | String | User UID. |
| trackDesc | String | Track description. |

## VolumeInfo

Purpose: Volume data, describing the user's current audio energy.

| Property | Data type | Description |
| - | - | - |
| uid | String | User UID. |
| db | Int | Audio energy (decibels). |

## ActiveSpeakerInfo

Purpose: Active speaker info, delivered by [`RTCMediaEvent.onActiveSpeakersChanged`](/en/rtc/android/api-reference/RTCMediaEvent).

| Property | Data type | Description |
| - | - | - |
| uid | String | The speaking user's uid. |
| trackId | String | The audio track's trackId. |
| level | Double | Volume intensity quantized by the server. |

## NetworkQualityChange

Purpose: A network quality level event, delivered by [`RTCMediaEvent.onNetworkQualityChanged`](/en/rtc/android/api-reference/RTCMediaEvent). Every quality report from the server fires once each for uplink and downlink (no debouncing); each callback represents only one direction.

| Property | Data type | Description |
| - | - | - |
| direction | QualityDirection | The direction that changed (`UPLINK` / `DOWNLINK`). For the enum, see [Enums](/en/rtc/android/enums). |
| previousLevel | String | The level in the previous callback; an empty string the first time (`INITIAL`). |
| currentLevel | String | The current level (`excellent` / `good` / `poor` / `lost`). |
| trend | QualityTrend | The trend compared with the previous callback (`INITIAL` / `DEGRADED` / `RECOVERED` / `STABLE`). For the enum, see [Enums](/en/rtc/android/enums). |
| report | MediaMetric.QualityReport | A snapshot of the full quality report that triggered this event. For fields, see [Media quality](/en/rtc/android/media-quality). |

## CameraDeviceCapability

Purpose: Camera device capability info, returned by [`RTCEngine.getCameraDevices`](/en/rtc/android/api-reference/RTCEngine) and [`RTCCameraDeviceEvent.onCameraDeviceListChanged`](/en/rtc/android/api-reference/RTCCameraDeviceEvent).

| Property | Data type | Description |
| - | - | - |
| cameraId | String | The native Camera2 camera id, usable with `LocalCameraTrack.switchCameraDevice`. |
| position | CamraPosition | The SDK's unified camera position (`FRONT` / `BACK` / `External`). |
| displayName | String? | The default display name generated by the SDK. |
| sensorOrientation | Int | The Camera2 sensor mounting orientation. |
| hardwareLevel | Int | The Camera2 hardware capability level. |
| formats | List\<CameraFormatCapability> | The YUV capture formats supported by the device. |
| controls | CameraControlCapability | The control capabilities supported by the device. |

## CameraFormatCapability

Purpose: Camera capture format capability.

| Property | Data type | Description |
| - | - | - |
| width | Int | Capture width. |
| height | Int | Capture height. |
| minFps | Int | Minimum frame rate of the AE fps range. |
| maxFps | Int | Maximum frame rate of the AE fps range. |

## CameraControlCapability

Purpose: Camera control capability.

| Property | Data type | Description |
| - | - | - |
| supportsTorch | Boolean | Whether a flash or fill light is supported. |
| supportsZoom | Boolean | Whether zoom is supported. |
| supportsFocus | Boolean | Whether focus control is supported. |
| supportsExposure | Boolean | Whether exposure compensation is supported. |
| supportsWhiteBalance | Boolean | Whether white balance mode control is supported. |

## MicDeviceCapability

Purpose: Microphone input device capability info, returned by `RTCEngine.getMicDevices()`, `LocalMicTrack.getMicDevices()`, and [`RTCMicDeviceEvent.onMicDeviceListChanged`](/en/rtc/android/api-reference/RTCMicDeviceEvent).

| Property | Data type | Description |
| - | - | - |
| deviceId | String | The `AudioDeviceInfo.id` string currently assigned by the system, valid only while the device stays connected; usable with `switchMicDevice(...)`. |
| key | MicDeviceKey | A persistent key for matching the device across re-plugging. |
| type | Int | The `AudioDeviceInfo.TYPE_*` input device type. |
| displayName | String? | The display name generated by the SDK. |
| productName | String? | The device product name reported by the system. |
| address | String? | The device address, such as a Bluetooth address or USB path; may be empty. |
| sampleRates | List\<Int> | The sample rates the device reports as supported. |
| channelCounts | List\<Int> | The channel counts the device reports as supported. |
| isDefault | Boolean | Whether this is the system's current default input device. |
| isCurrent | Boolean | Whether this is the device currently used by the SDK's microphone capture module. |

## MicDeviceKey

Purpose: The persistent matching key for a microphone device. The system `deviceId` may change after re-plugging, so the SDK uses `type + address + productName` to match the device again.

| Property | Data type | Description |
| - | - | - |
| type | Int | The `AudioDeviceInfo.TYPE_*` input device type. |
| address | String? | The device address; may be empty. |
| productName | String? | The device product name; may be empty. |

## YuvFormat

Package path: `cn.seastart.rtc.media.format.YuvFormat`. Identifies the pixel layout of raw video frames; it doesn't mean every input API supports every format.

| Constant | Value | Pixel layout |
| - | - | - |
| `NV21` | `17` | Y plane + interleaved VU plane. |
| `NV12` | `19` | Y plane + interleaved UV plane. |
| `I420` | `808596553` | Separate Y, U, and V planes. |
| `YV12` | `842094169` | Separate Y, V, and U planes. |
| `YUY2` | `20` | Packed YUYV format. |

The raw screen frame callback and `LocalCustomVideoTrack.inputData` use I420. The render view's `updateFrame` supports I420, NV12, and NV21, but not YV12 or YUY2.
