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.

Data Structures

class  AudioMusicParam
 
class  ITRTCAudioFrameCallback
 
class  ITRTCCloud
 
class  ITRTCCloudCallback
 
class  ITRTCLogCallback
 
class  ITRTCScreenCaptureSourceList
 
class  ITRTCVideoFrameCallback
 
class  ITRTCVideoRenderCallback
 
class  ITXAudioEffectManager
 
class  ITXDeviceCollection
 
class  ITXDeviceInfo
 
class  ITXDeviceManager
 
class  ITXDeviceObserver
 
class  ITXMusicPlayObserver
 
class  IV2TXLiveScreenCaptureSourceList
 
struct  RECT
 
struct  SIZE
 
struct  TRTCAudioEffectParam
 
struct  TRTCAudioFrame
 
struct  TRTCAudioFrameCallbackFormat
 
struct  TRTCAudioRecordingParams
 
struct  TRTCImageBuffer
 
struct  TRTCLocalRecordingParams
 
struct  TRTCLocalStatistics
 
struct  TRTCMixUser
 
struct  TRTCNetworkQosParam
 
struct  TRTCParams
 
struct  TRTCPublishCDNParam
 
struct  TRTCQualityInfo
 
struct  TRTCRemoteStatistics
 
struct  TRTCRenderParams
 
struct  TRTCScreenCaptureProperty
 
struct  TRTCScreenCaptureSourceInfo
 
struct  TRTCSpeedTestResult
 
struct  TRTCStatistics
 
struct  TRTCSwitchRoomConfig
 
struct  TRTCTranscodingConfig
 
struct  TRTCVideoEncParam
 
struct  TRTCVideoFrame
 
struct  TRTCVolumeInfo
 
struct  TXCameraCaptureParam
 
struct  V2TXLiveAudioFrame
 
struct  V2TXLiveAudioFrameObserverFormat
 
struct  V2TXLiveImage
 
class  V2TXLivePlayer
 
class  V2TXLivePlayerObserver
 
struct  V2TXLivePlayerStatistics
 
class  V2TXLivePusher
 
class  V2TXLivePusherObserver
 
struct  V2TXLivePusherStatistics
 
struct  V2TXLiveScreenCaptureProperty
 
struct  V2TXLiveScreenCaptureSourceInfo
 
struct  V2TXLiveVideoEncoderParam
 
struct  V2TXLiveVideoFrame
 

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
 
enum  V2TXLiveCode
 
enum  V2TXLiveMode
 

Functions

static const char * getSDKVersionStr ()
 
static int32_t setEnvironment (const char *env)
 

Definitions of enumerated values related to audio effects

enum  TXVoiceReverbType
 

Type definitions of audio/video devices

enum  TXSystemVolumeType
 
enum  TXAudioRoute
 
enum  TXMediaDeviceType
 
enum  TXMediaDeviceState
 
enum  TXCameraCaptureMode
 

Video type definitions

enum  V2TXLiveVideoResolution
 
enum  V2TXLiveVideoResolutionMode
 
enum  V2TXLiveMirrorType
 
enum  V2TXLiveFillMode
 
enum  V2TXLiveRotation
 
enum  V2TXLivePixelFormat
 
enum  V2TXLiveBufferType
 

Audio type definitions

enum  V2TXLiveAudioQuality
 

Definitions of connection-status-related enumerated values

enum  V2TXLivePushStatus
 

Definition of playback-status-related enumeration values

enum  V2TXLivePlayStatus
 
enum  V2TXLiveStatusChangeReason
 

Definitions of common configuration components

enum  V2TXLiveImageType
 

Screen Sharing Definitions

enum  V2TXLiveScreenCaptureSourceType
 

Enumeration Type Documentation

◆ TXAudioRoute

Audio route (the route via which audio is played)

Audio route is the route (speaker or receiver) via which audio is played. It applies only to mobile devices such as mobile phones. A mobile phone has two speakers: one at the top (receiver) and the other the bottom.

  • If the audio route is set to the receiver, the volume is relatively low, and audio can be heard only when the phone is put near the ear. This mode has a high level of privacy and is suitable for answering calls.
  • If the audio route is set to the speaker, the volume is relatively high, and there is no need to put the phone near the ear. This mode enables the "hands-free" feature.
Enumerator
TXAudioRouteSpeakerphone 

Speakerphone: the speaker at the bottom is used for playback (hands-free). With relatively high volume, it is used to play music out loud.

TXAudioRouteEarpiece 

