Global Function | Function Name |
---|---|
Thunder::IThunderEngine* | createEngine() |
public member functions | Function Name |
---|---|
virtual void | destroyEngine() = 0 |
virtual int | initialize(const char* appId, int sceneId, IThunderEventHandler* pHandler) = 0 |
virtual int | setArea(AREA_TYPE area) = 0 |
virtual int | joinRoom(const char* token, int tokenLen, const char* roomId, const char* uid) = 0 |
virtual int | leaveRoom() = 0 |
virtual int | updateToken(const char* token, int tokenLen) = 0 |
virtual int | setMediaMode(THUNDER_PROFILE mode) = 0 |
virtual int | setRoomMode(ROOM_CONFIG_TYPE mode) = 0 |
virtual int | setAudioConfig(AUDIO_PROFILE_TYPE profile, COMMUT_MODE commutMode, SCENARIO_MODE scenarioMode) = 0 |
virtual int | setAudioSourceType(ThunderSourceType sourceType) = 0 |
virtual int | stopLocalAudioStream(bool stop) = 0 |
virtual int | stopAllRemoteAudioStreams(bool stop) = 0 |
virtual int | stopRemoteAudioStream(const char* uid, bool stop) = 0 |
virtual int | setAudioVolumeIndication(int interval, int smooth) = 0 |
virtual int | enableLoopbackRecording(bool enabled) = 0 |
virtual int | startAudioRecording(const char* fileName, AUDIO_RECORDING_FILE_TYPE fileType, AUDIO_RECORDING_QUALITY_TYPE quality) = 0 |
virtual int | stopAudioRecording() = 0 |
virtual int | adjustRecordingSignalVolume(int volume) = 0 |
virtual int | adjustPlaybackSignalVolume(int volume) = 0 |
virtual IAudioDeviceManager* | getAudioDeviceMgr() = 0 |
virtual bool | registerAudioFrameObserver(IAudioFrameObserver* observer) = 0 |
virtual int | setRecordingAudioFrameParameters(int sampleRate, int channel, ThunderAudioRawFrameOperationMode mode, int samplesPerCall) = 0 |
virtual int | setPlaybackAudioFrameParameters(int sampleRate, int channel, ThunderAudioRawFrameOperationMode mode, int samplesPerCall) = 0 |
virtual int | setLogFilePath(const char* filePath) = 0 |
virtual int | setLogLevel(LOG_FILTER filter) = 0 |
virtual int | registerVideoFrameObserver(IVideoFrameObserver* observer) = 0 |
virtual IVideoDeviceManager* | getVideoDeviceMgr() = 0 |
virtual int | setVideoEncoderConfig(const VideoEncoderConfiguration& config) = 0 |
virtual int | setLocalVideoCanvas(const VideoCanvas& canvas) = 0 |
virtual int | setRemoteVideoCanvas(const VideoCanvas& canvas) = 0 |
virtual int | setLocalCanvasScaleMode(VideoRenderMode mode) = 0 |
virtual int | setRemoteCanvasScaleMode(VideoRenderMode mode) = 0 |
virtual int | startVideoPreview() = 0 |
virtual int | stopVideoPreview() = 0 |
virtual int | enableLocalVideoCapture(bool enabled) = 0 |
virtual int | stopLocalVideoStream(bool stop) = 0 |
virtual int | stopRemoteVideoStream(const char* uid, bool stop) = 0 |
virtual int | stopAllRemoteVideoStreams(bool stop) = 0 |
virtual int | setLocalVideoMirrorMode(ThunderVideoMirrorMode mode) = 0 |
virtual int | setVideoWatermark(const ThunderBoltImage& watermark) = 0 |
virtual int | removeVideoWatermarks() = 0 |
virtual int | setCustomAudioSource(bool bEnable, CustomAudioOptions& option) = 0 |
virtual int | pushCustomAudioFrame(const char* pData, unsigned dataLen, unsigned timeStamp) = 0 |
virtual int | setCustomVideoSource(bool bEnable, CustomVideoOptions& option) = 0 |
virtual int | pushCustomVideoFrame(const unsigned char* yuv[3], int linesize[3], unsigned timestamp) = 0 |
virtual int | addPublishOriginStreamUrl(const char* url) = 0 |
virtual int | removePublishOriginStreamUrl(const char* url) = 0 |
virtual int | setLiveTranscodingTask(const char* taskId, const LiveTranscoding& transcodingCfg) = 0 |
virtual int | removeLiveTranscodingTask(const char* taskId) = 0 |
virtual int | addPublishTranscodingStreamUrl(const char* taskId, const char* url) = 0 |
virtual int | removePublishTranscodingStreamUrl(const char* taskId, const char* url) = 0 |
virtual int | addSubscribe(const char* roomId, const char* uid) = 0 |
virtual int | removeSubscribe(const char* roomId, const char* uid) = 0 |
virtual int | enableWebSdkCompatibility(bool enabled) = 0 |
virtual int | sendUserAppMsgData(const char* msgData) = 0 |
virtual int | sendMediaExtraInfo(const char* extraData) = 0 |
virtual int | enableMixVideoExtraInfo(bool enabled) = 0 |
virtual int | startScreenCaptureForHwnd(HWND hWnd, const RECT* pRect) = 0 |
virtual int | startScreenCaptureForScreen(int screenId, const RECT* pRect) = 0 |
virtual int | updateScreenCaptureRect(const RECT* pRect) = 0 |
virtual int | stopScreenCapture() = 0 |
virtual int | pauseScreenCapture() = 0 |
virtual int | resumeScreenCapture() = 0 |
virtual int | registerVideoCaptureObserver(IVideoCaptureObserver* observer) = 0 |
virtual int | registerMediaExtraInfoObserver(IThunderMediaExtraInfoObserver* observer) = 0 |
virtual IThunderAudioPlayer* | createThunderAudioPlayer() = 0 |
virtual void | destroyThunderAudioPlayer(IThunderAudioPlayer* player) = 0 |
virtual int | getVideoEncoderParam(const VideoEncoderConfiguration& configIn, ThunderVideoEncodeParam& paramOut) = 0 |
virtual ThunderConnectionStatus | getConnectionStatus() = 0 |
virtual int | enableCaptureVolumeIndication(int interval, int moreThanThd, int lessThanThd, int smooth) = 0 |
virtual bool | checkFeatureSupport(FEATURE_SUPPORT flag) = 0 |
virtual int | setCaptureExcludeWindowList(HWND* wndList, int count) = 0 |
virtual int | enableVoiceReverb(bool enabled) = 0 |
virtual int | setReverbParameter(const ReverbParameter& parameter) = 0 |
virtual int | enableLimiter(bool enabled) = 0 |
virtual int | setLimiterParameter(const LimiterParameter& parameter) = 0 |
virtual int | enableEqualizer(bool enabled) = 0 |
virtual int | setEqualizerParameter(const EqualizerParameter& parameter) = 0 |
virtual int | setVoicePitch(float pitch) = 0 |
virtual int | enableHowlingDetector(bool enabled) = 0 |
virtual int | enableEchoDetector(bool enabled) = 0 |
public member functions | Function Name |
---|---|
virtual int | enumInputDevices(AudioDeviceList& devices) = 0 |
virtual int | setInputtingDevice(GUID& id) = 0 |
virtual int | getInputtingDevice(GUID& id) = 0 |
virtual int | setInputtingVolume(int volume) = 0 |
virtual int | getInputtingVolume(int& volume) = 0 |
virtual int | setInputtingMute(bool mute) = 0 |
virtual int | getInputtingMute(bool& mute) = 0 |
virtual int | startInputDeviceTest(int indicationInterval) = 0 |
virtual int | stopInputDeviceTest() = 0 |
virtual int | enumOutputDevices(AudioDeviceList& devices) = 0 |
virtual int | setOutputtingDevice(GUID& id) = 0 |
virtual int | getOutputtingDevice(GUID& id) = 0 |
virtual int | setOuttingVolume(int volume) = 0 |
virtual int | getOuttingVolume(int& volume) = 0 |
virtual int | setOutputtingMute(bool mute) = 0 |
virtual int | getOutputtingMute(bool& mute) = 0 |
virtual int | startOutputDeviceTest(int indicationInterval, const char* audioFileName) = 0 |
virtual int | stopOutputDeviceTest() = 0 |
virtual int | enableMicEnhancement(bool enabled) = 0 |
virtual int | enableMicDenoise(bool enabled) = 0 |
virtual int | enableAEC(bool enabled) = 0 |
virtual int | enableAGC(bool enabled) = 0 |
public member functions | Function Name |
---|---|
virtual bool | open(const char* path) = 0 |
virtual void | close() = 0 |
virtual void | play() = 0 |
virtual void | stop() = 0 |
virtual void | pause() = 0 |
virtual void | resume() = 0 |
virtual void | seek(unsigned int timeMS) = 0 |
virtual unsigned int | getTotalPlayTimeMS() = 0 |
virtual unsigned int | getCurrentPlayTimeMS() = 0 |
virtual int | setPlayerLocalVolume(int volume) = 0 |
virtual int | setPlayerPublishVolume(int volume) = 0 |
virtual int | getPlayerLocalVolume() = 0 |
virtual int | getPlayerPublishVolume() = 0 |
virtual int | setLooping(int cycle) = 0 |
virtual void | setSemitone(int val) = 0 |
virtual void | setTempo(float val) = 0 |
virtual void | setPosition(int azimuth) = 0 |
virtual void | SetFilePlayerNotify(IThunderAudioPlayerNotify* notify) = 0 |
public member functions | Function Name |
---|---|
virtual int | enumVideoDevices(VideoDeviceList& devices) = 0 |
virtual int | startVideoDeviceCapture(int deviceIdx) = 0 |
virtual int | stopVideoDeviceCapture() = 0 |
virtual int | enumMonitorDevices(MonitorDeviceList& devices) = 0 |
EXTERN_C
{
__declspec(dllimport) Thunder::IThunderEngine* createEngine();
};
Create the Thunder::IThunderEngine instance.
Note:
- It is recommended to call the IThunderEngine::initialize API immediately after createEngine is called.
- Currently, SDK supports only one IThunderEngine instance, that is, each process can only create one IThunderEngine object.
- Unless otherwise specified, all interfaces in the IThunderEngine class are called asynchronously. It is recommended that interfaces are called on the same thread.
Pointer to the Thunder::IThunderEngine object
virtual void Thunder::IThunderEngine::destroyEngine();
Destroy the Thunder::IThunderEngine instance.
virtual int Thunder::IThunderEngine::initialize(const char* appId, int sceneId, IThunderEventHandler* pHandler);
Initialize the engine.
Note:
- Only users with the same appId can communicate with each other.
- Call this interface after an instance has been created. This interface is reset only when destroyEngine is called.
Parameter | Type | Description |
---|---|---|
appId | IN | appId assigned for application program developers. It can be requested in the official website. |
sceneId | IN | Id for scenarios customized by developers. It details service scenarios and can be collected with more details based on scenarios. If not required, set it to 0. |
pHandler | IN | Pointer of the IThunderEventHandler object. SDK calls back various events for application programs through this abstract class during SDK running. |
virtual int Thunder::IThunderEngine::setArea(AREA_TYPE area);
Set country and area of users.
To accommodate to different laws and regulations at home and abroad, CS2 NETWORK provides both domestic (by default) and international central systems. Set it by referring to the following points:
Note:
- This interface takes effect only if it is called before the calling of joinRoom.
- It is necessary for abroad users but not for domestic users.
- It can only be reset when destroyEngine is performed.
Parameter | Type | Description |
---|---|---|
area | IN | Region type is domestic by default. For details about the parameter value, see AREA_TYPE. |
virtual int Thunder::IThunderEngine::joinRoom(const char* token, int tokenLen, const char* roomName, const char* uid);
Join a room.
This method lets users join the (audio/video) communication room. In the same room, users can communicate with each other, and group chat starts when multiple users join it.
If during the call, users have to call leaveRoom to leave before joining the next one.
Note:
- This API should be called after initialization (initialize).
- The applications using different appId cannot communicate with each other.
- Success returned by the function only indicates request execution success. You have joined a room successfully only if you receive the onJoinRoomSuccess notification.
Parameter | Type | Description |
---|---|---|
token | IN | Required for authentication. For details, see User Authentication Description on official website. |
tokenLen | IN | Token length |
roomName | IN | Room Id (unique for AppId) only supports the permutation and combination of characters such as [A,Z],[a,z],[0,9],-,_, with the length of not more than 64 bytes. |
uid | IN | User ID only supports the permutation and combination of characters such as [A,Z],[a,z],[0,9],-,_, with the length of not more than 64 bytes. |
virtual int Thunder::IThunderEngine::leaveRoom();
Leaving room indicates hang off or exiting conversation.
Note:
- This API should be called after initialization (initialize).
- When joinRoom is called, you have to call leaveRoom to end conversation before starting the next one. No matter whether the user is idle or in a call, leaveRoom can be called, without adverse effects. This method can release all resources related to conversation.
virtual int Thunder::IThunderEngine::updateToken(const char* token, int tokenLen);
Update token.
Note:
- This API should be called after initialization (initialize).
- Success returned by the function only indicates request execution success. You have joined a room successfully only if you receive the onJoinRoomSuccess notification.
Token is used for authentication. Recommended token format is as follows. For details, see Authentication Access Manual.
uint16 | uint32 | uint64 | uint64 | uint32 | uint16 | nBytes | 20 Bytes |
---|---|---|---|---|---|---|---|
TokenLen | AppId | uid | TimeStamp(ms) | ValidTime(s) | BizExtInfoLen | BizExtInfoData | DigitalSignature |
Refer to the following descriptions:
Parameter | Type | Description |
---|---|---|
token | IN | Required for authentication. For details, see User Authentication Description. |
tokenLen | IN | Token length |
virtual int Thunder::IThunderEngine::setMediaMode(THUNDER_PROFILE mode);
Set media format. PROFILE_NORMAL is used by SDK by default.
Note:
- This interface should be called after initialization (initialize) and before joining a room (joinRoom).
- It can only be reset when destroyEngine is performed.
Parameter | Type | Description |
---|---|---|
mode | IN | Media mode. For details about the parameter value, see Thunder::THUNDER_PROFILE. |
virtual int Thunder::IThunderEngine::setRoomMode(ROOM_CONFIG_TYPE mode);
Set room mode. ROOM_CONFIG_LIVE is used by SDK by default.
Note:
- This interface should be called after initialization (initialize) and before joining a room (joinRoom).
- It can only be reset when destroyEngine is performed.
Parameter | Type | Description |
---|---|---|
mode | IN | Room mode. For details about the parameter value, see Thunder::ROOM_CONFIG_TYPE. |
virtual int Thunder::IThunderEngine::setAudioConfig(AUDIO_PROFILE_TYPE profile, COMMUT_MODE commutMode, SCENARIO_MODE scenarioMode);
Set audio parameters and application scenarios.
Note:
- Call it before playing audio stopLocalAudioStream .
- It can only be reset when destroyEngine is performed.
Parameter | Type | Description |
---|---|---|
profile | IN | Audio type. For details about the parameter value, see Thunder::AUDIO_PROFILE_TYPE. |
commuMode | IN | Communication mode. For details about the parameter value, see Thunder::COMMUT_MODE. |
scenarioMode | IN | Scenario mode. For details about the parameter value, see Thunder::SCENARIO_MODE. |
virtual int Thunder::IThunderEngine::setAudioSourceType(ThunderSourceType sourceType);
Set audio publishing type.
Note:
- It can only be reset when destroyEngine is performed.
Parameter | Type | Description |
---|---|---|
sourceType | IN | Audio publishing mode. For details about the parameter value, see Thunder::ThunderSourceType. |
virtual int Thunder::IThunderEngine::stopLocalAudioStream(bool stop);
Stop broadcasting/Publish audio (including starting capture, encoding, and stream publishing).
Note:
- Call this API after joining the room by calling (joinRoom).
Parameter | Type | Description |
---|---|---|
Stop | IN | true: Close local audio; false: Open local audio |
virtual int Thunder::IThunderEngine::stopAllRemoteAudioStreams(bool stop);
Stop/Receive all audio data. Process this interface based on the following rules:
Note:
- This API should be called after initialization (initialize). This interface is reset only when destroyEngine is called.
- Determine whether to receive or disable remote users. Check the value of stopRemoteAudioStream first. If no value is found, use the value of this function.
Parameter | Type | Description |
---|---|---|
Stop | IN | true: Close local audio; false: Open local audio |
virtual int Thunder::IThunderEngine::stopRemoteAudioStream(const char* uid, bool stop);
Stop/Receive audio data of specified users.
Note:
- Call this API after joining the room by calling (joinRoom). This interface is reset only when destroyEngine is called.
- Determine whether to receive or disable remote users. Check the value of this function first. If no value is found, use the value of stopRemoteAudioStream.
Parameter | Type | Description |
---|---|---|
uid | IN | User UID |
Stop | IN | true: Stop user audio, false: Receive user audio |
virtual int Thunder::IThunderEngine::setAudioVolumeIndication(int interval, int smooth);
Enable volume indication for speaker. This method allows SDK to return current speaker and speaker volume to application programs regularly.
Note:
- This API should be called after initialization (initialize). This interface is reset only when destroyEngine is called.
- After this method is called, an onPlayVolumeIndication notification will be received once anyone speaks in the room
- The volume carried in the notification does not include sound volume collected by the local microphone or played by files.
Parameter | Type | Description |
---|---|---|
interval | IN | Notification interval. The default value is 0 <=0: The volume prompt is disabled >0: Notification interval, unit: ms (a value greater than 200 is recommended) |
smooth | IN | Smooth coefficient, not realized currently |
virtual int Thunder::IThunderEngine::enableLoopbackRecording(bool enabled);
Enable/Disable graphic card collection.
Note:
- This API should be called after initialization (initialize). This interface is reset only when destroyEngine is called.
Parameter | Type | Description |
---|---|---|
enabled | IN | true: Start graphic card collection; false: Stop graphic card collection |
virtual int Thunder::IThunderEngine::startAudioRecording(const char* fileName,
AUDIO_RECORDING_FILE_TYPE fileType,
AUDIO_RECORDING_QUALITY_TYPE quality);
Start audio recording.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
fileName | IN | Recording file name (complete path, not including filename extension, the filename extension is generated based on fileType) |
fileType | IN | File format. For details about the parameter value, see Thunder::AUDIO_RECORDING_FILE_TYPE. |
quality | IN | Recording quality. For details about the parameter value, see Thunder::AUDIO_RECORDING_QUALITY_TYPE. |
virtual int Thunder::IThunderEngine::stopAudioRecording();
Stop audio recording.
Note:
- This API should be called after initialization (initialize).
virtual int Thunder::IThunderEngine::adjustRecordingSignalVolume(int volume);
Set recording volume.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
volume | IN | Volume range, which is [0--400.] |
virtual int Thunder::IThunderEngine::adjustPlaybackSignalVolume(int volume);
Set playing volume.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
volume | IN | Volume range, which is [0--400.] |
virtual Thunder::IAudioDeviceManager* Thunder::IThunderEngine::getAudioDeviceMgr();
Obtain the instance object of the audio device management interface.
Note:
- This API should be called after initialization (initialize).
virtual int Thunder::IThunderEngine::registerAudioFrameObserver(IAudioFrameObserver* observer);
Register audio frame data observer IAudioFrameObserver.
Note:
- This API should be called after initialization (initialize).
- The user must inherit the IAudioFrameObserver interface class and implement the virtual methods. These methods will be used to call related original audio data.
Parameter | Type | Description |
---|---|---|
observer | IN | Pointer of the IAudioFrameObserver interface class Registration is canceled if it is set to null. |
virtual int Thunder::IThunderEngine::setRecordingAudioFrameParameters(int sampleRate,
int channel,
ThunderAudioRawFrameOperationMode mode,
int samplesPerCall);
Set the mode for using raw audio recording data during callback onRecordAudioFrame
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
sampleRate | IN | Sampling rate |
channel | IN | Audio track; 1: Single track; 2: dual track |
mode | IN | Mode of using onRecordAudioFrame. For details about the parameter value, see Thunder::ThunderAudioRawFrameOperationMode. |
samplesPerCall | IN | Specify sampling point number for data return in onRecordAudioFrame , e.g. 1024 in transcoding publish stream. samplesPerCall = (int)(sampleRate × sampleInterval), in which: sampleInterval ≥ 0.01, in seconds. |
virtual int Thunder::IThunderEngine::setPlaybackAudioFrameParameters(int sampleRate,
int channel,
ThunderAudioRawFrameOperationMode mode,
int samplesPerCall);
Set the mode for using raw audio playback data during callback onPlaybackAudioFrame
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
sampleRate | IN | Sampling rate |
channel | IN | Audio track; 1: Single track; 2: dual track |
mode | IN | Mode of using onPlaybackAudioFrame. For details about the parameter value, see Thunder::ThunderAudioRawFrameOperationMode. |
samplesPerCall | IN | Sampling number of returned data in specified onPlaybackAudioFrame. For example, the value is 1024 in transcoding and stream publishing. samplesPerCall = (int)(sampleRate × sampleInterval), in which: sampleInterval ≥ 0.01, in seconds. |
virtual int Thunder::IThunderEngine::setLogFilePath(const char* filePath);
Set directory for SDK to output log files.
Note:
- Ensure that the specified directory has write permission.
Parameter | Type | Description |
---|---|---|
filePath | IN | Complete list of log files |
virtual int Thunder::IThunderEngine::setLogLevel(LOG_FILTER filter);
Set the log storage level. Logs with lower level (LogLevel) will be filtered. Only logs with the log level indicated by this value or higher than this value are recorded.
Parameter | Type | Description |
---|---|---|
filter | IN | For details about the log filtering level, see Thunder::LOG_FILTER. |
virtual int Thunder::IThunderEngine::registerVideoFrameObserver(IVideoFrameObserver* observer);
Register video frame data observer IVideoFrameObserver.
Note:
- This API should be called after initialization (initialize).
- The user must inherit the IVideoFrameObserver interface class and implement the virtual methods. These methods will be used to call related original video data.
Parameter | Type | Description |
---|---|---|
observer | IN | Pointer of the IVideoFrameObserver interface class Registration is canceled if it is set to null. |
virtual Thunder::IVideoDeviceManager* Thunder::IThunderEngine::getVideoDeviceMgr();
Register video frame data observer IVideoFrameObserver.
Note:
- This API should be called after initialization (initialize).
virtual int Thunder::IThunderEngine::setVideoEncoderConfig(const VideoEncoderConfiguration& config);
Set video encoding configuration. Detailed description:
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
config | IN | Specific code configuration. For details about the parameter value, see Thunder::VideoEncoderConfiguration. |
virtual int Thunder::IThunderEngine::setLocalVideoCanvas(const VideoCanvas& canvas);
Set the rendering view of the local video.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
canvas | IN | Reference of rendering object VideoCanvas |
virtual int Thunder::IThunderEngine::setRemoteVideoCanvas(const VideoCanvas& canvas);
Set the rendering view of the remote video.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
canvas | IN | Reference of rendering object VideoCanvas |
virtual int Thunder::IThunderEngine::setLocalCanvasScaleMode(VideoRenderMode mode);
Set local view display mode.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
mode | IN | Rendering mode. For details about the parameter value, see Thunder::VideoRenderMode |
virtual int Thunder::IThunderEngine::setRemoteCanvasScaleMode(VideoRenderMode mode);
Set the remote play type.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
mode | IN | Rendering mode. For details about the parameter value, see Thunder::VideoRenderMode |
virtual int Thunder::IThunderEngine::startVideoPreview();
Start camera video preview.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
mode | IN | Rendering mode. For details about the parameter value, see Thunder::VideoRenderMode |
virtual int Thunder::IThunderEngine::stopVideoPreview();
Stop camera video preview.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
mode | IN | Rendering mode. For details about the parameter value, see Thunder::VideoRenderMode |
virtual int Thunder::IThunderEngine::enableLocalVideoCapture(bool enabled);
Enable/Disable local video capture.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
enabled | IN | true: Enable local video capture; false: Disable local video capture |
virtual int Thunder::IThunderEngine::stopLocalVideoStream(bool stop);
Enable/Disable local video sending.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
Stop | IN | True: Disable local video sending; false: Enable local video sending |
virtual int Thunder::IThunderEngine::stopRemoteVideoStream(const char* uid, bool stop);
Stop/Receive designated remote video.
Note:
- This API should be called after initialization (initialize). This interface is reset only when destroyEngine is called
- Determine whether to receive or disable remote users. Check the value of this function first. If no value is found, use the value of stopAllRemoteVideoStreams
Parameter | Type | Description |
---|---|---|
uid | IN | User id |
Stop | IN | true: Stop remote video of a specified user; false: Receive remote video of a specified user |
virtual int Thunder::IThunderEngine::stopAllRemoteVideoStreams(bool stop);
Stop/Receive all remote videos.
Note:
- This API should be called after initialization (initialize). This interface is reset only when destroyEngine is called.
- Determine whether to receive or disable remote users. Check the value of stopRemoteVideoStream first. If no value is found, use the value of this function
Parameter | Type | Description |
---|---|---|
Stop | IN | true: Stop all remote video; false; Receive all remote video. The default value is false |
virtual int Thunder::IThunderEngine::setLocalVideoMirrorMode(ThunderVideoMirrorMode mode);
Set local video mirror mode
Note:
- This API should be called after initialization (initialize). This interface is reset only when destroyEngine is called.
- Set the mirror mode for local preview and that visible to viewers respectively.
Parameter | Type | Description |
---|---|---|
mode | IN | Mirror mode. For details about the parameter value, see Thunder::ThunderVideoMirrorMode |
virtual int Thunder::IThunderEngine::setVideoWatermark(const Thunder::ThunderBoltImage& watermark);
Add local video watermark.
Note:
- This API should be called after initialization (initialize).
- Currently, only one watermark is supported. A newly added watermark will replace the existing one.
- Only 24-bit and 32-bit pictures are supported. SDK will transform the pictures to the configured width.
Parameter | Type | Description |
---|---|---|
watermark | IN | Reference of watermark picture object to be added to local live streaming push. For details about the picture format, see Thunder::ThunderBoltImage |
virtual int Thunder::IThunderEngine::removeVideoWatermarks();
Remove the local video watermark added.
Note:
- This API should be called after initialization (initialize).
virtual int Thunder::IThunderEngine::setCustomAudioSource(bool bEnable, CustomAudioOptions& option);
Set parameters for external audio capture.
Note:
- This interface should be called after you perform initialization (initialize) and before you call (stopLocalAudioStream(false) to publish audio.
Parameter | Type | Description |
---|---|---|
bEnable | IN | true: enable external audio capture false: disable external audio capture (by default) |
option | IN | External audio capture parameter. It is the reference of CustomAudioOptions |
virtual int Thunder::IThunderEngine::pushCustomAudioFrame(const char* pData, unsigned dataLen, unsigned timeStamp);
Push external audio frame.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
pData | IN | PCM audio frame data |
dataLen | IN | Data length |
timeStamp | IN | Capture timestamp |
virtual int Thunder::IThunderEngine::setCustomVideoSource(bool bEnable, CustomVideoOptions& option)
Set parameters for external video capture.
Note:
- This interface should be called after you perform initialization (initialize) and before you call (stopLocalVideoStream(false)) to publish video.
Parameter | Type | Description |
---|---|---|
bEnable | IN | true: enable external audio capture false: disable external audio capture (by default) |
option | IN | External video capture parameter. It is the reference of CustomVideoOptions |
virtual int Thunder::IThunderEngine::pushCustomVideoFrame(const unsigned char* yuv[3], int linesize[3], unsigned timestamp);
Push external video frame.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
yuv | IN | YUV video data |
linesize | IN | Line size of the buffer zone in YUV data |
timestamp | IN | Capture timestamp |
virtual int Thunder::IThunderEngine::addPublishOriginStreamUrl(const char* url);
Add the source stream publishing address.
Note:
- This interface is called only if you need to join a room (joinRoom). The configuration will be cleaned after you leave the room.
- A maximum of 5 addresses are supported for stream publishing
Parameter | Type | Description |
---|---|---|
url | IN | Stream publishing address, in RTMP format. The value does not support special characters including Chinese and the length cannot exceed 512 bytes. Note: Some CDN manufacturers may not support the 512 bytes, for instance, Aliyun supports merely 256 bytes. |
virtual int Thunder::IThunderEngine::removePublishOriginStreamUrl(const char* url);
Remove the source stream publishing address.
Parameter | Type | Description |
---|---|---|
url | IN | Stream publishing address, in RTMP format. The value does not support special characters including Chinese and the length cannot exceed 512 bytes. Note: Some CDN manufacturers may not support the 512 bytes, for instance, Aliyun supports merely 256 bytes. |
virtual int Thunder::IThunderEngine::setLiveTranscodingTask(const char* taskId, const LiveTranscoding& transcodingCfg);
Add/update transcoding task.
Note:
- This interface is called only if you need to join a room (joinRoom). The configuration will be cleaned after you leave the room.
Parameter | Type | Description |
---|---|---|
taskId | IN | Transcoding task ID, which is unique in a room and is managed by users |
transcodingCfg | IN | Specific transcoding layout. For details, see Thunder::LiveTranscoding |
virtual int Thunder::IThunderEngine::removeLiveTranscodingTask(const char* taskId);
Remove a transcoding task.
Note:
- This interface is called only if you need to join a room (joinRoom). The configuration will be cleaned after you leave the room.
Parameter | Type | Description |
---|---|---|
taskId | IN | Transcoding task ID, which is unique in a room and is managed by users |
virtual int Thunder::IThunderEngine::addPublishTranscodingStreamUrl(const char* taskId, const char* url);
Add a stream publishing address of a transcoding stream.
Note:
- This interface is called only if you need to join a room (joinRoom). The configuration will be cleaned after you leave the room.
Parameter | Type | Description |
---|---|---|
taskId | IN | Transcoding task ID |
url | IN | Stream publishing address, in RTMP format. The value does not support special characters including Chinese and the length cannot exceed 512 bytes. Note: Some CDN manufacturers may not support the 512 bytes, for instance, Aliyun supports merely 256 bytes. |
virtual int Thunder::IThunderEngine::removePublishTranscodingStreamUrl(const char* taskId, const char* url);
Remove stream publishing address for transcoding stream.
Note:
- This interface is called only if you need to join a room (joinRoom). The configuration will be cleaned after you leave the room.
Parameter | Type | Description |
---|---|---|
taskId | IN | Transcoding task ID |
url | IN | Stream publishing address, in RTMP format. The value does not support special characters including Chinese and the length cannot exceed 512 bytes. Note: Some CDN manufacturers may not support the 512 bytes, for instance, Aliyun supports merely 256 bytes. |
virtual int Thunder::IThunderEngine::addSubscribe(const char* roomId, const char* uid);
Subscribe to specific streams (cross-room).
Note:
- This interface is called only if you need to join a room (joinRoom). The configuration will be cleaned after you leave the room.
Parameter | Type | Description |
---|---|---|
roomId | IN | Room ID [which only supports the permutation and combination of characters such as [A,Z],[a,z],[0,9],-,_, with the length of not more than 64 bytes] |
uid | IN | User ID |
virtual int Thunder::IThunderEngine::removeSubscribe(const char* roomId, const char* uid);
Unsubscribe specified streams.
Note:
- This interface is called only if you need to join a room (joinRoom). The configuration will be cleaned after you leave the room.
Parameter | Type | Description |
---|---|---|
roomId | IN | Room ID [which only supports the permutation and combination of characters such as [A,Z],[a,z],[0,9],-,_, with the length of not more than 64 bytes] |
uid | IN | User ID |
virtual int Thunder::IThunderEngine::enableWebSdkCompatibility(bool enabled);
Enable/Disable WebSDK compatibility.
Note:
- This API should be called after initialization (initialize). This interface is reset only when destroyEngine is called
- This method is applicable only to the live streaming scenario. Microphone connection is compatible with Web SDK by default, without calling this method.
- Enable compatibility with WebSDK in live streaming. This interface must be called before publishing, which is irrelevant with entering or leaving the room.
Parameter | Type | Description |
---|---|---|
enabled | IN | Whether compatibility is enabled. Disabled by default |
virtual int Thunder::IThunderEngine::sendUserAppMsgData(const char* msgData);
Send custom broadcast message of service.
This interface sends messages via media UDP channel with features of low-lantency and unreliability. Specified constraints are as follows:
Note:
- This interface is called only if you need to join a room (joinRoom). The configuration will be cleaned after you leave the room.
Parameter | Type | Description |
---|---|---|
msgData | IN | Service customized broadcast message |
virtual int Thunder::IThunderEngine::sendMediaExtraInfo(const char* extraData);
Send media extra information (audio/video has been published). Usage description:
Note:
- This interface is called only if you need to join a room (joinRoom). The configuration will be cleaned after you leave the room.
Parameter | Type | Description |
---|---|---|
extraData | IN | Media extra information |
virtual int Thunder::IThunderEngine::enableMixVideoExtraInfo(bool enabled);
Enable video mixing with media extra information.
Note:
- This interface is called only if you need to join a room (joinRoom). The configuration will be cleaned after you leave the room.
Parameter | Type | Description |
---|---|---|
enabled | IN | The default value is false. true: Enable video mixing with media extra information; false: Disable video mixing with media extra information. |
virtual int Thunder::IThunderEngine::startScreenCaptureForHwnd(HWND hWnd, const RECT* pRect);
Start capturing specific screen.
Parameter | Type | Description |
---|---|---|
hWnd | IN | Window handle |
pRect | IN | Sub region captured from a window. The coordinates are relative values. The coordinate of the point in the upper left corner is (0,0). The entire window is captured if the value is NULL. |
virtual int Thunder::IThunderEngine::startScreenCaptureForScreen(int screenId = 0, const RECT* pRect);
Start capturing specific region on desktop.
Parameter | Type | Description |
---|---|---|
screenId | IN | Monitor ID |
pRect | IN | Sub region specified for capturing. The coordinate is a relative value of the monitor. The entire monitor screen is captured when this parameter is set to NULL. |
virtual int Thunder::IThunderEngine::updateScreenCaptureRect(const RECT* pRect);
Update the displayed region for capturing.
Parameter | Type | Description |
---|---|---|
pRect | IN | Sub region specified for capturing. The coordinate is a relative value of the monitor or screen. The entire monitor screen or window is captured when this parameter is set to NULL. |
virtual int Thunder::IThunderEngine::stopScreenCapture();
Stop capturing the desktop or window.
virtual int Thunder::IThunderEngine::pauseScreenCapture();
Pause capturing the desktop or window.
virtual int Thunder::IThunderEngine::resumeScreenCapture(const char* roomId, const char* uid);
Resume capturing the desktop or window.
virtual int Thunder::IThunderEngine::registerVideoCaptureObserver(IVideoCaptureObserver* observer);
Register observer object for collecting data of camera.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
observer | IN | Pointer of the IVideoCaptureObserver object. If observer is NULL, monitoring is canceled. |
virtual int Thunder::IThunderEngine::registerMediaExtraInfoObserver(IThunderMediaExtraInfoObserver* observer);
Register the observer object of media extra information.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
observer | IN | Pointer of the IThunderMediaExtraInfoObserver object. If observer is NULL, monitoring is canceled. |
virtual IThunderAudioPlayer* Thunder::IThunderEngine::createThunderAudioPlayer();
Create an object for audio file player. For details, see IThunderAudioPlayer.
virtual int Thunder::IThunderEngine::destroyThunderAudioPlayer(IThunderAudioPlayer* player);
Destroy audio file player.
Parameter | Type | Description |
---|---|---|
player | IN | Pointer of the IThunderAudioPlayer object |
virtual int getVideoEncoderParam(const VideoEncoderConfiguration& configIn, ThunderVideoEncodeParam& paramOut);
Get encoding parameters by video encoding configuration.
Parameter | Type | Description |
---|---|---|
configIn | IN | VideoEncoderConfiguration Encoding configuration |
paramOut | OUT | ThunderVideoEncodeParam Encoding parameters |
virtual ThunderConnectionStatus getConnectionStatus();
Get the current network connection status.
virtual int enableCaptureVolumeIndication(int interval, int moreThanThd, int lessThanThd, int smooth);
Enable callback of volume capture.
Parameter | Type | Description |
---|---|---|
interval | IN | <=0: disable volume prompt >0: callback interval, unit: millisecond |
moreThanThd | IN | call back when |
lessThanThd | IN | call back when >=lessThanThd to <lessThanThd; <=0 invalid |
smooth | IN | Reserved |
virtual bool checkFeatureSupport(FEATURE_SUPPORT flag);
Whether it support a specific feature.
Parameter | Type | Description |
---|---|---|
flag | IN | FEATURE_SUPPORT a specific feature, for example, check whether it supports capturing Magnification API by calling FEATURE_SUPPORT_MAGAPI. |
virtual int setCaptureExcludeWindowList(HWND* wndList, int count);
List of windows to be excluded when setting screen capture.
Caution:
- Call this API after calling checkFeatureSupport to check whether it supports filtering windows.
Parameter | Type | Description |
---|---|---|
wndList | IN | List of windows to be excluded |
count | IN | Number of windows to be excluded |
virtual int enableVoiceReverb(bool enabled);
Enable/disable local voice reverberation.
Note:
This API should be called after initialization and reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
enabled | IN | "true"-enable, "false"-disable (default) |
virtual int setReverbParameter(const ReverbParameter& parameter);
Sets the local voice reverberation parameters.
Note:
This API should be called after initialization and reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
parameter | IN | Reverberation parameters |
virtual int enableLimiter(bool enabled);
Enable/disable the limiter.
Note:
This API should be called after initialization and reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
enabled | IN | "true"-enable, "false"-disable (default) |
virtual int setLimiterParameter(const LimiterParameter& parameter);
Set limiter parameters.
Note:
This API should be called after initialization and reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
parameter | IN | Limiter parameters, see details in LimiterParameter |
virtual int enableEqualizer(bool enabled);
Enable or disable the equalizer.
Note:
This API should be called after initialization and reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
enabled | IN | "true"-enable, "false"-disable(default) |
virtual int setEqualizerParameter(const EqualizerParameter& parameter);
Set equalizer parameters.
Note:
This API should be called after initialization and reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
parameter | IN | Equalizer parameters, see details in EqualizerParameter |
virtual int setVoicePitch(float pitch);
Set voice pitch parameters.
Note:
- This API should be called after initialization and reset by calling destroyEngine.
- The samller the value, the lower the pitch.
Parameter | Type | Description |
---|---|---|
pitch | IN | Voice pitch, range: [-12, 12], default: 0 |
virtual int enableHowlingDetector(bool enabled);
Enable or disable howling detection.
Note:
This API should be called after initialization and reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
enabled | IN | Whether to enable howling detection: "true"-enable, "false"(default)-disable |
virtual int enableEchoDetector(bool enabled);
Enable/disable echo detection.
Note:
This API should be called after initialization and reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
enabled | IN | Whether to enable echo detection: "true"-enable, "false"(default)-disable |
virtual int Thunder::IAudioDeviceManager::enumInputDevices(AudioDeviceList& devices);
Enumerate audio input devices.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
devices | OUT | Information about the audio device. For details, see AudioDeviceList |
virtual int Thunder::IAudioDeviceManager::setInputtingDevice(GUID& id);
Set audio input devices.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
id | IN | Unique descriptor for a device |
virtual int Thunder::IAudioDeviceManager::getInputtingDevice(GUID& id);
Obtain the currently selected input device.
Note:
This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
id | OUT | Unique descriptor for a device |
virtual int Thunder::IAudioDeviceManager::setInputtingVolume(int volume);
Set the volume of the current audio input device.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
volume | IN | Volume value [0-400] |
virtual int Thunder::IAudioDeviceManager::getInputtingVolume(int volume);
Obtain the volume of the current audio input device.
Note:
- This API should be called after initialization initialize.
Parameter | Type | Description |
---|---|---|
volume | OUT | Volume value [0-400] |
virtual int Thunder::IAudioDeviceManager::setInputtingMute(bool mute);
Mute the current audio input device.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
mute | IN | true: mute; false: unmute |
virtual int Thunder::IAudioDeviceManager::getInputtingMute(bool& mute);
Obtain the mute status of the current audio input device.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
mute | OUT | true: mute; false: unmute |
virtual int Thunder::IAudioDeviceManager::startInputDeviceTest(int indicationInterval);
Start testing the current audio input device.
Note:
- This API should be called after initialization (initialize).
- After calling this interface, you will receive an onInputVolume notification.
Parameter | Type | Description |
---|---|---|
indicationInterval | IN | Check interval. The default value is 0. |
virtual int Thunder::IAudioDeviceManager::stopInputDeviceTest();
Stop testing the current audio input device.
Note:
- This API should be called after initialization (initialize).
virtual int Thunder::IAudioDeviceManager::enumOutputDevices(AudioDeviceList& devices);
Enumerate audio playback devices.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
devices | OUT | List of audio playback devices. For details, see AudioDeviceList. |
virtual int Thunder::IAudioDeviceManager::setOutputtingDevice(GUID& id);
Specify the audio playback device.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
id | IN | Unique descriptor for a device |
virtual int Thunder::IAudioDeviceManager::getOutputtingDevice(GUID& id);
Obtain the current audio playback device.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
id | OUT | Unique descriptor for a device |
virtual int Thunder::IAudioDeviceManager::setOuttingVolume(int volume);
Set the volume of the current playback device.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
volume | IN | Volume value [0-100] |
virtual int Thunder::IAudioDeviceManager::getOuttingVolume(int& volume);
Obtain the volume of the current playback device.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
volume | OUT | Volume value [0-100] |
virtual int Thunder::IAudioDeviceManager::setOutputtingMute(bool mute);
Mute/Unmute the current playback device.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
mute | IN | true: mute; false: unmute |
virtual int Thunder::IAudioDeviceManager::getOutputtingMute(bool& mute);
Obtain the mute status of the current playback device.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
mute | OUT | true: mute; false: unmute |
virtual int Thunder::IAudioDeviceManager::startOutputDeviceTest(int indicationInterval, const char* audioFileName);
Start testing the current playback device.
Note:
- This API should be called after initialization (initialize).
- Calling the setOutputtingDevice interface will also terminate the test.
Parameter | Type | Description |
---|---|---|
indicationInterval | IN | Check interval. The default value is 0. |
audioFileName | IN | Full path of the audio file that is played. Win7 and higher support mp3, aac, and wave formats while versions earlier than Win7 support only the wav format. |
virtual int Thunder::IAudioDeviceManager::stopOutputDeviceTest();
Stop testing the current audio playback device.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
roomId | IN | Room ID [which only supports the permutation and combination of characters such as [A,Z],[a,z],[0,9],-,_, with the length of not more than 64 bytes] |
uid | IN | User ID |
virtual int Thunder::IAudioDeviceManager::enableMicEnhancement(bool enabled);
Enable/Disable microphone enhancement.
Note:
- This API should be called after initialization (initialize). This interface is reset only when destroyEngine is called
Parameter | Type | Description |
---|---|---|
enabled | IN | true: Enable microphone enhancement; false: Disable microphone enhancement. The default value is false. |
virtual int Thunder::IAudioDeviceManager::enableMicDenoise(bool enabled);
Enable/Disable microphone noise reduction.
Note:
- This API should be called after initialization (initialize). This interface is reset only when destroyEngine is called
Parameter | Type | Description |
---|---|---|
enabled | IN | true: Enable microphone noise reduction; false: Disable microphone noise reduction. The default value is false. |
virtual int Thunder::IAudioDeviceManager::enableAEC(bool enabled);
Enable/Disable AEC.
Note:
- This API should be called after initialization (initialize). This interface is reset only when destroyEngine is called
Parameter | Type | Description |
---|---|---|
enabled | IN | true: Enable AEC; false: Disable AEC. The default value is false. |
virtual int Thunder::IAudioDeviceManager::enableAGC(bool enabled);
Enable/Disable Automatic Gain Control (AGC).
Note:
- This API should be called after initialization (initialize). This interface is reset only when destroyEngine is called
Parameter | Type | Description |
---|---|---|
enabled | IN | true: Enable AEC; false: Disable AEC. The default value is false. |
virtual bool Thunder::IThunderAudioPlayer::open(const char* path);
Open a specified file.
Parameter | Type | Description |
---|---|---|
path | Absolute file path |
virtual void Thunder::IAudioDeviceManager::close();
Close the current file.
virtual void Thunder::IAudioDeviceManager::play();
Play a file that has been opened.
Note:
- Before playing a file, call IThunderAudioPlayer::open to open it first.
virtual void Thunder::IAudioDeviceManager::stop();
Stop playing.
virtual void Thunder::IAudioDeviceManager::pause();
Pause playing a file that has been opened.
virtual void Thunder::IAudioDeviceManager::resume();
Pause playing a file that has been opened.
virtual void Thunder::IAudioDeviceManager::seek(unsigned int timeMS);
Jump to a specified time for play.
Note:
- Ensure that the file is in playback state.
- The value cannot be greater than that obtained by getTotalPlayTimeMS.
Parameter | Type | Description |
---|---|---|
timeMS | IN | Specified time, unit: ms |
virtual unsigned int Thunder::IAudioDeviceManager::getTotalPlayTimeMS();
Get the total play time of files.
Note:
- Call IThunderAudioPlayer::open to open the file first.
virtual unsigned int Thunder::IAudioDeviceManager::getCurrentPlayTimeMS();
Get the time which has been played.
Note:
- Call IThunderAudioPlayer::open to open the file and play it.
virtual int Thunder::IAudioDeviceManager::setPlayerLocalVolume(int volume);
Adjusts volume size when music files are played on local end.
Parameter | Type | Description |
---|---|---|
volume | IN | Play volume [0-100] |
virtual int Thunder::IAudioDeviceManager::setPlayerPublishVolume(int volume);
Adjust the publish volume of the music file.
Parameter | Type | Description |
---|---|---|
volume | IN | Play volume [0-100] |
virtual int Thunder::IAudioDeviceManager::getPlayerLocalVolume();
Get the local volume of music files. The value matches that configured by setPlayerLocalVolume. The range is [0-100].
Note:
- Call IThunderAudioPlayer::open to open the file and play it.
virtual int Thunder::IAudioDeviceManager::getPlayerPublishVolume();
Obtain the publish volume of the music file. The value matches that configured by setPlayerPublishVolume. The range is [0-100].
Note:
- Call IThunderAudioPlayer::open to open the file and play it.
virtual int Thunder::IAudioDeviceManager::setLooping(int cycle);
Sets times of loop playbacks.
Parameter | Type | Description |
---|---|---|
cycle | IN | -1: indicates infinite loop; 0: No loop (default value); Positive integer: Loop times |
virtual void setSemitone(int val);
Set the audio playback tone.
Parameter | Type | Description |
---|---|---|
val | IN | Tone value: -5, -4, -3, -2, -1, 0(normal), 1, 2, 3, 4, 5 |
virtual void setTempo(float val);
Set the audio playback speed.
Parameter | Type | Description |
---|---|---|
val | IN | Speed: 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0 |
virtual void setPosition(int azimuth);
Set the audio playback direction.
Parameter | Type | Description |
---|---|---|
azimuth | IN | Playback direction,-90~90 |
virtual void Thunder::IAudioDeviceManager::void SetFilePlayerNotify(IThunderAudioPlayerNotify* notify);
Set playback callback.
Parameter | Type | Description |
---|---|---|
notify | IN | Interface class of the playback callback. For details, see IThunderAudioPlayerNotify. |
virtual int Thunder::IVideoDeviceManager::enumVideoDevices(VideoDeviceList& devices);
Enumerate video input devices.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
devices | OUT | List of video input devices. For details, see VideoDeviceList. |
virtual int Thunder::IVideoDeviceManager::startVideoDeviceCapture(int index);
Start the video input device and initiate collection.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
index | IN | Device index |
virtual int Thunder::IVideoDeviceManager::stopVideoDeviceCapture();
Stop video device capture.
Note:
- This API should be called after initialization (initialize).
virtual int Thunder::IVideoDeviceManager::enumMonitorDevices(MonitorDeviceList& devices);
Enumerate monitor input devices.
Note:
- This API should be called after initialization (initialize).
Parameter | Type | Description |
---|---|---|
devices | OUT | Returned list of video input devices. For details, see MonitorDeviceList. |
0: Success
<0: Failure. For return code details, see enum ThunderRet.
virtual int startDeviceTest(int index, HWND hwnd);
Start testing the video capture device.
Note:
- Ather start testing the video capture device by calling this API, you should stop the test by calling stopDeviceTest; and it cannot be called with startVideoDeviceCapture to open the same device.
Parameter | Type | Description |
---|---|---|
deviceIdx | IN | Video device No.,which can be obtained by calling enumVideoDevices |
hwnd | IN | video rendering window, which cannot be set to NULL, otherwise, error code may be returned |
0: Success
<0: Failure. For return code details, see enum ThunderRet.
virtual int stopDeviceTest();
Stop video capture device test.
Note:
- You can call this API stop testing video devices after calling startDeviceTest.
0: Success
<0: Failure. For return code details, see enum ThunderRet.
virtual int getVideoDeviceCapture(int& deviceIdx);
Get video device No.
Note:
- This API should be called after initialization.
Parameter | Type | Description |
---|---|---|
deviceIdx | OUT | Video device No., see details in enumVideoDevices |
0: Success
<0: Failure. For return code details, see enum ThunderRet.
enum Thunder::AREA_TYPE
Area type
Enumeration Values | Description |
---|---|
AREA_DEFAULT(0) | Domestic, default value |
AREA_FOREIGN(1) | Overseas |
AREA_RESERVED(2) | Reserved |
enum Thunder::THUNDER_PROFILE
Media mode
Enumeration Values | Description |
---|---|
PROFILE_DEFAULT(0) | Default mode (audio/video mode) |
PROFILE_NORMAL(1) | Audio/video mode |
PROFILE_ONLY_AUDIO(2) | Audio-only mode, applicable to audio-only optimization |
enum Thunder::ROOM_CONFIG_TYPE
Media mode
Enumeration Values | Description |
---|---|
ROOM_CONFIG_LIVE(0) | Live streaming mode, where quality is prioritized and delay is large. Applicable to viewer or audience scenario. When audience publishes audio/video and becomes anchors, the value changes to communication mode. |
ROOM_CONFIG_COMMUNICATION(1) | Communication mode is applicable for 1v1 communication and group conversation due to its short time delay and fluent communication. |
ROOM_CONFIG_MultiAudioRoom(4) | Audio room mode is applicable for group audio room due to its low time delay and low bandwidth occupied |
enum Thunder::AUDIO_PROFILE_TYPE
Audio type
Enumeration Values | Description |
---|---|
AUDIO_PROFILE_DEFAULT(0) | Default type: "NET_AAC_ELD"(default)-sampling rate: 44.1 KHz, dual track, code rate: 40 kbps; 1-audio mode, 3-live streaming mode |
AUDIO_PROFILE_SPEECH_STANDARD(1) | Specify the sampling rate of 16 KHz. Speech encoding, single sound track, encoding rate of about 18 kbps |
AUDIO_PROFILE_MUSIC_STANDARD_STEREO(2) | Specify the sampling rate of 44.1 KHz. Music encoding, dual sound tracks, encoding rate of about 24 kbps, high encoding delay |
AUDIO_PROFILE_MUSIC_STANDARD(3) | Specify the sampling rate of 44.1 KHz. Music encoding, dual sound tracks, encoding rate of about 48 kbps, low encoding delay |
AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(4) | Specify the sampling rate of 44.1KHz, music encoding, dual track, and encoding rate of around 128kbps |
AUDIO_PROFILE_MUSIC_HIGHER_QUALITY = 5 | Specify the sampling rate of 44.1KHz, music encoding, dual track, and encoding rate of around 192kbps |
enum Thunder::COMMUT_MODE
Interactive mode
Enumeration Values | Description |
---|---|
COMMUT_MODE_DEFAULT(0) | Default type, which is COMMUT_MODE_DEFAULT. |
COMMUT_MODE_HIGH(1) | High interactive mode |
COMMUT_MODE_LOW(2) | Low interactive mode |
enum Thunder::SCENARIO_MODE
Scenario mode
Enumeration Values | Description |
---|---|
SCENARIO_MODE_DEFAULT(0) | Default type, which is SCENARIO_MODE_STABLE_FIRST. |
SCENARIO_MODE_STABLE_FIRST(1) | Smooth is prioritized. Recommended for use in education scenarios that require high stability. |
SCENARIO_MODE_QUALITY_FIRST(2) | Tone quality is prioritized. Recommended for use in show scenarios where microphone connection is seldom required. |
enum Thunder::ThunderSourceType
Audio publishing mode
Enumeration Values | Description |
---|---|
THUNDER_AUDIO_MIC(0) | Only microphone |
THUNDER_AUDIO_FILE(1) | Only file |
THUNDER_AUDIO_MIX(2) | Microphone and file |
THUNDER_AUDIO_TYPE_NONE(10) | Stop all upstream audio data |
enum Thunder::AUDIO_RECORDING_FILE_TYPE
Audio publishing mode
Enumeration Values | Description |
---|---|
AUDIO_RECORDING_WAV(0) | wav format |
AUDIO_RECORDING_AAC(1) | aac format |
AUDIO_RECORDING_MP3(2) | mp3 format |
enum Thunder::AUDIO_RECORDING_QUALITY_TYPE
Audio publishing mode
Enumeration Values | Description |
---|---|
AUDIO_RECORDING_QUALITY_LOW(0) | Low tone quality |
AUDIO_RECORDING_QUALITY_MEDIUM(1) | Mediocre tone quality |
AUDIO_RECORDING_QUALITY_HIGH(2) | High tone quality |
enum Thunder::ThunderAudioRawFrameOperationMode
Audio publishing mode
Enumeration Values | Description |
---|---|
THUNDER_AUDIO_RAW_FRAME_OPERATION_MODE_READ_ONLY(1) | Read only mode. The user only acquires original data from AudioFrame |
THUNDER_AUDIO_RAW_FRAME_OPERATION_MODE_WRITE_ONLY(2) | Write only mode. The user replaces data in AudioFrame for encoding transmission of SDK |
THUNDER_AUDIO_RAW_FRAME_OPERATION_MODE_READ_WRITE(3) | Read-write mode. The user obtains data from AudioFrame and modifies data. Then the data is returned to SDK for encoding and transmission. |
enum Thunder::LOG_FILTER
Audio publishing mode
Enumeration Values | Description |
---|---|
LOG_LEVEL_TRACE(0) | TRACE |
LOG_LEVEL_DEBUG(1) | DEBUG |
LOG_LEVEL_INFO(2) | INFO |
LOG_LEVEL_WARN(3) | WARN |
LOG_LEVEL_ERROR(4) | ERROR |
LOG_LEVEL_RELEASE (10) | RELEASE |
struct Thunder::VideoEncoderConfiguration
{
VideoPublishPlayType playType;
VideoPublishMode publishMode;
};
Video encoding configuration
Member | Description |
---|---|
VideoPublishPlayType | Publishing type |
VideoPublishMode | Publishing bracket |
struct Thunder::ThunderVideoEncodeParam
{
int width; // Width
int height; // Height
int frameRate; // Frame rate
int codeRate; // Bit rate
};
Video encoding parameters.
enum Thunder::VideoPublishPlayType
Audio publishing mode
Enumeration Values | Description |
---|---|
VIDEO_PUBLISH_PLAYTYPE_SINGLE(0) | Single publishing |
VIDEO_PUBLISH_PLAYTYPE_INTERACT(1) | Microphone-connection video publishing |
VIDEO_PUBLISH_PLAYTYPE_SCREENCAP(2) | Screen recording publishing |
enum Thunder::VideoPublishMode
Audio publishing mode
Enumeration Values | Description |
---|---|
VIDEO_PUBLISH_MODE_DEFAULT(-1) | Undefined. The publishing definition is determined by configuration |
VIDEO_PUBLISH_MODE_SMOOTH_DEFINITION(1) | Fluent |
VIDEO_PUBLISH_MODE_NORMAL_DEFINITION(2) | Standard definition |
VIDEO_PUBLISH_MODE_HIGH_DEFINITION(3) | High definition |
VIDEO_PUBLISH_MODE_SUPER_DEFINITION(4) | Ultra definition |
VIDEO_PUBLISH_MODE_BLUERAY(5) | Blue light |
#define MAX_THUNDER_UID_LEN 65 // UID length
struct Thunder::VideoCanvas
{
HWND hWnd;
VideoRenderMode renderMode;
char uid[MAX_THUNDER_UID_LEN];
};
Video encoding configuration
Member | Description |
---|---|
HWND | Video rendering window |
VideoRenderMode | Video rendering mode |
char uid[MAX_THUNDER_UID_LEN] | User id |
enum Thunder::VideoRenderMode
Video rendering mode
Enumeration Values | Description |
---|---|
VIDEO_RENDER_MODE_FILL(0) | Pull to full screen |
VIDEO_RENDER_MODE_ASPECT_FIT(1) | Adapt to window |
VIDEO_RENDER_MODE_CLIP_TO_BOUNDS(2) | Tailed to full screen |
enum Thunder::ThunderVideoMirrorMode
Mirror mode for local preview video and stream publishing video
Enumeration Values | Description |
---|---|
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_MIRROR_PUBLISH_NO_MIRROR(0) | The preview other than stream publishing is mirrored |
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_PUBLISH_BOTH_MIRROR(1) | Both the preview and stream publishing are mirrored |
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_PUBLISH_BOTH_NO_MIRROR(2) | Neither the preview nor stream publishing is mirrored |
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_NO_MIRROR_PUBLISH_MIRROR(3) | The preview other than stream publishing is mirrored |
#define MAX_THUNDER_URL_LEN 512 // url length
struct Thunder::ThunderBoltImage
{
int x; // Take the upper left corner as the original point, horizontal coordinate
int y; // Take the upper left corner as the original point, vertical coordinate
int width; // Width
int height; // Height
char url[MAX_THUNDER_URL_LEN]; // Absolute path address or http, https address of local picture
};
Picture information
struct CustomAudioOptions
{
int sampleRate; // Sampling rate (48k,44.1,16k,8k)
int channels; // Audio channel
int bitpersample; // Bit width of sampling point (currently only 16 available)
bool bMixSdkCapture; // Whether to synthesize the capture of SDK itself
};
External audio capture parameters
struct CustomVideoOptions
{
enum CustomVideoSrcDataType
{
DATA_TYPE_I420 = 0,
DATA_TYPE_NV12 = 1,
DATA_TYPE_BGR24 = 2,
DATA_TYPE_BGRA = 3,
};
int srcWidth; // Width and height of input source [dynamic update not available]
int srcHeight; // Height of input source [dynamic update not available]
int destWidth; // Width and height of output stream [this parameter has been deprecated and needs to be set according to the interface setVideoEncoderConfig]
int destHeight; // Width and height of output stream [this parameter has been deprecated and needs to be set according to the interface setVideoEncoderConfig]
int codeRate; // Specific value of bit rate (unit: kbps) [this parameter has been deprecated and needs to be set according to the interface setVideoEncoderConfig]
CustomVideoSrcDataType srcDataType; // Data type of source stream
};
External video capture parameters.
#define MAX_THUNDER_TRANSCODINGUSER_COUNT 9 // Number of users with maximum image transcoding
#define MAX_THUNDER_ROOMID_LEN 65 // roomId length
#define MAX_THUNDER_UID_LEN 65 // uid length
struct LiveTranscoding
{
// Audio is unified by default to "encode": 1,"bitrate":128,"sample":44100,"channel":2
enum TranscodingMode
{
TRANSCODING_MODE_320X180 = 1, // "encode":100,"bitrate":150,"fps":15,"gop":30,"height":180,"width":320
TRANSCODING_MODE_320X240 = 2, // "encode":100,"bitrate":200,"fps":15,"gop":30,"height":240,"width":320
TRANSCODING_MODE_640X360 = 3, // "encode":100,"bitrate":500,"fps":15,"gop":30,"height":360,"width":640
TRANSCODING_MODE_640X480 = 4, // "encode":100,"bitrate":500,"fps":15,"gop":30,"height":480,"width":640
TRANSCODING_MODE_960X544 = 5, // "encode":100,"bitrate":1000,"fps":24,"gop":48,"height":544,"width":960
TRANSCODING_MODE_1280X720 = 6, // "encode":100,"bitrate":1600,"fps":24,"gop":48,"height":720,"width":1280
TRANSCODING_MODE_1920X1080 = 7, // "encode":100,"bitrate":4500,"fps":24,"gop":48,"height":1080,"width":1920
};
LiveTranscoding() : transcodingMode(0), userCount(0) {}
int transcodingMode; // Transcoding bracket (enum TranscodingMode)
int userCount;
TranscodingUser userList[MAX_THUNDER_TRANSCODINGUSER_COUNT];
};
struct TranscodingUser
{
TranscodingUser()
: bStandard(false)
, layoutX(0)
, layoutY(0)
, layoutW(0)
, layoutH(0)
, zOrder(0)
, bCrop(false)
, cropX(0)
, cropY(0)
, cropW(0)
, cropH(0)
, alpha(0)
, audioChannel(0)
{
}
bool bStandard; // Standard stream user or not
int layoutX; // User's location x in video mixing canvas
int layoutY; // User's location y in video mixing canvas
int layoutW; // User’s width in video mixing canvas
int layoutH; // User’s height in video mixing canvas
int zOrder; // Layer number of the user’s video frame on the live video. The value range is the integer in [0, 100] (0 = lowest layer, 1 = first layer from bottom to top, and so on)
bool bCrop; // 0: display in the middle after zooming, mend black edges on the upper and lower / left and right sides; 1: crop in the middle after zooming, and crop the upper and lower / left and right extra regions
int cropX; // X coordinate of crop region, left blank means default to center cropping
int cropY; // Y coordinate of crop region
int cropW; // Width of crop region
int cropH; // Height of crop region
float alpha; // Transparency of user video on the live video. The value range is [0.0, 1.0]. 0.0 indicates that the image in this region is completely transparent, while 1.0
// indicates completely opaque. The default is 1.0
int audioChannel; // Not yet realized
char uid[MAX_THUNDER_UID_LEN];
char roomId[MAX_THUNDER_ROOMID_LEN];
};
Video mixing parameters
#define MAX_DEVICE_NAME_LEN 512 // Device name
#define MAX_DEVICE_DESC_LEN 512 // Device description
#define MAX_DEVICE_COUNT 16 // Maximum quantity of devices
struct GUID
{
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
};
struct AudioDeviceInfo // Information about audio device
{
GUID id; // Identification of audio device
char name[MAX_DEVICE_NAME_LEN]; // Name of audio device
char desc[MAX_DEVICE_DESC_LEN]; // Description of audio device
};
struct AudioDeviceList
{
AudioDeviceInfo device[MAX_DEVICE_COUNT]; // List of audio devices
int count; // Number of video devices
};
List of audio devices
#define MAX_DEVICE_NAME_LEN 512 // Device name
#define MAX_DEVICE_COUNT 16 // Maximum quantity of devices
struct RECT
{
long left;
long top;
long right;
long bottom;
};
struct MonitorDeviceInfo
{
int index; // Acquired device number
int flags; // Flags for screen attributes. The following table lists the possible values:
// 0: This screen is not the home screen.
// 1: This screen is the home screen, can also be identified by the macro MONITORINFOF_PRIMARY came with Windows
void* handle; // pHandler to display monitor <==> HMONITOR
RECT rcWork; // Rectangular working area of specified screen, represented in virtual screen coordinates
RECT rcMonitor; // Rectangular specified screen, represented in virtual screen coordinates
char name[MAX_DEVICE_NAME_LEN]; // Device name
};
struct MonitorDeviceList
{
int count; // Number of video devices
MonitorDeviceInfo device[MAX_DEVICE_COUNT]; // List of video devices
};
List of displayer information.
struct VideoDeviceList
{
VideoDeviceInfo device[MAX_DEVICE_COUNT]; // List of video devices
int count; // Number of video devices
};
List of video devices
struct VideoDeviceInfo
{
char name[MAX_DEVICE_NAME_LEN]; // Name of video device
int index; // Index of video device
};
Video device information
enum Thunder::FEATURE_SUPPORT
System fetures.
Enumeration Value | Description |
---|---|
FEATURE_SUPPORT_MAGAPI(0) | Mag API capture |
struct ReverbParameter
{
float roomSize; // Room size, range: [0~100]
float preDelay; // Pre-delay, range: [0~200], unit: ms
float reverberance; // Reverberance, range: [0~100]
float hfDamping; // Damping, range: [0~100]
float toneLow; // Low tone, range: [0~100]
float toneHigh; // High tone, range: [0~100]
float wetGain; // Wet gain, range: [-20~10], unit: dB
float dryGain; // Dry gain, range: [-20~10], unit: dB
float stereoWidth; // Stereo width, range: [0~100]
};
Reverberation parameters.
struct LimiterParameter
{
float ceiling; // Target threshold, range: [-30 ~ 0]
float threshold; // Threshold, range: [-10 ~ 0]
float preGain; // Pre-gain, range: [0 ~ 30]
float release; // Release time, range: [0 ~ 1000]
float attack; // Attack time, range: [0 ~ 1000]
float lookahead; // ook-ahead value, range: [0 ~ 8]
float lookaheadRatio; // Look-ahead ratio, range: [0.5 ~ 2]
float rootMeanSquare; // Root mean square值, range: [0 ~ 100]
float stLink; // Stereo, range: [0 ~ 1]
};
Limiter parameters.
struct EqualizerParameter
{
float amplitudeGain; // Amplitude gain, range: [-12 ~ 12], unit: dB
float gains[10]; // Band gain list,range of each band: [-12 ~ 12]
// The center frequency of each band is 31 Hz, 62 Hz, 125 Hz, 250 Hz, 500 Hz, 1000 Hz, 2000 Hz, 4000 Hz, 8000 Hz, 16000 Hz
};
Equalizer parameters.