LiteAVSDK
Tencent Cloud TRTC SDK, is a high availability components serving tens of thousands of enterprise customers, which is committed to helping you to minimize your research and development costs.
TRTCCloudDef

Namespaces

 liteav
 

Data Structures

struct  RECT
 
struct  SIZE
 
struct  TRTCParams
 
struct  TRTCVideoEncParam
 
struct  TRTCNetworkQosParam
 
struct  TRTCRenderParams
 
struct  TRTCQualityInfo
 
struct  TRTCVolumeInfo
 
struct  TRTCSpeedTestParams
 
struct  TRTCSpeedTestResult
 
struct  TRTCVideoFrame
 
struct  TRTCAudioFrame
 
struct  TRTCMixUser
 
struct  TRTCTranscodingConfig
 
struct  TRTCPublishCDNParam
 
struct  TRTCAudioRecordingParams
 
struct  TRTCLocalRecordingParams
 
struct  TRTCAudioEffectParam
 
struct  TRTCSwitchRoomConfig
 
struct  TRTCAudioFrameCallbackFormat
 
struct  TRTCImageBuffer
 
struct  TRTCScreenCaptureSourceInfo
 
class  ITRTCScreenCaptureSourceList
 
struct  TRTCScreenCaptureProperty
 
struct  TRTCAudioParallelParams
 

Macros

#define __TRTCTYPEDEF_H__
 
#define WIN32_LEAN_AND_MEAN
 
#define TRTC_API   __declspec(dllexport)
 
#define TRTC_API   __declspec(dllimport)
 
#define TRTC_API   __attribute__((visibility("default")))
 
#define TRTC_API   __attribute__((visibility("default")))
 
#define TRTC_API
 
#define TARGET_PLATFORM_DESKTOP   ((__APPLE__ && TARGET_OS_MAC && !TARGET_OS_IPHONE) || _WIN32)
 
#define TARGET_PLATFORM_PHONE   (__ANDROID__ || (__APPLE__ && TARGET_OS_IOS))
 
#define TARGET_PLATFORM_MAC   (__APPLE__ && TARGET_OS_MAC && !TARGET_OS_IPHONE)
 
#define TRTCDeviceTypeUnknow   TXMediaDeviceTypeUnknown
 
#define TRTCDeviceTypeMic   TXMediaDeviceTypeMic
 
#define TRTCDeviceTypeSpeaker   TXMediaDeviceTypeSpeaker
 
#define TRTCDeviceTypeCamera   TXMediaDeviceTypeCamera
 
#define TRTCDeviceStateAdd   TXMediaDeviceStateAdd
 
#define TRTCDeviceStateRemove   TXMediaDeviceStateRemove
 
#define TRTCDeviceStateActive   TXMediaDeviceStateActive
 

Typedefs

typedef HWND TXView
 
typedef TXMediaDeviceType TRTCDeviceType
 
typedef TXMediaDeviceState TRTCDeviceState
 
typedef ITXDeviceCollection ITRTCDeviceCollection
 
typedef ITXDeviceInfo ITRTCDeviceInfo
 

Enumerations

enum  TRTCVideoResolution
 
enum  TRTCVideoResolutionMode
 
enum  TRTCVideoStreamType
 
enum  TRTCVideoFillMode
 
enum  TRTCVideoRotation
 
enum  TRTCBeautyStyle
 
enum  TRTCVideoPixelFormat
 
enum  TRTCVideoBufferType
 
enum  TRTCVideoMirrorType
 
enum  TRTCSnapshotSourceType
 
enum  TRTCAppScene
 
enum  TRTCRoleType
 
enum  TRTCQosControlMode
 
enum  TRTCVideoQosPreference
 
enum  TRTCQuality
 
enum  TRTCAVStatusType
 
enum  TRTCAVStatusChangeReason
 
enum  TRTCAudioQuality
 
enum  TRTCAudioFrameFormat
 
enum  TRTCLogLevel
 
enum  TRTCScreenCaptureSourceType
 
enum  TRTCTranscodingConfigMode
 
enum  TRTCLocalRecordType
 
enum  TRTCMixInputType
 
enum  TRTCWaterMarkSrcType
 
enum  TRTCAudioRecordingContent
 

Detailed Description

Tencent Cloud TRTC Key Type Definition.

Module: TRTC key class definition Description: definitions of enumerated and constant values such as resolution and quality level


Data Structure Documentation

◆ liteav::RECT

struct liteav::RECT
Data Fields
int bottom
int left
int right
int top

◆ liteav::SIZE

struct liteav::SIZE
Data Fields
long height
long width

◆ liteav::TRTCParams

struct liteav::TRTCParams

Room entry parameters

As the room entry parameters in the TRTC SDK, these parameters must be correctly set so that the user can successfully enter the audio/video room specified by roomId or strRoomId. For historical reasons, TRTC supports two types of room IDs: roomId and strRoomId. Note: do not mix roomId and strRoomId, because they are not interchangeable. For example, the number 123 and the string 123 are two completely different rooms in TRTC.

Public Member Functions

 TRTCParams ()
 

Data Fields

uint32_t sdkAppId
 
const char * userId
 
const char * userSig
 
uint32_t roomId
 
const char * strRoomId
 
TRTCRoleType role
 
const char * streamId
 
const char * userDefineRecordId
 
const char * privateMapKey
 
const char * businessInfo
 

Constructor & Destructor Documentation

◆ TRTCParams()

TRTCParams ( )
inline

Field Documentation

◆ businessInfo

const char* businessInfo

◆ privateMapKey

const char* privateMapKey

◆ role

◆ roomId

uint32_t roomId

◆ sdkAppId

uint32_t sdkAppId

◆ streamId

const char* streamId

◆ strRoomId

const char* strRoomId

◆ userDefineRecordId

const char* userDefineRecordId

◆ userId

const char* userId

◆ userSig

const char* userSig

◆ liteav::TRTCVideoEncParam

struct liteav::TRTCVideoEncParam

Video encoding parameters

These settings determine the quality of image viewed by remote users as well as the image quality of recorded video files in the cloud.

Public Member Functions

 TRTCVideoEncParam ()
 

Data Fields

TRTCVideoResolution videoResolution
 
TRTCVideoResolutionMode resMode
 
uint32_t videoFps
 
uint32_t videoBitrate
 
uint32_t minVideoBitrate
 
bool enableAdjustRes
 

Constructor & Destructor Documentation

◆ TRTCVideoEncParam()

TRTCVideoEncParam ( )
inline

Field Documentation

◆ enableAdjustRes

bool enableAdjustRes

◆ minVideoBitrate

uint32_t minVideoBitrate

◆ resMode

◆ videoBitrate

uint32_t videoBitrate

◆ videoFps

uint32_t videoFps