Earpiece: the receiver at the top is used for playback. With relatively low volume, it is suitable for call scenarios that require privacy.

◆ TXCameraCaptureMode

Camera acquisition preferences

This enum is used to set camera acquisition parameters.

Enumerator
TXCameraResolutionStrategyAuto 

Auto adjustment of camera capture parameters. SDK selects the appropriate camera output parameters according to the actual acquisition device performance and network situation, and maintains a balance between device performance and video preview quality.

TXCameraResolutionStrategyPerformance 

Give priority to equipment performance. SDK selects the closest camera output parameters according to the user's encoder resolution and frame rate, so as to ensure the performance of the device.

TXCameraResolutionStrategyHighQuality 

Give priority to the quality of video preview. SDK selects higher camera output parameters to improve the quality of preview video. In this case, it will consume more CPU and memory to do video preprocessing.

TXCameraCaptureManual 

Allows the user to set the width and height of the video captured by the local camera.

◆ TXMediaDeviceState

Device operation

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

Enumerator
TXMediaDeviceStateAdd 

The device has been plugged in.

TXMediaDeviceStateRemove 

The device has been removed.

TXMediaDeviceStateActive 

The device has been enabled.

◆ TXMediaDeviceType

Device type (for desktop OS)

This enumerated type defines three types of audio/video devices, namely camera, mic and speaker, so that you can use the same device management API to manage three types of devices.

Enumerator
TXMediaDeviceTypeUnknown 

undefined device type

TXMediaDeviceTypeMic 

microphone

TXMediaDeviceTypeSpeaker 

speaker or earpiece

TXMediaDeviceTypeCamera 

camera

◆ TXSystemVolumeType

System volume type (for mobile devices only)

Smartphones usually have two types of system volume: call volume and media volume.

  • Call volume is designed for call scenarios. It comes with acoustic echo cancellation (AEC) and supports audio capturing by Bluetooth earphones, but its sound quality is average. If you cannot turn the volume down to 0 (i.e., mute the phone) using the volume buttons, then your phone is using call volume.
  • Media volume is designed for media scenarios such as music playback. AEC does not work when media volume is used, and Bluetooth earphones cannot be used for audio capturing. However, media volume delivers better music listening experience. If you are able to mute your phone using the volume buttons, then your phone is using media volume.

The SDK offers three system volume control modes: auto, call volume, and media volume.

Enumerator
TXSystemVolumeTypeAuto 

Auto: In the auto mode, call volume is used for anchors, and media volume for audience. This mode is suitable for live streaming scenarios.

TXSystemVolumeTypeMedia 

Media volume: In this mode, media volume is used in all scenarios. It is rarely used, mainly suitable for music scenarios with demanding requirements on audio quality. Use this mode if most of your users use peripheral devices such as audio cards. Otherwise, it is not recommended.

TXSystemVolumeTypeVOIP 

Call volume: In this mode, the audio module does not change its work mode when users switch between anchors and audience, enabling seamless mic on/off. This mode is suitable for scenarios where users need to switch frequently between anchors and audience.

◆ TXVoiceReverbType

Reverb effects

Reverb effects can be applied to human voice. Based on acoustic algorithms, they can mimic voice in different environments. The following effects are supported currently: 0: original; 1: karaoke; 2: room; 3: hall; 4: low and deep; 5: resonant; 6: metal; 7: husky; 8: ethereal; 9: studio; 10: melodious

Enumerator
TXLiveVoiceReverbType_0 

Disable.

TXLiveVoiceReverbType_1 

Karaoke.

TXLiveVoiceReverbType_2 

Room.

TXLiveVoiceReverbType_3 

Hall.

TXLiveVoiceReverbType_4 

Low and deep.

TXLiveVoiceReverbType_5 

Resonant.

TXLiveVoiceReverbType_6 

Metal.

TXLiveVoiceReverbType_7 

Husky.

TXLiveVoiceReverbType_8 

ethereal

TXLiveVoiceReverbType_9 

studio

TXLiveVoiceReverbType_10 

melodious

◆ V2TXLiveAudioQuality

Audio quality.

Enumerator
V2TXLiveAudioQualitySpeech 

Audio: 16k sample rate, mono-channel, 16 Kbps audio raw bitrate. This quality is suitable for scenarios that mainly involve voice calls, such as online meetings and voice calls.

V2TXLiveAudioQualityDefault 

General: 48k sample rate, mono-channel, 50 Kbps audio raw bitrate. This quality is the default audio quality of the SDK. We recommend that you choose this option unless you have special requirements.

