Since version 8.0, TRTC has provided new APIs for C++ in addition to the original ones. They can be used on Windows, iOS, macOS, and Android.
See the following documents for how to integrate the C++ APIs.
Note:
- The C++ APIs are currently available in LiteAV_TRTC only.
- On Windows, the TRTC header file automatically adopts the "trtc" namespace. You do not need to specify the namespace.
API | Description |
---|---|
getTRTCShareInstance | Creates a TRTCCloud instance (singleton). |
destroyTRTCShareInstance | Terminates a TRTCCloud instance (singleton). |
addCallback | Sets TRTC event callbacks. |
removeCallback | Removes TRTC event callbacks. |
API | Description |
---|---|
enterRoom | Enters a room. |
exitRoom | Exits a room. |
switchRole | Switches roles. |
switchRoom | Switches rooms. |
connectOtherRoom | Requests a cross-room call. |
disconnectOtherRoom | Exits a cross-room call. |
setDefaultStreamRecvMode | Sets the subscription mode. It must be set before room entry to take effect. |
createSubCloud | Creates a sub-room instance (for concurrent playback from multiple rooms). |
destroySubCloud | Terminates a sub-room instance. |
API | Description |
---|---|
startPublishing | Starts publishing audio/video streams to Tencent Cloud’s live streaming CDN. |
stopPublishing | Stops publishing audio/video streams to Tencent Cloud’s live streaming CDN. |
startPublishCDNStream | Starts publishing audio/video streams to a non-Tencent Cloud CDN. |
stopPublishCDNStream | Stops publishing audio/video streams to a non-Tencent Cloud CDN. |
setMixTranscodingConfig | Sets layout and transcoding parameters for On-Cloud MixTranscoding. |
API | Description |
---|---|
startLocalPreview | Enables local camera preview (mobile). |
startLocalPreview | Enables local camera preview (desktop). |
updateLocalView | Updates local camera preview. |
stopLocalPreview | Disables local camera preview. |
muteLocalVideo | Pauses/Resumes publishing the local video stream. |
startRemoteView | Subscribes to a remote user’s video stream and binds a video rendering control. |
updateRemoteView | Updates a remote user’s video rendering control. |
stopRemoteView | Unsubscribes from a remote user’s video stream and unbinds the rendering control. |
stopAllRemoteView | Unsubscribes from all remote users’ video streams and unbinds all rendering controls. |
muteRemoteVideoStream | Pauses/Resumes receiving a remote user’s video stream. |
muteAllRemoteVideoStreams | Pauses/Resumes receiving all remote users’ video streams. |
setVideoEncoderParam | Sets video encoder parameters. |
setNetworkQosParam | Sets video preference. |
setLocalRenderParams | Sets rendering parameters for the local image. |
setRemoteRenderParams | Sets rendering parameters for a remote image. |
setVideoEncoderRotation | Sets the rotation of encoded video images. |
setVideoEncoderMirror | Sets the mirror mode of encoded images. |
enableSmallVideoStream | Enables/Disables the dual-channel (big and small images) encoding mode. |
setRemoteVideoStreamType | Switches between the small and big images of a remote user. |
snapshotVideo | Takes a video screenshot. |
API | Description |
---|---|
startLocalAudio | Starts local audio capturing and publishing. |
stopLocalAudio | Stops local audio capturing and publishing. |
muteLocalAudio | Pauses/Resumes publishing the local audio stream. |
muteRemoteAudio | Pauses/Resumes playing the audio stream of a remote user. |
muteAllRemoteAudio | Pauses/Resumes playing the audio streams of all remote users. |
setRemoteAudioVolume | Sets the playback volume of a remote user. |
setAudioCaptureVolume | Sets the local audio capturing volume. |
getAudioCaptureVolume | Gets the local audio capturing volume. |
setAudioPlayoutVolume | Sets the playback volume of remote audio. |
getAudioPlayoutVolume | Gets the playback volume of remote audio. |
enableAudioVolumeEvaluation | Enables the volume reminder. |
startAudioRecording | Starts audio recording. |
stopAudioRecording | Stops audio recording. |
startLocalRecording | Starts local media recording. |
stopLocalRecording | Stops local media recording. |
setRemoteAudioParallelParams | Configures policy for the playback of the audio of multiple remote speakers. |
API | Description |
---|---|
getDeviceManager | Gets the device management class TXDeviceManager . |
API | Description |
---|---|
setBeautyStyle | Sets the beauty, skin brightening, and rosy skin filters. |
setWaterMark | Adds watermarks. |
API | Description |
---|---|
getAudioEffectManager | Gets the audio effect management class TXAudioEffectManager . |
startSystemAudioLoopback | Starts system audio capturing (for desktop systems only). |
stopSystemAudioLoopback | Stops system audio capturing (for desktop systems only). |
setSystemAudioLoopbackVolume | Sets system audio capturing volume. |
API | Description |
---|---|
startScreenCapture | Starts desktop screen sharing (for desktop systems only). |
stopScreenCapture | Stops screen sharing. |
pauseScreenCapture | Pauses screen sharing. |
resumeScreenCapture | Resumes screen sharing. |
getScreenCaptureSources | Enumerates shareable screens and windows (for desktop systems only). |
selectScreenCaptureTarget | Selects a screen or window to share (for desktop systems only). |
setSubStreamEncoderParam | Sets encoding parameters for screen sharing (substream video). This API works on both desktop and mobile OS. |
setSubStreamMixVolume | Sets audio mixing volume for screen sharing (for desktop systems only). |
addExcludedShareWindow | Adds a window to the exclusion list of screen sharing (for desktop systems only). |
removeExcludedShareWindow | Removes a window from the exclusion list of screen sharing (for desktop systems only). |
removeAllExcludedShareWindow | Removes all windows from the exclusion list of screen sharing (for desktop systems only). |
addIncludedShareWindow | Adds a window to the screen sharing list (for desktop systems only). |
removeIncludedShareWindow | Removes a window from the screen sharing list (for desktop systems only). |
removeAllIncludedShareWindow | Removes all windows from the screen sharing list (for desktop systems only). |
API | Description |
---|---|
enableCustomVideoCapture | Enables/Disables custom video capturing. |
sendCustomVideoData | Sends captured video frames to the SDK. |
enableCustomAudioCapture | Enables/Disables custom audio capturing. |
sendCustomAudioData | Sends captured audio data to the SDK. |
enableMixExternalAudioFrame | Enables/Disables custom audio tracks. |
mixExternalAudioFrame | Mixes a custom audio track into the SDK. |
setMixExternalAudioVolume | Sets the publishing and playback volumes of external audio mixed into the published stream. |
generateCustomPTS | Gets the PTS for custom capturing. |
setLocalVideoProcessCallback | Sets the callback of video data for the application of third-party beauty filters. |
setLocalVideoRenderCallback | Sets the callback of local video data for custom rendering. |
setRemoteVideoRenderCallback | Sets the callback of a remote user’s video data for custom rendering. |
setAudioFrameCallback | Sets the callback of audio data for custom rendering. |
setMixedPlayAudioFrameCallbackFormat | Sets the format of the callback of audio frames played by the system. |
enableCustomAudioRendering | Enables/Disables custom audio rendering. |
getCustomAudioRenderingFrame | Gets playable audio frames. |
API | Description |
---|---|
sendCustomCmdMsg | Sends a custom message to all users in a room via TRTC’s UDP channel. |
sendSEIMsg | Sends a custom message to all users in a room via TRTC’s SEI channel. |
API | Description |
---|---|
startSpeedTest | Starts network speed testing. This API must be called before room entry. |
stopSpeedTest | Stops network speed testing. |
API | Description |
---|---|
getSDKVersion | Gets the SDK version. |
setLogLevel | Sets the log output level. |
setConsoleEnabled | Enables/Disables console log printing. |
setLogCompressEnabled | Enables/Disables local log compression. |
setLogDirPath | Sets the path to save local logs. |
setLogCallback | Sets the log callback. |
showDebugView | Sets whether to display the dashboard. |
callExperimentalAPI | Calls the experimental API. |
API | Description |
---|---|
enableCustomVideoCapture | Enables/Disables custom video capturing. |
sendCustomVideoData | Sends captured video data to the SDK. |
muteLocalVideo | Pauses/Resumes publishing the local video stream. |
muteRemoteVideoStream | Pauses/Resumes receiving a remote user’s video stream. |
startSpeedTest | Starts network speed testing. This API must be called before room entry. |
API | Description |
---|---|
onError | Callback for errors |
onWarning | Callback for warnings |
API | Description |
---|---|
onEnterRoom | Callback of the result of room entry |
onExitRoom | Callback for room exit |
onSwitchRole | Callback for role switching |
onSwitchRoom | Callback for room switching |
onConnectOtherRoom | Callback of the result of requesting a cross-room call |
onDisconnectOtherRoom | Callback of the result of ending a cross-room call |
API | Description |
---|---|
onRemoteUserEnterRoom | Callback for the entry of a user |
onRemoteUserLeaveRoom | Callback for the exit of a user |
onUserVideoAvailable | Callback for publishing/unpublishing the primary-stream video by a remote user |
onUserSubStreamAvailable | Callback for publishing/unpublishing the substream video by a remote user |
onUserAudioAvailable | Callback for publishing/unpublishing audio by a remote user |
onFirstVideoFrame | Callback for rendering the first video frame of the local user or a remote user |
onFirstAudioFrame | Callback for playing the first audio frame of a remote user |
onSendFirstLocalVideoFrame | Callback for sending the first local video frame |
onSendFirstLocalAudioFrame | Callback for sending the first local audio frame |
onRemoteVideoStatusUpdated | Callback for change of the video status of a remote user |
API | Description |
---|---|
onNetworkQuality | Callback of real-time statistics on network quality |
onStatistics | Callback of real-time statistics on technical metrics |
onSpeedTestResult | Callback of network speed testing results |
API | Description |
---|---|
onConnectionLost | Callback for the disconnection of the SDK from the server |
onTryToReconnect | Callback for the SDK trying to reconnect to the server |
onConnectionRecovery | Callback for the reconnection of the SDK to the server |
API | Description |
---|---|
onCameraDidReady | Callback for the camera being ready |
onMicDidReady | Callback for the mic being ready |
onUserVoiceVolume | Callback of volume |
onDeviceChange | Callback for change of the connection status of a local device (for desktop systems only) |
onAudioDeviceCaptureVolumeChanged | Callback for change of the mic’s system audio capturing volume |
onAudioDevicePlayoutVolumeChanged | Callback for change of the system’s playback volume |
onSystemAudioLoopbackError | Callback of whether system audio capturing is enabled successfully (for macOS only) |
onTestMicVolume | Volume callback for mic testing |
onTestSpeakerVolume | Volume callback for speaker testing |
API | Description |
---|---|
onRecvCustomCmdMsg | Callback for receiving a custom message |
onMissCustomCmdMsg | Callback for losing a custom message |
onRecvSEIMsg | Callback for receiving an SEI message |
API | Description |
---|---|
onStartPublishing | Callback for publishing audio/video streams to Tencent Cloud’s live streaming CDN |
onStopPublishing | Callback for stopping publishing audio/video streams to Tencent Cloud’s live streaming CDN |
onStartPublishCDNStream | Callback for publishing audio/video streams to a non-Tencent Cloud CDN |
onStopPublishCDNStream | Callback for stopping publishing audio/video streams to a non-Tencent Cloud CDN |
onSetMixTranscodingConfig | Callback for setting layout and transcoding parameters for On-Cloud MixTranscoding |
API | Description |
---|---|
onScreenCaptureStarted | Callback for starting screen sharing |
onScreenCapturePaused | Callback for pausing screen sharing |
onScreenCaptureResumed | Callback for resuming screen sharing |
onScreenCaptureStoped | Callback for stopping screen sharing |
onScreenCaptureCovered | Callback for the window to share being covered (for Windows only) |
API | Description |
---|---|
onLocalRecordBegin | Callback for starting local recording |
onLocalRecording | Callback of the progress of local recording |
onLocalRecordComplete | Callback for ending local recording |
onSnapshotComplete | Callback for taking a screenshot |
API | Description |
---|---|
onUserEnter | Callback for the entry of an anchor (disused) |
onUserExit | Callback for the exit of an anchor (disused) |
onAudioEffectFinished | Callback for ending an audio effect (disused) |
onPlayBGMBegin | Callback for starting background music (disused) |
onPlayBGMProgress | Callback of the playback progress of background music (disused) |
onPlayBGMComplete | Callback for ending background music (disused) |
onSpeedTest | Callback of server speed testing results. This callback has been disused. |
API | Description |
---|---|
onRenderVideoFrame | Callback of video frames for custom rendering |
onProcessVideoFrame | Callback of video frames for processing by third-party beauty filters |
API | Description |
---|---|
onCapturedRawAudioFrame | Callback of audio data captured by the local mic and pre-processed by the audio module |
onLocalProcessedAudioFrame | Callback of locally captured audio data that is pre-processed by the audio module, added with audio effects, and mixed with background music |
onPlayAudioFrame | Audio data of each remote user before audio mixing |
onMixedPlayAudioFrame | Callback of data mixed from the audio of each user before playback |
API | Description |
---|---|
onLog | Callback for printing local logs |
API | Description |
---|---|
TRTCVideoResolution | Resolution |
TRTCVideoResolutionMode | Aspect ratio mode |
TRTCVideoStreamType | Stream type |
TRTCVideoFillMode | Image fill mode |
TRTCVideoRotation | Rotation |
TRTCBeautyStyle | Beauty (skin smoothing) algorithm |
TRTCVideoPixelFormat | Pixel format |
TRTCVideoBufferType | Video data transfer method |
TRTCVideoMirrorType | Mirror mode |
TRTCSnapshotSourceType | Source of local screenshots |
API | Description |
---|---|
TRTCAppScene | Application scenario |
TRTCRoleType | Role |
TRTCQosControlMode | QoS control mode (disused) |
TRTCVideoQosPreference | Video quality preference |
TRTCQualityInfo | Network quality |
TRTCAVStatusType | Video status |
TRTCAVStatusChangeReason | Reason for change of video status |
API | Description |
---|---|
TRTCAudioQuality | Audio quality |
API | Description |
---|---|
TRTCLogLevel | Log level |
TRTCScreenCaptureSourceType | Type of the content to share (for desktop systems only) |
TRTCTranscodingConfigMode | Layout mode for On-Cloud MixTranscoding |
TRTCLocalRecordType | Type of the media to record |
TRTCMixInputType | Input type for stream mixing |
TRTCDeviceType | Device type (for desktop systems only) |
TRTCAudioRecordingContent | Type of audio to record |
API | Description |
---|---|
TRTCParams | Room entry parameters |
TRTCVideoEncParam | Video encoding parameters |
TRTCNetworkQosParam | QoS control parameters |
TRTCRenderParams | Video rendering parameters |
TRTCQualityInfo | Network quality |
TRTCVolumeInfo | Volume |
TRTCSpeedTestParams | Network speed testing parameters |
TRTCSpeedTestResult | Results of network speed testing |
TRTCVideoFrame | Video frame information |
TRTCAudioFrame | Audio frame information |
TRTCMixUser | Information of each channel in On-Cloud MixTranscoding |
TRTCTranscodingConfig | Layout and transcoding parameters for On-Cloud MixTranscoding |
TRTCPublishCDNParam | Relaying parameters for publishing audio/video streams to a non-Tencent Cloud CDN |
TRTCAudioRecordingParams | Local audio recording parameters |
TRTCLocalRecordingParams | Local media recording parameters |
TRTCAudioEffectParam | Audio effect parameters (disused) |
TRTCSwitchRoomConfig | Room switching parameters |
TRTCAudioFrameCallbackFormat | Parameters for the format of the custom audio callback |
TRTCScreenCaptureSourceInfo | Information of the content to share (for desktop systems only) |
ITRTCScreenCaptureSourceList | List of sharable sources |
Was this page helpful?