Recommended value: 15 or 20 fps. If the frame rate is lower than 5 fps, there will be obvious lagging; if lower than 10 fps but higher than 5 fps, there will be slight lagging; if higher than 20 fps, the bandwidth will be wasted (the frame rate of movies is generally 24 fps). Note: the front cameras on certain Android phones do not support a capturing frame rate higher than 15 fps. For some Android phones that focus on beautification features, the capturing frame rate of the front cameras may be lower than 10 fps.

◆ videoResolution

TRTCVideoResolution videoResolution

◆ liteav::TRTCNetworkQosParam

struct liteav::TRTCNetworkQosParam

Network QoS control parameter set

Network QoS control parameter. The settings determine the QoS control policy of the SDK in weak network conditions (e.g., whether to "ensure clarity" or "ensure smoothness").

Public Member Functions

 TRTCNetworkQosParam ()
 

Data Fields

TRTCVideoQosPreference preference
 
TRTCQosControlMode controlMode
 

Constructor & Destructor Documentation

◆ TRTCNetworkQosParam()

TRTCNetworkQosParam ( )
inline

Field Documentation

◆ controlMode

TRTCQosControlMode controlMode

◆ preference

◆ liteav::TRTCRenderParams

struct liteav::TRTCRenderParams

Rendering parameters of video image

You can use these parameters to control the video image rotation angle, fill mode, and mirror mode.

Public Member Functions

 TRTCRenderParams ()
 

Data Fields

TRTCVideoRotation rotation
 
TRTCVideoFillMode fillMode
 
TRTCVideoMirrorType mirrorType
 

Constructor & Destructor Documentation

◆ TRTCRenderParams()

TRTCRenderParams ( )
inline

Field Documentation

◆ fillMode

◆ mirrorType

TRTCVideoMirrorType mirrorType

◆ rotation

◆ liteav::TRTCQualityInfo

struct liteav::TRTCQualityInfo

Network quality

This indicates the quality of the network. You can use it to display the network quality of each user on the UI.

Public Member Functions

 TRTCQualityInfo ()
 

Data Fields

const char * userId
 
TRTCQuality quality
 

Constructor & Destructor Documentation

◆ TRTCQualityInfo()

TRTCQualityInfo ( )
inline

Field Documentation

◆ quality

TRTCQuality quality

Network quality.

◆ userId

const char* userId

User ID.

◆ liteav::TRTCVolumeInfo

struct liteav::TRTCVolumeInfo

Volume

This indicates the audio volume value. You can use it to display the volume of each user in the UI.

Public Member Functions

 TRTCVolumeInfo ()
 

Data Fields

const char * userId
 
uint32_t volume
 

Constructor & Destructor Documentation

◆ TRTCVolumeInfo()

TRTCVolumeInfo ( )
inline

Field Documentation

◆ userId

const char* userId

userId of the speaker. An empty value indicates the local user.

◆ volume

uint32_t volume

Volume of the speaker. Value range: 0–100.

◆ liteav::TRTCSpeedTestParams

struct liteav::TRTCSpeedTestParams

Network speed testing parameters

You can test the network speed through the startSpeedTest: interface before the user enters the room (this API cannot be called during a call).

Public Member Functions

 TRTCSpeedTestParams ()
 

Data Fields

int sdkAppId
 
const char * userId
 
const char * userSig
 
int expectedUpBandwidth
 
int expectedDownBandwidth
 

Constructor & Destructor Documentation

◆ TRTCSpeedTestParams()

TRTCSpeedTestParams ( )
inline

Field Documentation

◆ expectedDownBandwidth

int expectedDownBandwidth

Expected downstream bandwidth (kbps, value range: 10 to 5000, no downlink bandwidth test when it is 0).

◆ expectedUpBandwidth

int expectedUpBandwidth

Expected upstream bandwidth (kbps, value range: 10 to 5000, no uplink bandwidth test when it is 0).

◆ sdkAppId

int sdkAppId

Application identification, please refer to the relevant instructions in TRTCParams.

◆ userId

const char* userId

User identification, please refer to the relevant instructions in TRTCParams.

◆ userSig

const char* userSig

User signature, please refer to the relevant instructions in TRTCParams.

◆ liteav::TRTCSpeedTestResult

struct liteav::TRTCSpeedTestResult

Network speed test result

The startSpeedTest: API can be used to test the network speed before a user enters a room (this API cannot be called during a call).

Public Member Functions

 TRTCSpeedTestResult ()
 

Data Fields

bool success
 
const char * errMsg
 
const char * ip
 
TRTCQuality quality
 
float upLostRate
 
float downLostRate
 
int rtt
 
int availableUpBandwidth
 
int availableDownBandwidth
 

Constructor & Destructor Documentation

◆ TRTCSpeedTestResult()

TRTCSpeedTestResult ( )
inline

Field Documentation

◆ availableDownBandwidth

int availableDownBandwidth

Downstream bandwidth (in kbps, -1: invalid value).

◆ availableUpBandwidth

int availableUpBandwidth

Upstream bandwidth (in kbps, -1: invalid value).

◆ downLostRate

float downLostRate

Downstream packet loss rate between 0 and 1.0. For example, 0.2 indicates that 2 data packets may be lost in every 10 packets received from the server.

◆ errMsg

const char* errMsg

Error message for network speed test.

◆ ip

const char* ip

Server IP address.

◆ quality

TRTCQuality quality

Network quality, which is tested and calculated based on the internal evaluation algorithm. For more information, please see TRTCQuality.

◆ rtt

int rtt

Delay in milliseconds, which is the round-trip time between the current device and TRTC server. The smaller the value, the better. The normal value range is 10–100 ms.

◆ success

bool success

Whether the network speed test is successful.

◆ upLostRate

float upLostRate

Upstream packet loss rate between 0 and 1.0. For example, 0.3 indicates that 3 data packets may be lost in every 10 packets sent to the server.

◆ liteav::TRTCVideoFrame

struct liteav::TRTCVideoFrame

Video frame information

TRTCVideoFrame is used to describe the raw data of a frame of the video image, which is the image data before frame encoding or after frame decoding.

Data Fields
uint32_t height
uint64_t timestamp
uint32_t width

Field description:** video pixel format TRTCVideoPixelFormat videoFormat;