V2TXLiveAudioQualityMusic 

Music: 48k sample rate, dual-channel + full-band, 128 Kbps audio raw bitrate. This quality is suitable for scenarios that require Hi-Fi music transmission, such as karaoke and music livestreams.

◆ V2TXLiveBufferType

Video data transfer method.

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

Unknown.

V2TXLiveBufferTypeByteBuffer 

Use memory buffer to transfer video data.

◆ V2TXLiveCode

Enumerator
V2TXLIVE_OK 

No error.

V2TXLIVE_ERROR_FAILED 

Unclassified error.

V2TXLIVE_ERROR_INVALID_PARAMETER 

An invalid parameter was input during the API call.

V2TXLIVE_ERROR_REFUSED 

The API call was rejected.

V2TXLIVE_ERROR_NOT_SUPPORTED 

The API is currently not suppoted.

V2TXLIVE_ERROR_INVALID_LICENSE 

Failed to call the API because the license was invalid.

V2TXLIVE_ERROR_REQUEST_TIMEOUT 

The server request timed out.

V2TXLIVE_ERROR_SERVER_PROCESS_FAILED 

The server cannot process the request.

V2TXLIVE_WARNING_NETWORK_BUSY 

Data upload was jammed because the upstream bandwidth was too low.

V2TXLIVE_WARNING_VIDEO_BLOCK 

Blocking occurred during video playback.

V2TXLIVE_WARNING_CAMERA_START_FAILED 

Failed to start the camera.

V2TXLIVE_WARNING_CAMERA_OCCUPIED 

The camera is being occupied.

V2TXLIVE_WARNING_CAMERA_NO_PERMISSION 

The camera is not authorized. This warning usually occurs on mobile devices due to the camera permission is denied by the user.

V2TXLIVE_WARNING_MICROPHONE_START_FAILED 

Failed to enable the mic.

V2TXLIVE_WARNING_MICROPHONE_OCCUPIED 

The mic is being used. If a call is in progress on the mobile device, the mic cannot be enabled.

V2TXLIVE_WARNING_MICROPHONE_NO_PERMISSION 

The mic is not authorized. This warning usually occurs on mobile devices due to the mic permission is denied by the user.

V2TXLIVE_WARNING_SCREEN_CAPTURE_NOT_SUPPORTED 

Screen capture is not supported in curent system.

V2TXLIVE_WARNING_SCREEN_CAPTURE_START_FAILED 

Failed to enable the screen capture.

V2TXLIVE_WARNING_SCREEN_CAPTURE_INTERRUPTED 

Screen capture is interrupted by system.

◆ V2TXLiveFillMode

Image fill mode.

Enumerator
V2TXLiveFillModeFill 

The entire screen is covered by the image, without black edges. If the aspect ratio of the image is different from that of the screen, part of the image will be cropped.

V2TXLiveFillModeFit 

The image adapts to the screen and is not cropped. If the aspect ratio of the image is different from that of the screen, black edges will appear.

◆ V2TXLiveImageType

image types.

Enumerator
V2TXLiveImageTypeFile 

support GIF、JPEG、PNG image types

V2TXLiveImageTypeBGRA32 

pixel format BGRA32

V2TXLiveImageTypeRGBA32 

pixel format RGBA32

◆ V2TXLiveMirrorType

Local camera mirror type.

Enumerator
V2TXLiveMirrorTypeAuto 

Default mirror type. Images from the front camera are mirrored, and images from the rear camera are not mirrored.

V2TXLiveMirrorTypeEnable 

Both the front and rear cameras are switched to the mirror mode.

V2TXLiveMirrorTypeDisable 

Both the front and rear cameras are switched to the non-mirror mode.

◆ V2TXLiveMode

Supported protocol.

Enumerator
V2TXLiveModeRTMP 
V2TXLiveModeRTC 

TRTC protocol.

◆ V2TXLivePixelFormat

Pixel format of video frames.

Enumerator
V2TXLivePixelFormatUnknown 

Unknown.

V2TXLivePixelFormatI420 

YUV420P I420.

V2TXLivePixelFormatBGRA32 

BGRA8888.

◆ V2TXLivePlayStatus

Livestream playback status.

Enumerator
V2TXLivePlayStatusStopped 

Stopped.

V2TXLivePlayStatusPlaying 

Playing.

V2TXLivePlayStatusLoading 

Loading(The loading event will not be called back when the player loads for the first time)

◆ V2TXLivePushStatus

Livestream connection status.

