Enum TRTCTranscodingConfigMode
5.11 Mixtranscoding configuration mode
Namespace: trtc
Assembly: cs.temp.dll.dll
Syntax
public enum TRTCTranscodingConfigMode
Fields
Name |
Description |
TRTCTranscodingConfigMode_Manual |
Manual mode. This mode is the most flexible, allowing you to mix streams as needed, but it is the most difficult to use.
In this mode, you need to specify all the parameters in TRTCTranscodingConfig and listen for the onUserVideoAvailable() and onUserAudioAvailable() callbacks in TRTCCloudDelegate .
The callbacks keep you up to date about the users who are sending audio and video in the room so that you can modify the mixUsers parameter accordingly. Otherwise, mixtranscoding will fail.
|
TRTCTranscodingConfigMode_Template_PresetLayout |
Preset layout mode, which determines the layout of images in advance through placeholders
In this mode, you need to set the mixUsers parameter, but can use the following placeholders for userId .
$PLACE_HOLDER_REMOTE$ : the image of a remote user. You can set multiple userId to this value.
$PLACE_HOLDER_LOCAL_MAIN$ : the local camera image. You can set only one userId to this value.
$PLACE_HOLDER_LOCAL_SUB$ : the local screen sharing image. You can set only one userId to this value.
You don't need to listen for the onUserVideoAvailable() or onUserAudioAvailable() callback in TRTCCloudDelegate .
Just call setMixTranscodingConfig() once after successful room entry, and the SDK will automatically replace the placeholders with actual userId values.
|
TRTCTranscodingConfigMode_Template_PureAudio |
Audio-only mode, which is suitable for audio-only scenarios such as audio call (AudioCall ) and audio chat room (VoiceChatRoom )
You only need to set the mode once through the setMixTranscodingConfig() API after room entry, and the SDK will automatically mix the audios of all mic-on users in the room into the current user's stream.
In this mode, you only need to set audioSampleRate , audioBitrate , and audioChannels in TRTCTranscodingConfig , not mixUsers .
|
TRTCTranscodingConfigMode_Template_ScreenSharing |
Screen sharing mode, which is suitable for scenarios such as online education. This mode is supported only by the SDK for Windows and macOS.
The SDK will first build a canvas according to the target resolution you set (through the videoWidth and videoHeight parameters).
When the teacher is not sharing his or her screen, the SDK stretches the teacher’s camera image to fit the canvas. After the teacher enables screen sharing, the SDK does the same to the screen sharing image.
This ensures consistency in the resolution of mixed streams and prevents screen corruption during replay and live playback (webpage players cannot play videos with changing resolution).
Given that screen sharing images are the main content in education scenarios, publishing both the camera and screen sharing images would be a waste of bandwidth.
We recommend that you use setLocalVideoRenderCallback() to draw the camera image onto the shared screen.
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.
You can set both width and height in TRTCTranscodingConfig to 0 , and the SDK will work out an appropriate resolution based on the user’s screen size.
- 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 screen width is greater than 1920 px, the SDK will use the resolution 1920 × 1080 (16:9), 1920 × 1200 (16:10), or 1920 × 1440 (4:3).
|
TRTCTranscodingConfigMode_Unknown |
Invalid value
|