/**Field description:** video data structure type TRTCVideoBufferType bufferType;

/**Field description:** video data when bufferType is TRTCVideoBufferType_Buffer, which carries the memory data blocks for the C++ layer. char *data;

/**Field description:** video texture ID, i.e., video data when bufferType is TRTCVideoBufferType_Texture, which carries the texture data used for OpenGL rendering. int textureId;

/**Field description:** video data length in bytes. For I420, length = width * height * 3 / 2; for BGRA32, length = width * height * 4. uint32_t length;

/****Field description:** video width Recommended value: please enter the width of the video data passed in.

◆ liteav::TRTCAudioFrame

struct liteav::TRTCAudioFrame

Audio frame data

◆ liteav::TRTCMixUser

struct liteav::TRTCMixUser

Description information of each video image in On-Cloud MixTranscoding

TRTCMixUser is used to specify the location, size, layer, and stream type of each video image in On-Cloud MixTranscoding.

Public Member Functions

 TRTCMixUser ()
 

Data Fields

bool pureAudio
 
TRTCMixInputType inputType
 
uint32_t renderMode
 
const char * image
 

Constructor & Destructor Documentation

◆ TRTCMixUser()

TRTCMixUser ( )
inline

Field Documentation

◆ image

const char* image

◆ inputType

TRTCMixInputType inputType

◆ pureAudio

bool pureAudio

Field description:** user ID const char *userId;

/**Field description:** ID of the room where this audio/video stream is located (an empty value indicates the local room ID) const char *roomId;

/**Field description:** specify the coordinate area of this video image in px RECT rect;

/**Field description:** specify the level of this video image (value range: 1–15; the value must be unique) int zOrder;

/**Field description:** specify whether this video image is the primary stream image (TRTCVideoStreamTypeBig) or substream image (TRTCVideoStreamTypeSub). TRTCVideoStreamType streamType;

/****Field description:** specify whether this stream mixes audio only Recommended value: default value: false Note: this field has been disused. We recommend you use the new field inputType introduced in v8.5.

◆ renderMode

uint32_t renderMode

◆ liteav::TRTCTranscodingConfig

struct liteav::TRTCTranscodingConfig

Layout and transcoding parameters of On-Cloud MixTranscoding

These parameters are used to specify the layout position information of each video image and the encoding parameters of mixtranscoding during On-Cloud MixTranscoding.

Public Member Functions

 TRTCTranscodingConfig ()
 

Data Fields

TRTCTranscodingConfigMode mode
 
uint32_t appId
 
uint32_t bizId
 
uint32_t videoWidth
 
uint32_t videoHeight
 
uint32_t videoBitrate
 
uint32_t videoFramerate
 
uint32_t videoGOP
 
uint32_t backgroundColor
 
const char * backgroundImage
 
uint32_t audioSampleRate
 
uint32_t audioBitrate
 
uint32_t audioChannels
 
uint32_t audioCodec
 
TRTCMixUsermixUsersArray
 
const char * streamId
 

Constructor & Destructor Documentation

◆ TRTCTranscodingConfig()

Field Documentation

◆ appId

uint32_t appId

◆ audioBitrate

uint32_t audioBitrate

◆ audioChannels

uint32_t audioChannels

◆ audioCodec

uint32_t audioCodec

◆ audioSampleRate

uint32_t audioSampleRate

◆ backgroundColor

uint32_t backgroundColor

◆ backgroundImage

const char* backgroundImage

◆ bizId

uint32_t bizId

◆ mixUsersArray

TRTCMixUser* mixUsersArray

◆ mode

◆ streamId

const char* streamId

Field description:** number of elements in the mixUsersArray array uint32_t mixUsersArraySize;

/****Field description:** ID of the live stream output to CDN Recommended value: default value: null, that is, the audio/video streams in the room will be mixed into the audio/video stream of the caller of this API.

  • If you don't set this parameter, the SDK will execute the default logic, that is, it will mix the multiple audio/video streams in the room into the audio/video stream of the caller of this API, i.e., A + B => A.
  • If you set this parameter, the SDK will mix the audio/video streams in the room into the live stream you specify, i.e., A + B => C (C is the streamId you specify).

◆ videoBitrate

uint32_t videoBitrate

◆ videoFramerate

uint32_t videoFramerate

◆ videoGOP

uint32_t videoGOP

◆ videoHeight

uint32_t videoHeight

◆ videoWidth

uint32_t videoWidth

◆ liteav::TRTCPublishCDNParam

struct liteav::TRTCPublishCDNParam

Push parameters required to be set when publishing audio/video streams to non-Tencent Cloud CDN

TRTC's backend service supports publishing audio/video streams to third-party live CDN service providers through the standard RTMP protocol. If you use the Tencent Cloud CSS CDN service, you don't need to care about this parameter; instead, just use the startPublish API.

Public Member Functions

 TRTCPublishCDNParam ()
 

Data Fields

uint32_t appId
 
uint32_t bizId
 
const char * url
 
const char * streamId
 

Constructor & Destructor Documentation

◆ TRTCPublishCDNParam()

TRTCPublishCDNParam ( )
inline

Field Documentation

◆ appId

uint32_t appId

◆ bizId

uint32_t bizId

◆ streamId

const char* streamId

◆ url

const char* url

◆ liteav::TRTCAudioRecordingParams

struct liteav::TRTCAudioRecordingParams

Local audio file recording parameters

This parameter is used to specify the recording parameters in the audio recording API startAudioRecording.

Public Member Functions

 TRTCAudioRecordingParams ()
 

Data Fields

const char * filePath
 
TRTCAudioRecordingContent recordingContent
 

Constructor & Destructor Documentation

◆ TRTCAudioRecordingParams()

Field Documentation

◆ filePath

const char* filePath

◆ recordingContent

TRTCAudioRecordingContent recordingContent

◆ liteav::TRTCLocalRecordingParams

struct liteav::TRTCLocalRecordingParams

Local media file recording parameters

This parameter is used to specify the recording parameters in the local media file recording API startLocalRecording. The startLocalRecording API is an enhanced version of the startAudioRecording API. The former can record video files, while the latter can only record audio files.

Data Fields
const char * filePath

◆ liteav::TRTCAudioEffectParam

struct liteav::TRTCAudioEffectParam

Sound effect parameter (disused)

"Sound effects" in TRTC refer to some short audio files (usually only a few seconds), such as "applause" and "laughter". This parameter is used to specify the path and number of playback times of a sound effect file (short audio file) in the sound effect playback API TRTCCloud#playAudioEffect on legacy versions. After v7.3, the sound effect API has been replaced by a new TXAudioEffectManager#startPlayMusic API. When you specify the TXAudioMusicParam parameter of startPlayMusic, if isShortFile is set to true, the file is a "sound effect" file.

Public Member Functions

 TRTCAudioEffectParam (const int _effectId, const char *_path)
 

Data Fields

int effectId
 
int loopCount
 
bool publish
 
int volume
 

Constructor & Destructor Documentation

◆ TRTCAudioEffectParam()

TRTCAudioEffectParam ( const int  _effectId,
const char *  _path 
)
inline

Field Documentation

◆ effectId

int effectId

◆ loopCount

int loopCount

Field description:** sound effect file path. Supported file formats include AAC, MP3, and M4A. const char *path;

/****Field description:** number of times the sound effect is looped Valid values: 0 or any positive integer. 0 (default) indicates that the sound effect is played once, 1 twice, and so on.

◆ publish

bool publish

◆ volume

int volume

◆ liteav::TRTCSwitchRoomConfig

struct liteav::TRTCSwitchRoomConfig

Room switch parameter

This parameter is used for the room switch API switchRoom, which can quickly switch a user from one room to another.

Public Member Functions

 TRTCSwitchRoomConfig ()
 

Data Fields

uint32_t roomId
 
const char * strRoomId
 
const char * userSig
 
const char * privateMapKey
 

Constructor & Destructor Documentation

◆ TRTCSwitchRoomConfig()

Field Documentation

◆ privateMapKey

const char* privateMapKey

◆ roomId

uint32_t roomId

◆ strRoomId

const char* strRoomId

◆ userSig

const char* userSig

◆ liteav::TRTCAudioFrameCallbackFormat

struct liteav::TRTCAudioFrameCallbackFormat

Format parameter of custom audio callback

This parameter is used to set the relevant format (including sample rate and number of channels) of the audio data called back by the SDK in the APIs related to custom audio callback.

Public Member Functions

 TRTCAudioFrameCallbackFormat ()
 

Data Fields

int sampleRate
 
int channel
 
int samplesPerCall
 

Constructor & Destructor Documentation

◆ TRTCAudioFrameCallbackFormat()

Field Documentation

◆ channel

int channel

◆ sampleRate

int sampleRate

◆ samplesPerCall

int samplesPerCall

◆ liteav::TRTCImageBuffer

struct liteav::TRTCImageBuffer

Screen sharing target information (for desktop systems only)

When users share the screen, they can choose to share the entire desktop or only the window of a certain program. TRTCScreenCaptureSourceInfo is used to describe the information of the target to be shared, including ID, name, and thumbnail. The fields in this structure are read-only.

Public Member Functions

 TRTCImageBuffer ()
 

Data Fields

const char * buffer
 
uint32_t length
 
uint32_t width
 
uint32_t height
 

Constructor & Destructor Documentation

◆ TRTCImageBuffer()

TRTCImageBuffer ( )
inline

Field Documentation

◆ buffer

const char* buffer

image content in BGRA format

◆ height

uint32_t height

image height

◆ length

uint32_t length

buffer size

◆ width

uint32_t width

image width

◆ liteav::TRTCScreenCaptureSourceInfo

struct liteav::TRTCScreenCaptureSourceInfo

◆ liteav::ITRTCScreenCaptureSourceList

class liteav::ITRTCScreenCaptureSourceList

List of sharable screens and windows

This structure is equivalent to std::vector<TRTCScreenCaptureSourceInfo>, which is used to solve the binary compatibility problem of different versions of STL containers.

Public Member Functions

virtual uint32_t getCount ()=0
 
virtual TRTCScreenCaptureSourceInfo getSourceInfo (uint32_t index)=0
 
virtual void release ()=0
 

Protected Member Functions

virtual ~ITRTCScreenCaptureSourceList ()
 

Constructor & Destructor Documentation

◆ ~ITRTCScreenCaptureSourceList()

virtual ~ITRTCScreenCaptureSourceList ( )
inlineprotectedvirtual

Member Function Documentation

◆ getCount()

virtual uint32_t getCount ( )
pure virtual

Size of this list.

◆ getSourceInfo()

virtual TRTCScreenCaptureSourceInfo getSourceInfo ( uint32_t  index)
pure virtual

Get element(TRTCScreenCaptureSourceInfo) by index.

◆ release()

virtual void release ( )
pure virtual

Don't use delete!!!

◆ liteav::TRTCScreenCaptureProperty

struct liteav::TRTCScreenCaptureProperty

Advanced control parameter of screen sharing

This parameter is used in the screen sharing-related API selectScreenCaptureTarget to set a series of advanced control parameters when specifying the sharing target. For example, whether to capture the cursor, whether to capture the subwindow, and whether to draw a frame around the shared target.

Data Fields
bool enableHighPerformance

Field description:** whether to capture the cursor while capturing the target content. Default value: true. bool enableCaptureMouse;

/**Field description:** whether to highlight the window being shared (i.e., drawing a frame around the shared target). Default value: true. bool enableHighLight;

/****Field description:** whether to enable the high performance mode (which will take effect only during screen sharing). Default value: true. Note: the screen capturing performance is the best after this mode is enabled, but the anti-blocking ability will be lost. If you enable enableHighLight and enableHighPerformance at the same time, remote users will see the highlighted frame.

◆ liteav::TRTCAudioParallelParams

struct liteav::TRTCAudioParallelParams

parameter of the parallel strategy of remote audio streams

This parameter is used to set the parallel strategy of remote audio streams.

Public Member Functions

 TRTCAudioParallelParams ()
 

Data Fields

uint32_t maxCount
 
char ** includeUsers
 
uint32_t includeUsersCount
 

Constructor & Destructor Documentation

◆ TRTCAudioParallelParams()

Field Documentation

◆ includeUsers

char** includeUsers

◆ includeUsersCount

uint32_t includeUsersCount

◆ maxCount

uint32_t maxCount

Macro Definition Documentation

◆ __TRTCTYPEDEF_H__

#define __TRTCTYPEDEF_H__

◆ TARGET_PLATFORM_DESKTOP

#define TARGET_PLATFORM_DESKTOP   ((__APPLE__ && TARGET_OS_MAC && !TARGET_OS_IPHONE) || _WIN32)

◆ TARGET_PLATFORM_MAC

#define TARGET_PLATFORM_MAC   (__APPLE__ && TARGET_OS_MAC && !TARGET_OS_IPHONE)

◆ TARGET_PLATFORM_PHONE

#define TARGET_PLATFORM_PHONE   (__ANDROID__ || (__APPLE__ && TARGET_OS_IOS))

◆ TRTC_API [1/5]

#define TRTC_API   __declspec(dllexport)

◆ TRTC_API [2/5]

#define TRTC_API   __declspec(dllimport)

◆ TRTC_API [3/5]

#define TRTC_API   __attribute__((visibility("default")))

◆ TRTC_API [4/5]

#define TRTC_API   __attribute__((visibility("default")))

◆ TRTC_API [5/5]

#define TRTC_API

◆ TRTCDeviceStateActive

#define TRTCDeviceStateActive   TXMediaDeviceStateActive

◆ TRTCDeviceStateAdd

#define TRTCDeviceStateAdd   TXMediaDeviceStateAdd

◆ TRTCDeviceStateRemove

#define TRTCDeviceStateRemove   TXMediaDeviceStateRemove

◆ TRTCDeviceTypeCamera

#define TRTCDeviceTypeCamera   TXMediaDeviceTypeCamera

◆ TRTCDeviceTypeMic

#define TRTCDeviceTypeMic   TXMediaDeviceTypeMic

◆ TRTCDeviceTypeSpeaker

#define TRTCDeviceTypeSpeaker   TXMediaDeviceTypeSpeaker

◆ TRTCDeviceTypeUnknow

#define TRTCDeviceTypeUnknow   TXMediaDeviceTypeUnknown

◆ WIN32_LEAN_AND_MEAN

#define WIN32_LEAN_AND_MEAN

Typedef Documentation

◆ ITRTCDeviceCollection

◆ ITRTCDeviceInfo

◆ TRTCDeviceState

Device operation

This enumerated value is used to notify the status change of the local device onDeviceChange.

◆ TRTCDeviceType

Device type (for desktop platforms only)

This enumerated value is used to define three types of audio/video devices, namely, camera, mic, and speaker, so that the same device management API can control the three different types of devices. Starting from v8.0, TRTC redefines TXMediaDeviceType in TXDeviceManager to replace TRTCMediaDeviceType on legacy versions. Only the definition of TRTCMediaDeviceType is retained here for compatibility with customer code on legacy versions.

◆ TXView

typedef void * TXView

[VIEW] Rendering control that renders the video image

There are many APIs in TRTC that need to manipulate the video image, for which you should specify the video rendering control. The SDK provides rendering controls for different terminal platforms. As the all-platform C++ APIs need to use a unified parameter type, you should uniformly convert the rendering controls into pointers in TXView type when calling these APIs:

  • iOS: you can use the UIView object as the rendering control. When calling the C++ APIs, please pass in the pointer to the UIView object (which needs to be forcibly converted to the void* type).
  • macOS: you can use the NSView object as the rendering control. When calling the C++ APIs, please pass in the pointer to the NSView object (which needs to be forcibly converted to the void* type).
  • Android: when calling the C++ APIs, please pass in the jobject pointer to the TXCloudVideoView object (which needs to be forcibly converted to the void* type).
  • Windows: you can use the window handle HWND as the rendering control. When calling the C++ APIs, you need to forcibly convert the HWND to void* type.

Code sample 1. Use the all-platform C++ APIs under QT

QWidget *videoView;
// The relevant code for setting the videoView is omitted here...
getTRTCShareInstance()->startLocalPreview(reinterpret_cast<TXView>(videoView->winId()));

Code sample 2. Call the all-platform C++ APIs through JNI on Android

native void nativeStartLocalPreview(String userId, int streamType, TXCloudVideoView view);
//...
Java_com_example_test_MainActivity_nativeStartRemoteView(JNIEnv *env, jobject thiz, jstring user_id, jint stream_type, jobject view) {
    const char *user_id_chars = env->GetStringUTFChars(user_id, nullptr);
    trtc_cloud->startRemoteView(user_id_chars, (trtc::TRTCVideoStreamType)stream_type, view);
    env->ReleaseStringUTFChars(user_id, user_id_chars);
}

Enumeration Type Documentation

◆ TRTCAppScene

Use cases

TRTC features targeted optimizations for common audio/video application scenarios to meet the differentiated requirements in various verticals. The main scenarios can be divided into the following two categories:

  • Live streaming scenario (LIVE): including LIVE (audio + video) and VoiceChatRoom (pure audio). In the live streaming scenario, users are divided into two roles: "anchor" and "audience". A single room can sustain up to 100,000 concurrent online users. This is suitable for live streaming to a large audience.
  • Real-Time scenario (RTC): including VideoCall (audio + video) and AudioCall (pure audio). In the real-time scenario, there is no role difference between users, but a single room can sustain only up to 300 concurrent online users. This is suitable for small-scale real-time communication.
Enumerator
TRTCAppSceneVideoCall 

In the video call scenario, 720p and 1080p HD image quality is supported. A single room can sustain up to 300 concurrent online users, and up to 50 of them can speak simultaneously. Use cases: [one-to-one video call], [video conferencing with up to 300 participants], [online medical diagnosis], [small class], [video interview], etc.

TRTCAppSceneLIVE 

In the interactive video live streaming scenario, mic can be turned on/off smoothly without waiting for switchover, and the anchor latency is as low as less than 300 ms. Live streaming to hundreds of thousands of concurrent users in the audience role is supported with the playback latency down to 1,000 ms. Use cases: [low-latency interactive live streaming], [big class], [anchor competition], [video dating room], [online interactive classroom], [remote training], [large-scale conferencing], etc.

Note
In this scenario, you must use the role field in TRTCParams to specify the role of the current user.
TRTCAppSceneAudioCall 

Audio call scenario, where the SPEECH sound quality is used by default. A single room can sustain up to 300 concurrent online users, and up to 50 of them can speak simultaneously. Use cases: [one-to-one audio call], [audio conferencing with up to 300 participants], [audio chat], [online Werewolf], etc.

TRTCAppSceneVoiceChatRoom 

In the interactive audio live streaming scenario, mic can be turned on/off smoothly without waiting for switchover, and the anchor latency is as low as less than 300 ms. Live streaming to hundreds of thousands of concurrent users in the audience role is supported with the playback latency down to 1,000 ms. Use cases: [audio club], [online karaoke room], [music live room], [FM radio], etc.

Note
In this scenario, you must use the role field in TRTCParams to specify the role of the current user.

◆ TRTCAudioFrameFormat

Audio frame content format

Enumerator
TRTCAudioFrameFormatNone 

None.

TRTCAudioFrameFormatPCM 

Audio data in PCM format.

◆ TRTCAudioQuality

Sound quality

TRTC provides three well-tuned modes to meet the differentiated requirements for sound quality in various verticals:

  • Speech mode (Speech): it is suitable for application scenarios that focus on human communication. In this mode, the audio transfer is more resistant, and TRTC uses various voice processing technologies to ensure the optimal smoothness even in weak network environments.
  • Music mode (Music): it is suitable for scenarios with demanding requirements for music. In this mode, the amount of transferred audio data is very large, and TRTC uses various technologies to ensure that the high-fidelity details of music signals can be restored in each frequency band.
  • Default mode (Default): it is between Speech and Music. In this mode, the reproduction of music is better than that in Speech mode, and the amount of transferred data is much lower than that in Music mode; therefore, this mode has good adaptability to various scenarios.
Enumerator
TRTCAudioQualitySpeech 

Speech mode: sample rate: 16 kHz; mono channel; bitrate: 16 Kbps. This mode has the best resistance among all modes and is suitable for audio call scenarios, such as online meeting and audio call.

TRTCAudioQualityDefault 

Default mode: sample rate: 48 kHz; mono channel; bitrate: 50 Kbps. This mode is between the speech mode and the music mode as the default mode in the SDK and is recommended.

TRTCAudioQualityMusic 

Music mode: sample rate: 48 kHz; full-band stereo; bitrate: 128 Kbps. This mode is suitable for scenarios where Hi-Fi music transfer is required, such as online karaoke and music live streaming.

◆ TRTCAudioRecordingContent

Audio recording content type

This enumerated type is used in the audio recording API startAudioRecording to specify the content of the recorded audio.

Enumerator
TRTCAudioRecordingContentAll 

Record both local and remote audio.

TRTCAudioRecordingContentLocal 

Record local audio only.

TRTCAudioRecordingContentRemote 

Record remote audio only.

◆ TRTCAVStatusChangeReason

Reasons for playback status changes

This enumerated type is used in the video status changed API onRemoteVideoStatusUpdated to specify the reason for the current video status change.

Enumerator
TRTCAVStatusChangeReasonInternal 

Default value.

TRTCAVStatusChangeReasonBufferingBegin 

The stream enters the "Loading" state due to network congestion.

TRTCAVStatusChangeReasonBufferingEnd 

The stream enters the "Playing" state after network recovery.

TRTCAVStatusChangeReasonLocalStarted 

As a start-related API was directly called locally, the stream enters the "Playing" state.

TRTCAVStatusChangeReasonLocalStopped 

As a stop-related API was directly called locally, the stream enters the "Stopped" state.

TRTCAVStatusChangeReasonRemoteStarted 

As the remote user started (or resumed) publishing the video stream, the stream enters the "Loading" or "Playing" state.

TRTCAVStatusChangeReasonRemoteStopped 

As the remote user stopped (or paused) publishing the video stream, the stream enters the "Stopped" state.

◆ TRTCAVStatusType

Audio/Video playback status

This enumerated type is used in the video status changed API onRemoteVideoStatusUpdated to specify the current video status.

Enumerator
TRTCAVStatusStopped 

Stopped.

TRTCAVStatusPlaying 

Playing.

TRTCAVStatusLoading 

Loading.

◆ TRTCBeautyStyle

Beauty (skin smoothing) filter algorithm

TRTC has multiple built-in skin smoothing algorithms. You can select the one most suitable for your product.

Enumerator
TRTCBeautyStyleSmooth 

Smooth style, which uses a more radical algorithm for more obvious effect and is suitable for show live streaming.

TRTCBeautyStyleNature 

Natural style, which retains more facial details for more natural effect and is suitable for most live streaming use cases.

◆ TRTCLocalRecordType

Media recording type

This enumerated type is used in the local media recording API startLocalRecording to specify whether to record audio/video files or pure audio files.

Enumerator
TRTCLocalRecordType_Audio 

Record audio only.

TRTCLocalRecordType_Video 

Record video only.

TRTCLocalRecordType_Both 

Record both audio and video.

◆ TRTCLogLevel

Log level

Different log levels indicate different levels of details and number of logs. We recommend you set the log level to TRTCLogLevelInfo generally.

Enumerator
TRTCLogLevelVerbose 

Output logs at all levels.

TRTCLogLevelDebug 

Output logs at the DEBUG, INFO, WARNING, ERROR, and FATAL levels.

TRTCLogLevelInfo 

Output logs at the INFO, WARNING, ERROR, and FATAL levels.

TRTCLogLevelWarn 

Output logs at the WARNING, ERROR, and FATAL levels.

TRTCLogLevelError 

Output logs at the ERROR and FATAL levels.

TRTCLogLevelFatal 

Output logs at the FATAL level.

TRTCLogLevelNone 

Do not output any SDK logs.

◆ TRTCMixInputType

Stream mix input type

Enumerator
TRTCMixInputTypeUndefined 

Default. Considering the compatibility with older versions, if you specify the inputType as Undefined, the SDK will determine the stream mix input type according to the value of the pureAudio parameter

TRTCMixInputTypeAudioVideo 

Mix both audio and video.

TRTCMixInputTypePureVideo 

Mix video only.

TRTCMixInputTypePureAudio 

Mix audio only.

TRTCMixInputTypeWatermark 

Mix watermark In this case, you don't need to specify the userId parameter, but you need to specify the image parameter. It is recommended to use png format.

◆ TRTCQosControlMode

QoS control mode (disused)

Enumerator
TRTCQosControlModeClient 

Client-based control, which is for internal debugging of SDK and shall not be used by users.

TRTCQosControlModeServer 

On-cloud control, which is the default and recommended mode.

◆ TRTCQuality

Network quality

TRTC evaluates the current network quality once every two seconds. The evaluation results are divided into six levels: Excellent indicates the best, and Down indicates the worst.

Enumerator
TRTCQuality_Unknown 

Undefined.

TRTCQuality_Excellent 

The current network is excellent.

TRTCQuality_Good 

The current network is good.

TRTCQuality_Poor 

The current network is fair.

TRTCQuality_Bad 

The current network is bad.

TRTCQuality_Vbad 

The current network is very bad.

TRTCQuality_Down 

The current network cannot meet the minimum requirements of TRTC.

◆ TRTCRoleType

Role

Role is applicable only to live streaming scenarios (TRTCAppSceneLIVE and TRTCAppSceneVoiceChatRoom). Users are divided into two roles:

  • Anchor, who can publish their audio/video streams. There is a limit on the number of anchors. Up to 50 anchors are allowed to publish streams at the same time in one room.
  • Audience, who can only listen to or watch audio/video streams of anchors in the room. If they want to publish their streams, they need to switch to the "anchor" role first through switchRole. One room can sustain up to 100,000 concurrent online users in the audience role.
Enumerator
TRTCRoleAnchor 

An anchor can publish their audio/video streams. There is a limit on the number of anchors. Up to 50 anchors are allowed to publish streams at the same time in one room.

TRTCRoleAudience 

Audience can only listen to or watch audio/video streams of anchors in the room. If they want to publish their streams, they need to switch to the "anchor" role first through switchRole. One room can sustain up to 100,000 concurrent online users in the audience role.

◆ TRTCScreenCaptureSourceType

Screen sharing target type (for desktops only)

Enumerator
TRTCScreenCaptureSourceTypeUnknown 

Undefined.

TRTCScreenCaptureSourceTypeWindow 

The screen sharing target is the window of an application.

TRTCScreenCaptureSourceTypeScreen 

The screen sharing target is the entire screen.

TRTCScreenCaptureSourceTypeCustom 

The screen sharing target is a user-defined data source.

◆ TRTCSnapshotSourceType

Data source of local video screenshot

The SDK can take screenshots from the following two data sources and save them as local files:

  • Video stream: the SDK screencaptures the native video content from the video stream. The screenshots are not controlled by the display of the rendering control.
  • Rendering layer: the SDK screencaptures the displayed video content from the rendering control, which can achieve the effect of WYSIWYG, but if the display area is too small, the screenshots will also be very small.
Enumerator
TRTCSnapshotSourceTypeStream 

The SDK screencaptures the native video content from the video stream. The screenshots are not controlled by the display of the rendering control.

TRTCSnapshotSourceTypeView 

The SDK screencaptures the displayed video content from the rendering control, which can achieve the effect of WYSIWYG, but if the display area is too small, the screenshots will also be very small.

◆ TRTCTranscodingConfigMode

Layout mode of On-Cloud MixTranscoding

TRTC's On-Cloud MixTranscoding service can mix multiple audio/video streams in the room into one stream. Therefore, you need to specify the layout scheme of the video images. The following layout modes are provided:

Enumerator
TRTCTranscodingConfigMode_Unknown 

Undefined.

TRTCTranscodingConfigMode_Manual 

Manual layout mode In this mode, you need to specify the precise position of each video image. This mode has the highest degree of freedom, but its ease of use is the worst:

  • You need to enter all the parameters in TRTCTranscodingConfig, including the position coordinates of each video image (TRTCMixUser).
  • You need to listen on the onUserVideoAvailable() and onUserAudioAvailable() event callbacks in TRTCCloudDelegate and constantly adjust the mixUsers parameter according to the audio/video status of each user with mic on in the current room.
TRTCTranscodingConfigMode_Template_PureAudio 

Pure audio mode This mode is suitable for pure audio scenarios such as audio call (AudioCall) and audio chat room (VoiceChatRoom).

  • You only need to set it once through the setMixTranscodingConfig() API after room entry, and then the SDK will automatically mix the audio of all mic-on users in the room into the current user's live stream.
  • You don't need to set the mixUsers parameter in TRTCTranscodingConfig; instead, you only need to set the audioSampleRate, audioBitrate and audioChannels parameters.
TRTCTranscodingConfigMode_Template_PresetLayout 

Preset layout mode This is the most popular layout mode, because it allows you to set the position of each video image in advance through placeholders, and then the SDK automatically adjusts it dynamically according to the number of video images in the room. In this mode, you still need to set the mixUsers parameter, but you can set userId as a "placeholder". Placeholder values include:

  • "$PLACE_HOLDER_REMOTE$": image of remote user. Multiple images can be set.
  • "$PLACE_HOLDER_LOCAL_MAIN$": local camera image. Only one image can be set.
  • "$PLACE_HOLDER_LOCAL_SUB$": local screen sharing image. Only one image can be set. In this mode, you don't need to listen on the onUserVideoAvailable() and onUserAudioAvailable() callbacks in TRTCCloudDelegate to make real-time adjustments. Instead, you only need to call setMixTranscodingConfig() once after successful room entry. Then, the SDK will automatically populate the placeholders you set with real userId values.
TRTCTranscodingConfigMode_Template_ScreenSharing 

Screen sharing mode This mode is suitable for screen sharing-based use cases such as online education and supported only by the SDKs for Windows and macOS. In this mode, the SDK will first build a canvas according to the target resolution you set (through the videoWidth and videoHeight parameters).

  • Before the teacher enables screen sharing, the SDK will scale up the teacher's camera image and draw it onto the canvas.
  • After the teacher enables screen sharing, the SDK will draw the video image shared on the screen onto the same canvas. The purpose of this layout mode is to ensure consistency in the output resolution of the mixtranscoding module and avoid problems with blurred screen during course replay and webpage playback (web players don't support adjustable resolution). Meanwhile, the audio of mic-on students will be mixed into the teacher's audio/video stream by default. br> Video content is primarily the shared screen in teaching mode, and it is a waste of bandwidth to transfer camera image and screen image at the same time. Therefore, the recommended practice is to directly draw the camera image onto the current screen through the setLocalVideoRenderCallback API. In this mode, you don't need to set the mixUsers parameter in TRTCTranscodingConfig, and the SDK will not mix students' images so as not to interfere with the screen sharing effect. br> You can set width x height in TRTCTranscodingConfig to 0 px x 0 px, and the SDK will automatically calculate a suitable resolution based on the aspect ratio of the user's current screen.
  • If the teacher's current screen width is less than or equal to 1920 px, the SDK will use the actual resolution of the teacher's current screen.
  • If the teacher's current screen width is greater than 1920 px, the SDK will select one of the three resolutions of 1920x1080 (16:9), 1920x1200 (16:10), and 1920x1440 (4:3) according to the current screen aspect ratio.

◆ TRTCVideoBufferType

Video data transfer method

For custom capturing and rendering features, you need to use the following enumerated values to specify the method of transferring video data:

  • Method 1. This method uses memory buffer to transfer video data. It is efficient on iOS but inefficient on Android. It is the only method supported on Windows currently.
  • Method 2. This method uses texture to transfer video data. It is efficient on both iOS and Android but is not supported on Windows. To use this method, you should have a general familiarity with OpenGL programming.
Enumerator
TRTCVideoBufferType_Unknown 

Undefined transfer method.

TRTCVideoBufferType_Buffer 

Use memory buffer to transfer video data. iOS: PixelBuffer; Android: Direct Buffer for JNI layer; Windows: memory data block.

TRTCVideoBufferType_Texture 

Use texture to transfer video data.

◆ TRTCVideoFillMode

Video image fill mode

If the aspect ratio of the video display area is not equal to that of the video image, you need to specify the fill mode:

Enumerator
TRTCVideoFillMode_Fill 

Fill mode: the video image will be centered and scaled to fill the entire display area, where parts that exceed the area will be cropped. The displayed image may be incomplete in this mode.

TRTCVideoFillMode_Fit 

Fit mode: the video image will be scaled based on its long side to fit the display area, where the short side will be filled with black bars. The displayed image is complete in this mode, but there may be black bars.

◆ TRTCVideoMirrorType

Video mirror type

Video mirroring refers to the left-to-right flipping of the video image, especially for the local camera preview image. After mirroring is enabled, it can bring anchors a familiar "look into the mirror" experience.

Enumerator
TRTCVideoMirrorType_Auto 

Auto mode: mirror the front camera's image but not the rear camera's image (for mobile devices only).

TRTCVideoMirrorType_Enable 

Mirror the images of both the front and rear cameras.

TRTCVideoMirrorType_Disable 

Disable mirroring for both the front and rear cameras.

◆ TRTCVideoPixelFormat

Video pixel format

TRTC provides custom video capturing and rendering features.

  • For the custom capturing feature, you can use the following enumerated values to describe the pixel format of the video you capture.
  • For the custom rendering feature, you can specify the pixel format of the video you expect the SDK to call back.
Enumerator
TRTCVideoPixelFormat_Unknown 

Undefined format.

TRTCVideoPixelFormat_I420 

YUV420P (I420) format.

TRTCVideoPixelFormat_Texture_2D 

OpenGL 2D texture format.

TRTCVideoPixelFormat_BGRA32 

BGRA32 format.

TRTCVideoPixelFormat_RGBA32 

RGBA format.

◆ TRTCVideoQosPreference

Image quality preference

TRTC has two control modes in weak network environments: "ensuring clarity" and "ensuring smoothness". Both modes will give priority to the transfer of audio data.

Enumerator
TRTCVideoQosPreferenceSmooth 

Ensuring smoothness: in this mode, when the current network is unable to transfer a clear and smooth video image, the smoothness of the image will be given priority, but there will be blurs.

TRTCVideoQosPreferenceClear 

Ensuring clarity (default value): in this mode, when the current network is unable to transfer a clear and smooth video image, the clarity of the image will be given priority, but there will be lags.

◆ TRTCVideoResolution

Video resolution

Here, only the landscape resolution (e.g., 640x360) is defined. If the portrait resolution (e.g., 360x640) needs to be used, Portrait must be selected for TRTCVideoResolutionMode.

Enumerator
TRTCVideoResolution_120_120 

Aspect ratio: 1:1; resolution: 120x120; recommended bitrate (VideoCall): 80 Kbps; recommended bitrate (LIVE): 120 Kbps.

TRTCVideoResolution_160_160 

Aspect ratio: 1:1; resolution: 160x160; recommended bitrate (VideoCall): 100 Kbps; recommended bitrate (LIVE): 150 Kbps.

TRTCVideoResolution_270_270 

Aspect ratio: 1:1; resolution: 270x270; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps.

TRTCVideoResolution_480_480 

Aspect ratio: 1:1; resolution: 480x480; recommended bitrate (VideoCall): 350 Kbps; recommended bitrate (LIVE): 500 Kbps.

TRTCVideoResolution_160_120 

Aspect ratio: 4:3; resolution: 160x120; recommended bitrate (VideoCall): 100 Kbps; recommended bitrate (LIVE): 150 Kbps.

TRTCVideoResolution_240_180 

Aspect ratio: 4:3; resolution: 240x180; recommended bitrate (VideoCall): 150 Kbps; recommended bitrate (LIVE): 250 Kbps.

TRTCVideoResolution_280_210 

Aspect ratio: 4:3; resolution: 280x210; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps.

TRTCVideoResolution_320_240 

Aspect ratio: 4:3; resolution: 320x240; recommended bitrate (VideoCall): 250 Kbps; recommended bitrate (LIVE): 375 Kbps.

TRTCVideoResolution_400_300 

Aspect ratio: 4:3; resolution: 400x300; recommended bitrate (VideoCall): 300 Kbps; recommended bitrate (LIVE): 450 Kbps.

TRTCVideoResolution_480_360 

Aspect ratio: 4:3; resolution: 480x360; recommended bitrate (VideoCall): 400 Kbps; recommended bitrate (LIVE): 600 Kbps.

TRTCVideoResolution_640_480 

Aspect ratio: 4:3; resolution: 640x480; recommended bitrate (VideoCall): 600 Kbps; recommended bitrate (LIVE): 900 Kbps.

TRTCVideoResolution_960_720 

Aspect ratio: 4:3; resolution: 960x720; recommended bitrate (VideoCall): 1000 Kbps; recommended bitrate (LIVE): 1500 Kbps.

TRTCVideoResolution_160_90 

Aspect ratio: 16:9; resolution: 160x90; recommended bitrate (VideoCall): 150 Kbps; recommended bitrate (LIVE): 250 Kbps.

TRTCVideoResolution_256_144 

Aspect ratio: 16:9; resolution: 256x144; recommended bitrate (VideoCall): 200 Kbps; recommended bitrate (LIVE): 300 Kbps.

TRTCVideoResolution_320_180 

Aspect ratio: 16:9; resolution: 320x180; recommended bitrate (VideoCall): 250 Kbps; recommended bitrate (LIVE): 400 Kbps.

TRTCVideoResolution_480_270 

Aspect ratio: 16:9; resolution: 480x270; recommended bitrate (VideoCall): 350 Kbps; recommended bitrate (LIVE): 550 Kbps.

TRTCVideoResolution_640_360 

Aspect ratio: 16:9; resolution: 640x360; recommended bitrate (VideoCall): 500 Kbps; recommended bitrate (LIVE): 900 Kbps.

TRTCVideoResolution_960_540 

Aspect ratio: 16:9; resolution: 960x540; recommended bitrate (VideoCall): 850 Kbps; recommended bitrate (LIVE): 1300 Kbps.

TRTCVideoResolution_1280_720 

Aspect ratio: 16:9; resolution: 1280x720; recommended bitrate (VideoCall): 1200 Kbps; recommended bitrate (LIVE): 1800 Kbps.

TRTCVideoResolution_1920_1080 

Aspect ratio: 16:9; resolution: 1920x1080; recommended bitrate (VideoCall): 2000 Kbps; recommended bitrate (LIVE): 3000 Kbps.

◆ TRTCVideoResolutionMode

Video aspect ratio mode

Only the landscape resolution (e.g., 640x360) is defined in TRTCVideoResolution. If the portrait resolution (e.g., 360x640) needs to be used, Portrait must be selected for TRTCVideoResolutionMode.

Enumerator
TRTCVideoResolutionModeLandscape 

Landscape resolution, such as TRTCVideoResolution_640_360 + TRTCVideoResolutionModeLandscape = 640x360.

TRTCVideoResolutionModePortrait 

Portrait resolution, such as TRTCVideoResolution_640_360 + TRTCVideoResolutionModePortrait = 360x640.

◆ TRTCVideoRotation

Video image rotation direction

TRTC provides rotation angle setting APIs for local and remote images. The following rotation angles are all clockwise.

Enumerator
TRTCVideoRotation0 

No rotation.

TRTCVideoRotation90 

Clockwise rotation by 90 degrees.

TRTCVideoRotation180 

Clockwise rotation by 180 degrees.

TRTCVideoRotation270 

Clockwise rotation by 270 degrees.

◆ TRTCVideoStreamType

Video stream type

TRTC provides three different video streams, including:

  • HD big image: it is generally used to transfer video data from the camera.
  • Smooth small image: it has the same content as the big image, but with lower resolution and bitrate and thus lower definition.
  • Substream image: it is generally used for screen sharing. Only one user in the room is allowed to publish the substream video image at any time, while other users must wait for this user to close the substream before they can publish their own substream.
    Attention
    The SDK does not support enabling the smooth small image alone, which must be enabled together with the big image. It will automatically set the resolution and bitrate of the small image.
Enumerator
TRTCVideoStreamTypeBig 

HD big image: it is generally used to transfer video data from the camera.

TRTCVideoStreamTypeSmall 

Smooth small image: it has the same content as the big image, but with lower resolution and bitrate and thus lower definition.

TRTCVideoStreamTypeSub 

Substream image: it is generally used for screen sharing. Only one user in the room is allowed to publish the substream video image at any time, while other users must wait for this user to close the substream before they can publish their own substream.

◆ TRTCWaterMarkSrcType

Watermark image source type

Enumerator
TRTCWaterMarkSrcTypeFile 

Path of the image file, which can be in BMP, GIF, JPEG, PNG, TIFF, Exif, WMF, or EMF format.

TRTCWaterMarkSrcTypeBGRA32 

Memory block in BGRA32 format.

TRTCWaterMarkSrcTypeRGBA32 

Memory block in RGBA32 format.