Enumerator
V2TXLivePushStatusDisconnected 

Disconnected from the server.

V2TXLivePushStatusConnecting 

Connecting to the server.

V2TXLivePushStatusConnectSuccess 

Connected to the server successfully.

V2TXLivePushStatusReconnecting 

Reconnecting to the server.

◆ V2TXLiveRotation

Clockwise rotation of the video image.

Enumerator
V2TXLiveRotation0 

No rotation.

V2TXLiveRotation90 

Rotate 90 degrees clockwise.

V2TXLiveRotation180 

Rotate 180 degrees clockwise.

V2TXLiveRotation270 

Rotate 270 degrees clockwise.

◆ V2TXLiveScreenCaptureSourceType

Screen sharing target type

Enumerator
V2TXLiveScreenCaptureSourceTypeUnknown 

Unknown.

V2TXLiveScreenCaptureSourceTypeWindow 

The screen sharing target is the window of an application.

V2TXLiveScreenCaptureSourceTypeScreen 

The screen sharing target is the entire screen.

V2TXLiveScreenCaptureSourceTypeCustom 

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

◆ V2TXLiveStatusChangeReason

The reason for the livestream playback status.

Enumerator
V2TXLiveStatusChangeReasonInternal 

Internal reason.

V2TXLiveStatusChangeReasonBufferingBegin 

Start network buffering.

V2TXLiveStatusChangeReasonBufferingEnd 

End network buffering.

V2TXLiveStatusChangeReasonLocalStarted 

Start local playing.

V2TXLiveStatusChangeReasonLocalStopped 

Stop local playing.

V2TXLiveStatusChangeReasonRemoteStarted 

Start remote playing.

V2TXLiveStatusChangeReasonRemoteStopped 

Remote streaming stopped or interrupted.

V2TXLiveStatusChangeReasonRemoteOffline 

Remote streaming offline.

◆ V2TXLiveVideoResolution

Video resolution.

Enumerator
V2TXLiveVideoResolution160x160 

Resolution: 160×160. Bitrate range: 100 Kbps to 150 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution270x270 

Resolution: 270×270. Bitrate range: 200 Kbps to 300 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution480x480 

Resolution: 480×480. Bitrate range: 350 Kbps to 525 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution320x240 

Resolution: 320×240. Bitrate range: 250 Kbps to 375 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution480x360 

Resolution: 480×360. Bitrate range: 400 Kbps to 600 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution640x480 

Resolution: 640×480. Bitrate range: 600 Kbps to 900 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution320x180 

Resolution: 320×180. Bitrate range: 250 Kbps to 400 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution480x270 

Resolution: 480×270. Bitrate range: 350 Kbps to 550 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution640x360 

Resolution: 640×360. Bitrate range: 500 Kbps to 900 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution960x540 

Resolution: 960×540. Bitrate range: 800 Kbps to 1500 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution1280x720 

Resolution: 1280×720. Bitrate range: 1000 Kbps to 1800 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution1920x1080 

Resolution: 1920×1080. Bitrate range: 2500 Kbps to 3000 Kbps. Frame rate: 15 fps.

◆ V2TXLiveVideoResolutionMode

Video aspect ratio mode.

Attention
  • Landscape resolution: V2TXLiveVideoResolution640_360 + V2TXLiveVideoResolutionModeLandscape = 640x360
  • Portrait resolution: V2TXLiveVideoResolution640_360 + V2TXLiveVideoResolutionModePortrait = 360x640
Enumerator
V2TXLiveVideoResolutionModeLandscape 

Landscape resolution.

V2TXLiveVideoResolutionModePortrait 

Portrait resolution.

Function Documentation

◆ getSDKVersionStr()

static const char* liteav::getSDKVersionStr ( )
static
  1. Get the SDK version number

◆ setEnvironment()

static int32_t liteav::setEnvironment ( const char *  env)
static
  1. Set V2TXLivePremier callback interface
  2. Enables/Disables audio capture callback.
Parameters
enabletrue: enable; false (default): disable. You can use third-party tools for voice polishing when this parameter is true.
formataudio frame format
Attention
This API works only if you call it before V2TXLivePusher#startPush.
  1. Set up SDK access environment
If your application has no special requirements, please do not call this interface for setting.
Parameters
envcurrently supports two parameters "default" and "GDPR"
  • default: In the default environment, the SDK will find the best access point in the world for access.
  • GDPR: All audio and video data and quality statistics will not pass through servers in mainland China.