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 Function | 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 Function | 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 Function | 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.
Notes:
- It is recommended that this instance be created upon initialization by calling the IThunderEngine::initialize.
- Currently, the SDK only supports one IThunderEngine instance, meaning that each application can only create one IThunderEngine object.
- Unless otherwise specified, all API functions of ThunderEngine are called asynchronously, and the API is called in the same thread.
Pointer directing to the object of 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.
Notes:
- Only users with the same AppId can communicate with one another.
- Call this API after an instance has been created. This API is reset only when destroyEngine is called.
Parameter | Type | Description |
---|---|---|
appId | IN | Application ID issued for application developers. It can be obtained on 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 | Object pointer of IThunderEventHandler. The SDK uses this abstract class for various runtime event callback. |
virtual int Thunder::IThunderEngine::setArea(AREA_TYPE area);
Set a user's country/region.
To accommodate to different laws and regulations at home and abroad, CS2 NETWORK has central systems each for domestic (default) and international users. Set area as follows:
Notes:
- This API takes effect only when it is called before joinRoom.
- It is required for international users.
- It can only be reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
area | IN | Region type is domestic by default. See details in AREA_TYPE. |
virtual int Thunder::IThunderEngine::joinRoom(const char* token, int tokenLen, const char* roomName, const char* uid);
Join a room.
You can call this API to join a (audio/video) call room. Users in the same room can communicate with each other. When multiple users join a room, it starts a group chat.
You must call leaveRoom to the current call before joining another room.
Notes:
- It can only be called after (initialize).
- The applications with different AppIDs cannot communicate with each other.
- Successful function return only indicates that the request has executed successfully. Successful joining of a room is indicated by the callback onJoinRoomSuccess.
Parameter | Type | Description |
---|---|---|
token | IN | Token for authentication. See details in User Authentication Description on the official website. |
tokenLen | IN | Token length |
roomName | IN | Room ID (unique to each application ID), which only supports a combination of characters such as [A,Z],[a,z],[0,9],-,_, and cannot exceed 64 bytes. |
uid | IN | User ID, which only supports a combination of characters such as [A,Z],[a,z],[0,9],-,_, and cannot exceed 64 bytes. |
virtual int Thunder::IThunderEngine::leaveRoom();
Exit a room to end a call.
Notes:
- It can only be called after (initialize).
- Once joinRoom is called, you have to call leaveRoom to end the call before joining another one. Whether you are in a call or not, leaveRoom can be called to end the call and release all related resources.
virtual int Thunder::IThunderEngine::updateToken(const char* token, int tokenLen);
Update the token.
Notes:
- It can only be called after (initialize).
- Successful function return only indicates that the request has executed successfully. Successful joining of a room is indicated by the callback onJoinRoomSuccess.
Token is used for authentication. Recommended token format is as follows. See details in Authentication Access Manual.
uint16 | uint32 | uint64 | uint64 | uint32 | uint16 | nBytes | 20 Bytes |
---|---|---|---|---|---|---|---|
TokenLen | AppId | uid | TimeStamp(ms) | ValidTime(s) | BizExtInfoLen | BizExtInfoData | DigitalSignature |
Please refer to the following explanation:
Parameter | Type | Description |
---|---|---|
token | IN | Token for authentication. See details in User Authentication Description. |
tokenLen | IN | Token length |
virtual int Thunder::IThunderEngine::setMediaMode(THUNDER_PROFILE mode);
Set media format. PROFILE_NORMAL is used by the SDK by default.
Notes:
- It can only be called after initialization (initialize) and before joining a room (joinRoom).
- It can only be reset by executing destroyEngine.
Parameter | Type | Description |
---|---|---|
mode | IN | Media mode. See details in Thunder::THUNDER_PROFILE. |
virtual int Thunder::IThunderEngine::setRoomMode(ROOM_CONFIG_TYPE mode);
Set room mode. ROOM_CONFIG_LIVE is used by the SDK by default.
Notes:
- This API should be called after initialization (initialize) and before joining a room (joinRoom).
- It can only be reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
mode | IN | Room mode. See details in 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.
Notes:
- Call it before audio publishing stopLocalAudioStream.
- It can only be reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
profile | IN | Audio type. See details in Thunder::AUDIO_PROFILE_TYPE. |
commuMode | IN | Communication mode. See details in Thunder::COMMUT_MODE. |
scenarioMode | IN | Scenario mode. See details in Thunder::SCENARIO_MODE. |
virtual int Thunder::IThunderEngine::setAudioSourceType(ThunderSourceType sourceType);
Set audio publishing type.
Notes:
- It can only be reset by calling destroyEngine.
Parameter | Type | Description |
---|---|---|
sourceType | IN | Audio publishing mode. See details in Thunder::ThunderSourceType. |
virtual int Thunder::IThunderEngine::stopLocalAudioStream(bool stop);
Stop/start audio publishing (including enabling capture, encoding and stream pushing).
Notes:
- It can only be called after (joinRoom).
Parameter | Type | Description |
---|---|---|
Stop | IN | true: close local audio; false: open local audio |
virtual int Thunder::IThunderEngine::stopAllRemoteAudioStreams(bool stop);
Stop/resume receiving all remote audio streams. Operate this API according to the following rules:
Notes:
- It can only be called after (initialize). This API 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: stop; false: start |
virtual int Thunder::IThunderEngine::stopRemoteAudioStream(const char* uid, bool stop);
Stop/resume receiving audio data of specified users.
Notes:
- It can only be called after (joinRoom). This API 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 ID |
Stop | IN | true: stop user audio, false: receive user audio |
virtual int Thunder::IThunderEngine::setAudioVolumeIndication(int interval, int smooth);
Enable speaker volume prompt. This API enables the SDK to send the application feedback on who is speaking and at what volume regularly.
Notes:
- It can only be called after (initialize). This API is reset only when destroyEngine is called.
- After this API 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 (ms) (a value greater than 200 is recommended) |
smooth | IN | Smooth coefficient, unrealized |
virtual int Thunder::IThunderEngine::enableLoopbackRecording(bool enabled);
Enable/disable sound card recording.
Notes:
- It can only be called after (initialize). This API is reset only when destroyEngine is called.
Parameter | Type | Description |
---|---|---|
enabled | IN | true: sound card recording; false: disable sound card recording |
virtual int Thunder::IThunderEngine::startAudioRecording(const char* fileName,
AUDIO_RECORDING_FILE_TYPE fileType,
AUDIO_RECORDING_QUALITY_TYPE quality);
Start audio recording.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
fileName | IN | Recording file name (with full path and excluding filename extension generated based on fileType |
fileType | IN | File format. See details in Thunder::AUDIO_RECORDING_FILE_TYPE. |
quality | IN | Recording quality. See details in Thunder::AUDIO_RECORDING_QUALITY_TYPE. |
virtual int Thunder::IThunderEngine::stopAudioRecording();
Stop audio recording.
Notes:
- It can only be called after (initialize).
virtual int Thunder::IThunderEngine::adjustRecordingSignalVolume(int volume);
Set recording volume.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
volume | IN | Volume, range [0--400.] |
virtual int Thunder::IThunderEngine::adjustPlaybackSignalVolume(int volume);
Set playing volume.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
volume | IN | Volume, range [0--400.] |
virtual Thunder::IAudioDeviceManager* Thunder::IThunderEngine::getAudioDeviceMgr();
Get the instance object of audio device management API.
Notes:
- It can only be called after (initialize).
virtual int Thunder::IThunderEngine::registerAudioFrameObserver(IAudioFrameObserver* observer);
Register audio frame data observer IAudioFrameObserver.
Notes:
- It can only be called after (initialize).
- Users need to extend IAudioFrameObserver and implement the virtual methods within. Related raw audio data are called through these methods.
Parameter | Type | Description |
---|---|---|
observer | IN | Object pointer of Pointer of the IAudioFrameObserver. Registration is canceled if it is set to null. |
virtual int Thunder::IThunderEngine::setRecordingAudioFrameParameters(int sampleRate,
int channel,
ThunderAudioRawFrameOperationMode mode,
int samplesPerCall);
Set raw data mode for audio recording during callback onRecordAudioFrame.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
sampleRate | IN | Sampling rate |
channel | IN | Audio channel; 1: single channel; 2: dual channel |
mode | IN | Mode of Mode of using onRecordAudioFrame. See details in Thunder::ThunderAudioRawFrameOperationMode. |
samplesPerCall | IN | Specify sampling number of data returned in onRecordAudioFrame. For example, usually the sampling number in applications of transcoding stream pushing is 1024. samplesPerCall = (int)(sampleRate × sampleInterval), in which: sampleInterval ≥ 0.01 (s). |
virtual int Thunder::IThunderEngine::setPlaybackAudioFrameParameters(int sampleRate,
int channel,
ThunderAudioRawFrameOperationMode mode,
int samplesPerCall);
Set raw data mode for audio playing during callback onPlaybackAudioFrame.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
sampleRate | IN | Sampling rate |
channel | IN | Audio channel; 1: single channel; 2: dual channel |
mode | IN | Mode of Mode of using onPlaybackAudioFrame. See details in Thunder::ThunderAudioRawFrameOperationMode. |
samplesPerCall | IN | Specify sampling number of data returned in onPlaybackAudioFrame. For example, usually the sampling number in applications of transcoding stream pushing is 1024. samplesPerCall = (int)(sampleRate × sampleInterval), in which: sampleInterval ≥ 0.01 (s). |
virtual int Thunder::IThunderEngine::setLogFilePath(const char* filePath);
Set directory for the SDK to output log files.
Notes:
- Ensure that the specified directory has write permission.
Parameter | Type | Description |
---|---|---|
filePath | IN | Complete log file directory |
virtual int Thunder::IThunderEngine::setLogLevel(LOG_FILTER filter);
Set log saving level. Logs with lower level (LogLevel) will be filtered. Only logs with levels equal to or larger than this value will be recorded.
Parameter | Type | Description |
---|---|---|
filter | IN | See details about the log filtering level in Thunder::LOG_FILTER. |
virtual int Thunder::IThunderEngine::registerVideoFrameObserver(IVideoFrameObserver* observer);
Register video frame data observer IVideoFrameObserver.
Notes:
- DIt can only be called after (initialize).
- Users need to extend IVideoFrameObserver and implement the virtual methods within. Related raw audio data are called through these methods.
Parameter | Type | Description |
---|---|---|
observer | IN | Object pointer of Pointer of the IVideoFrameObserver. Registration is canceled if it is set to null. |
virtual Thunder::IVideoDeviceManager* Thunder::IThunderEngine::getVideoDeviceMgr();
Register video frame data observer IVideoFrameObserver.
Notes:
- It can only be called after (initialize).
virtual int Thunder::IThunderEngine::setVideoEncoderConfig(const VideoEncoderConfiguration& config);
Set video encoding configuration. Details:
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
config | IN | Specific encoding configuration. See details in Thunder::VideoEncoderConfiguration. |
virtual int Thunder::IThunderEngine::setLocalVideoCanvas(const VideoCanvas& canvas);
Set the rendering view of local videos.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
canvas | IN | Reference of rendering object VideoCanvas |
virtual int Thunder::IThunderEngine::setRemoteVideoCanvas(const VideoCanvas& canvas);
Set remote video rendering.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
canvas | IN | Reference of specific rendering object VideoCanvas |
virtual int Thunder::IThunderEngine::setLocalCanvasScaleMode(VideoRenderMode mode);
Set local view mode.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
mode | IN | Rendering mode. See details in Thunder::VideoRenderMode |
virtual int Thunder::IThunderEngine::setRemoteCanvasScaleMode(VideoRenderMode mode);
Set remote view mode.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
mode | IN | Rendering mode. See details in Thunder::VideoRenderMode |
virtual int Thunder::IThunderEngine::startVideoPreview();
Enable camera video preview.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
mode | IN | Rendering mode. See details in Thunder::VideoRenderMode |
virtual int Thunder::IThunderEngine::stopVideoPreview();
Disable camera video preview.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
mode | IN | Rendering mode. See details in Thunder::VideoRenderMode |
virtual int Thunder::IThunderEngine::enableLocalVideoCapture(bool enabled);
Enable/disable local video capture.
Notes:
- It can only be called after (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 transmission.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
Stop | IN | True: disable local video transmission; false: enable local video transmission |
virtual int Thunder::IThunderEngine::stopRemoteVideoStream(const char* uid, bool stop);
Stop/resume receiving specified remote video.
Notes: It can only be called after (initialize). This API 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/resume receiving all remote videos.
Notes:
- It can only be called after (initialize). This API 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 streams; false; receive all remote video streams. The default value is false |
virtual int Thunder::IThunderEngine::setLocalVideoMirrorMode(ThunderVideoMirrorMode mode);
Set local video mirror mode.
Notes:
- It can only be called after (initialize). This API is reset only when destroyEngine is called.
- Set mirror mode of local preview and videos visible to viewers, which takes effect immediately.
Parameter | Type | Description |
---|---|---|
mode | IN | Mirror mode. See details in Thunder::ThunderVideoMirrorMode |
virtual int Thunder::IThunderEngine::setVideoWatermark(const Thunder::ThunderBoltImage& watermark);
Add local video watermark.
Notes:
- It can only be called after (initialize).
- Currently, only one watermark is supported. A newly added watermark will replace the former one.
- Only 24-bit and 32-bit pictures are supported. The 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 stream pushing. See details about the picture format in Thunder::ThunderBoltImage |
virtual int Thunder::IThunderEngine::removeVideoWatermarks();
Remove the local video watermark.
Notes:
- It can only be called after (initialize).
virtual int Thunder::IThunderEngine::setCustomAudioSource(bool bEnable, CustomAudioOptions& option);
Set external audio capture parameters.
Notes:
- It can only be called after (initialize) and before audio publishing (stopLocalAudioStream(false).
Parameter | Type | Description |
---|---|---|
bEnable | IN | true: enable external audio capture false: disable external audio capture (by default) |
option | IN | External audio capture parameters. It is the reference of CustomAudioOptions |
virtual int Thunder::IThunderEngine::pushCustomAudioFrame(const char* pData, unsigned dataLen, unsigned timeStamp);
Push external audio frames.
Notes:
- It can only be called after (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 external video capture parameters.
Notes:
- It can only be called after (initialize) and before audio publishing(stopLocalVideoStream(false)).
Parameter | Type | Description |
---|---|---|
bEnable | IN | true: enable external audio capture false: disable external audio capture (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 frames.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
yuv | IN | YUV video data |
linesize | IN | Line width of the buffer zone in YUV data |
timestamp | IN | Capture timestamp |
virtual int Thunder::IThunderEngine::addPublishOriginStreamUrl(const char* url);
Add a source stream pushing address.
Notes:
-It can be called after joining the room (joinRoom). The configuration will be cleared after you exit the room.
- A maximum of 5 addresses are supported for stream pushing.
Parameter | Type | Description |
---|---|---|
url | IN | Stream pushing 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 512 bytes; for example, Alibaba Cloud only supports 256 bytes. |
virtual int Thunder::IThunderEngine::removePublishOriginStreamUrl(const char* url);
Remove the source stream pushing address.
Parameter | Type | Description |
---|---|---|
url | IN | Stream pushing 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 example, Alibaba Cloud only supports 256 bytes. |
virtual int Thunder::IThunderEngine::setLiveTranscodingTask(const char* taskId, const LiveTranscoding& transcodingCfg);
Add/update transcoding task.
Notes:
- It can be called after joining the room (joinRoom). The configuration will be cleared after you exit 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. See details in Thunder::LiveTranscoding |
virtual int Thunder::IThunderEngine::removeLiveTranscodingTask(const char* taskId);
Remove a transcoding task.
Notes:
- It can be called after joining the room (joinRoom). The configuration will be cleared after you exit 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 transcoding stream pushing address.
Notes:
- It can be called after joining the room (joinRoom). The configuration will be cleared after you exit the room.
Parameter | Type | Description |
---|---|---|
taskId | IN | Transcoding task ID |
url | IN | Stream pushing 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 512 bytes; for example, Alibaba Cloud only supports 256 bytes. |
virtual int Thunder::IThunderEngine::removePublishTranscodingStreamUrl(const char* taskId, const char* url);
Remove a transcoding stream pushing address.
Notes:
- It can be called after joining the room (joinRoom). The configuration will be cleared after you exit the room.
Parameter | Type | Description |
---|---|---|
taskId | IN | Transcoding task ID |
url | IN | Stream pushing 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 example, Alibaba Cloud only supports 256 bytes. |
virtual int Thunder::IThunderEngine::addSubscribe(const char* roomId, const char* uid);
Subscribe to specific streams (cross-room).
Notes:
- It can be called after joining the room (joinRoom). The configuration will be cleared after you exit the room.
Parameter | Type | Description |
---|---|---|
roomId | IN | Room ID [which only supports a combination of characters such as [A,Z],[a,z],[0,9],-,_, and cannot exceed 64 bytes] |
uid | IN | User ID |
virtual int Thunder::IThunderEngine::removeSubscribe(const char* roomId, const char* uid);
Unsubscribe specified streams.
Notes:
- It can be called after joining the room (joinRoom). The configuration will be cleared after you exit the room.
Parameter | Type | Description |
---|---|---|
roomId | IN | Room ID [which only supports a combination of characters such as [A,Z],[a,z],[0,9],-,_, and cannot exceed 64 bytes] |
uid | IN | User ID |
virtual int Thunder::IThunderEngine::enableWebSdkCompatibility(bool enabled);
Enable/disable WebSDK compatibility.
Notes:
- It can only be called after (initialize). This API is reset only when destroyEngine is called.
- This API is applicable only to the live streaming scenario. Co-hosting is compatible with WebSDK by default, without calling this API.
- Enable compatibility with WebSDK in live streaming. This API must be called before publishing, which is irrelevant with entering or exiting the room.
Parameter | Type | Description |
---|---|---|
enabled | IN | true: compatible false: incompatible (default) |
virtual int Thunder::IThunderEngine::sendUserAppMsgData(const char* msgData);
Send service-customized broadcast message.
This API sends messages via media UDP channel with features of low-latency and unreliability. Specified constraints are as follows:
Notes:
- It can be called after joining the room (joinRoom). The configuration will be cleared after you exit the room.
Parameter | Type | Description |
---|---|---|
msgData | IN | Service-customized broadcast message |
virtual int Thunder::IThunderEngine::sendMediaExtraInfo(const char* extraData);
Send SEI (during audio/video publishing). Usage description:
Notes:
- It can be called after joining the room (joinRoom). The configuration will be cleared after you exit the room.
Parameter | Type | Description |
---|---|---|
extraData | IN | SEI |
virtual int Thunder::IThunderEngine::enableMixVideoExtraInfo(bool enabled);
Enable video mixing with SEI.
Notes:
- It can be called after joining the room (joinRoom). The configuration will be cleared after you exit the room.
Parameter | Type | Description |
---|---|---|
enabled | IN | False by default. true: enable video mixing with SEI; false: disable video mixing with SEI. |
virtual int Thunder::IThunderEngine::startScreenCaptureForHwnd(HWND hWnd, const RECT* pRect);
Start capturing the specified window.
Parameter | Type | Description |
---|---|---|
hWnd | IN | Window handle |
pRect | IN | Sub region captured from a window as the coordinate is a relative value and the point at 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 the specified area of the specified desktop.
Parameter | Type | Description |
---|---|---|
screenId | IN | Monitor ID |
pRect | IN | Specified sub region for capturing as the coordinate is a relative value of the specified screen. The entire monitor screen is captured when this parameter is set to NULL. |
virtual int Thunder::IThunderEngine::updateScreenCaptureRect(const RECT* pRect);
Update the display region captured.
Parameter | Type | Description |
---|---|---|
pRect | IN | Specified sub region for capturing as the coordinate is a relative value of the specified screen or window. 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 a video capture observer object for collecting camera data.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
observer | IN | Pointer of Pointer of the IVideoCaptureObserver. If observer is set as NULL, monitoring is canceled. |
virtual int Thunder::IThunderEngine::registerMediaExtraInfoObserver(IThunderMediaExtraInfoObserver* observer);
Register the observer object of SEI.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
observer | IN | Pointer of Pointer of the IThunderMediaExtraInfoObserver object. If observer is set as NULL, monitoring is canceled. |
virtual IThunderAudioPlayer* Thunder::IThunderEngine::createThunderAudioPlayer();
Create audio file playing object. See details in IThunderAudioPlayer.
virtual int Thunder::IThunderEngine::destroyThunderAudioPlayer(IThunderAudioPlayer* player);
Destroy file playing object.
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 (ms) |
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 supports 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.
Notes:
- 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"-diable (default) |
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.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
devices | OUT | Audio device information. See details in AudioDeviceList. |
virtual int Thunder::IAudioDeviceManager::setInputtingDevice(GUID& id);
Set audio input devices.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
id | IN | Unique descriptor for a device |
virtual int Thunder::IAudioDeviceManager::getInputtingDevice(GUID& id);
Get the currently selected input device.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
id | OUT | Unique descriptor for a device |
virtual int Thunder::IAudioDeviceManager::setInputtingVolume(int volume);
Set volume of the current audio input device.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
volume | IN | Volume, range [0-400] |
virtual int Thunder::IAudioDeviceManager::getInputtingVolume(int volume);
Get volume of the current audio input device.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
volume | OUT | Volume, range [0-400] |
virtual int Thunder::IAudioDeviceManager::setInputtingMute(bool mute);
Mute the current audio input device.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
mute | IN | true: mute; false: unmute |
virtual int Thunder::IAudioDeviceManager::getInputtingMute(bool& mute);
Get mute status of the current audio input device.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
mute | OUT | true: mute; false: unmute |
virtual int Thunder::IAudioDeviceManager::startInputDeviceTest(int indicationInterval);
Enable the current audio input device testing.
Notes:
- It can only be called after (initialize).
- After calling this API, onInputVolume will be received.
Parameter | Type | Description |
---|---|---|
indicationInterval | IN | Check interval. The default value is 0. |
virtual int Thunder::IAudioDeviceManager::stopInputDeviceTest();
Disable the current audio input device testing.
Notes:
- It can only be called after (initialize).
virtual int Thunder::IAudioDeviceManager::enumOutputDevices(AudioDeviceList& devices);
Enumerate audio playback devices.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
devices | OUT | Audio playing devices. See details in AudioDeviceList. |
virtual int Thunder::IAudioDeviceManager::setOutputtingDevice(GUID& id);
Specify the audio playback device.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
id | IN | Unique descriptor for a device |
virtual int Thunder::IAudioDeviceManager::getOutputtingDevice(GUID& id);
Get the current audio playback device.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
id | OUT | Unique descriptor for a device |
virtual int Thunder::IAudioDeviceManager::setOuttingVolume(int volume);
Set volume of the current playback device.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
volume | IN | Volume, range [0-100] |
virtual int Thunder::IAudioDeviceManager::getOuttingVolume(int& volume);
Get volume of the current playing device.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
volume | OUT | Volume, range [0-100] |
virtual int Thunder::IAudioDeviceManager::setOutputtingMute(bool mute);
Mute/unmute the current playback device.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
mute | IN | true: mute; false: unmute |
virtual int Thunder::IAudioDeviceManager::getOutputtingMute(bool& mute);
Get mute status of the current playing device.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
mute | OUT | true: mute; false: unmute |
virtual int Thunder::IAudioDeviceManager::startOutputDeviceTest(int indicationInterval, const char* audioFileName);
Enable the current playing device testing.
Notes:
- It can only be called after (initialize).
- Calling the setOutputtingDevice will also stop the test.
Parameter | Type | Description |
---|---|---|
indicationInterval | IN | Check interval. The default value is 0. |
audioFileName | IN | The complete path of the audio file playing. Win7 and higher support mp3, aac, and wave formats while systems earlier than Win7 support only the wav format. |
virtual int Thunder::IAudioDeviceManager::stopOutputDeviceTest();
Disable the current playing device testing.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
roomId | IN | Room ID [which only supports a combination of characters such as [A,Z],[a,z],[0,9],-,_, and cannot exceed 64 bytes] |
uid | IN | User ID |
virtual int Thunder::IAudioDeviceManager::enableMicEnhancement(bool enabled);
Enable/disable microphone enhancement.
Notes:
- It can only be called after (initialize). This API 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.
Notes:
- It can only be called after (initialize). This API 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 echo cancellation.
Notes:
- It can only be called after (initialize). This API is reset only when destroyEngine is called.
Parameter | Type | Description |
---|---|---|
enabled | IN | true: enable echo cancellation; false: disable echo cancellation. The default value is false. |
virtual int Thunder::IAudioDeviceManager::enableAGC(bool enabled);
Enable/disable Automatic Gain Control (AGC).
Notes:
- It can only be called after (initialize). This API is reset only when destroyEngine is called.
Parameter | Type | Description |
---|---|---|
enabled | IN | true: enable echo cancellation; false: disable echo cancellation. 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 the file opened.
Notes:
- Call IThunderAudioPlayer::open to open a file before playing.
virtual void Thunder::IAudioDeviceManager::stop();
Stop playing.
virtual void Thunder::IAudioDeviceManager::pause();
Pause playing the file opened.
virtual void Thunder::IAudioDeviceManager::resume();
Pause playing the file opened.
virtual void Thunder::IAudioDeviceManager::seek(unsigned int timeMS);
Skip to play from a specified time.
Notes:
- Ensure that the file is in being played.
- The value cannot be greater than that obtained by getTotalPlayTimeMS.
Parameter | Type | Description |
---|---|---|
timeMS | IN | Specified time (ms) |
virtual unsigned int Thunder::IAudioDeviceManager::getTotalPlayTimeMS();
Get the total playing duration of a file.
Notes:
- Call IThunderAudioPlayer::open to open the file first.
virtual unsigned int Thunder::IAudioDeviceManager::getCurrentPlayTimeMS();
Get current elapsed play time.
Notes:
- Call IThunderAudioPlayer::open to open the file and play it.
virtual int Thunder::IAudioDeviceManager::setPlayerLocalVolume(int volume);
Adjust music files' local volume.
Parameter | Type | Description |
---|---|---|
volume | IN | Play volume, range [0-100] |
virtual int Thunder::IAudioDeviceManager::setPlayerPublishVolume(int volume);
Adjust music files' publishing volume.
Parameter | Type | Description |
---|---|---|
volume | IN | Play volume, range [0-100] |
virtual int Thunder::IAudioDeviceManager::getPlayerLocalVolume();
Get music files' local volume. The value matches the ones that configured by setPlayerLocalVolume. The range is [0-100].
Notes:
- Call IThunderAudioPlayer::open to open the file and play it.
virtual int Thunder::IAudioDeviceManager::getPlayerPublishVolume();
Get music files' publishing volume. The value matches the ones configured by setPlayerPublishVolume. The range is [0-100].
Notes:
- Call IThunderAudioPlayer::open to open the file and play it.
virtual int Thunder::IAudioDeviceManager::setLooping(int cycle);
Set loop playback timing.
Parameter | Type | Description |
---|---|---|
cycle | IN | -1: indicates infinite loop; 0: no loop (default value);positive integer: loop count |
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 playing callback.
Parameter | Type | Description |
---|---|---|
notify | IN | API class of playing callback. See details in IThunderAudioPlayerNotify. |
virtual int Thunder::IVideoDeviceManager::enumVideoDevices(VideoDeviceList& devices);
Enumerate video input devices.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
devices | OUT | List of video input devices. See details in VideoDeviceList. |
virtual int Thunder::IVideoDeviceManager::startVideoDeviceCapture(int index);
Enable video input device and capture.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
index | IN | Device index |
virtual int Thunder::IVideoDeviceManager::stopVideoDeviceCapture();
Disable video device capture.
Notes:
- It can only be called after (initialize).
virtual int Thunder::IVideoDeviceManager::enumMonitorDevices(MonitorDeviceList& devices);
Enumerate monitor input devices.
Notes:
- It can only be called after (initialize).
Parameter | Type | Description |
---|---|---|
devices | OUT | Returned list of video input devices. See details in MonitorDeviceList |
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 Value | Description |
---|---|
AREA_DEFAULT(0) | Domestic, default value |
AREA_FOREIGN(1) | Overseas |
AREA_RESERVED(2) | Reserved |
enum Thunder::THUNDER_PROFILE
Media mode.
Enumeration Value | 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 Value | Description |
---|---|
ROOM_CONFIG_LIVE(0) | Live streaming mode, where quality is prioritized and latency is high. Applicable to viewer or audience scenarios. When an audience starts to stream and becomes an anchor, the value changes to the communication mode. |
ROOM_CONFIG_COMMUNICATION(1) | Communication mode with smooth connection and low latency, which is applicable for one-to-one communication and group conversation. |
ROOM_CONFIG_MultiAudioRoom(4) | Audio room mode with low latency and low bandwidth occupation, which is applicable for group voice chatroom |
enum Thunder::AUDIO_PROFILE_TYPE
Audio types
Enumeration Value | Description |
---|---|
AUDIO_PROFILE_DEFAULT(0) | Default type: "NET_AAC_ELD"(default)-sampling rate: 44.1 kHz, dual channel, code rate: 40 kbps; 1-audio mode, 3-live streaming mode |
AUDIO_PROFILE_SPEECH_STANDARD(1) | Specify a 16 kHz sampling rate, audio encoding, single channel, and an encoding bit rate of about 18 kbps |
AUDIO_PROFILE_MUSIC_STANDARD_STEREO(2) | Specify a 44.1 kHz sampling rate, music encoding, dual channel, and an encoding bit rate of about 24 kbps. Relatively high encoding delay |
AUDIO_PROFILE_MUSIC_STANDARD(3) | Specify a 44.1 kHz sampling rate, music encoding, dual channel, and an encoding bit rate of about 48 kbps. Relatively low encoding delay |
AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(4) | Specify a 44.1 kHz sampling rate, music encoding, dual channel, and an encoding bit rate of about 128 kbps |
AUDIO_PROFILE_MUSIC_HIGHER_QUALITY = 5 | Specify a 44.1 kHz sampling rate, music encoding, dual channel, and an encoding bit rate of about 192 kbps |
enum Thunder::COMMUT_MODE
Interactive mode
Enumeration Value | Description |
---|---|
COMMUT_MODE_DEFAULT(0) | Default type: COMMUT_MODE_DEFAULT. |
COMMUT_MODE_HIGH(1) | Strong interaction mode |
COMMUT_MODE_LOW(2) | Weak interaction mode |
enum Thunder::SCENARIO_MODE
Scenario mode.
Enumeration Value | Description |
---|---|
SCENARIO_MODE_DEFAULT(0) | Default type: SCENARIO_MODE_STABLE_FIRST. |
SCENARIO_MODE_STABLE_FIRST(1) | Smoothness priority: stable, recommended for education |
SCENARIO_MODE_QUALITY_FIRST(2) | Tone quality priority: recommended for shows with few or no co-hosting |
enum Thunder::ThunderSourceType
Audio publishing mode.
Enumeration Value | Description |
---|---|
THUNDER_AUDIO_MIC(0) | Microphone-only |
THUNDER_AUDIO_FILE(1) | File-only |
THUNDER_AUDIO_MIX(2) | Microphone and file |
THUNDER_AUDIO_TYPE_NONE(10) | Stop all uplink audio data |
enum Thunder::AUDIO_RECORDING_FILE_TYPE
Audio publishing mode.
Enumeration Value | 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 Value | Description |
---|---|
AUDIO_RECORDING_QUALITY_LOW(0) | Low audio quality |
AUDIO_RECORDING_QUALITY_MEDIUM(1) | Medium audio quality |
AUDIO_RECORDING_QUALITY_HIGH(2) | High audio quality |
enum Thunder::ThunderAudioRawFrameOperationMode
Audio publishing mode.
Enumeration Value | Description |
---|---|
THUNDER_AUDIO_RAW_FRAME_OPERATION_MODE_READ_ONLY(1) | Read-only mode. The user only gets 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 the SDK |
THUNDER_AUDIO_RAW_FRAME_OPERATION_MODE_READ_WRITE(3) | Read/write mode. The user gets and modifies data from AudioFrame and return them to the SDK for encoding and transmission. |
enum Thunder::LOG_FILTER
Audio publishing mode.
Enumeration Value | 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 types |
VideoPublishMode | Publishing brackets |
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 Value | Description |
---|---|
VIDEO_PUBLISH_PLAYTYPE_SINGLE(0) | Single publishing |
VIDEO_PUBLISH_PLAYTYPE_INTERACT(1) | Co-hosting video publishing |
VIDEO_PUBLISH_PLAYTYPE_SCREENCAP(2) | Screen recording publishing |
enum Thunder::VideoPublishMode
Audio publishing mode
Enumeration Value | Description |
---|---|
VIDEO_PUBLISH_MODE_DEFAULT(-1) | Undefined. The publishing definition is determined by configuration |
VIDEO_PUBLISH_MODE_SMOOTH_DEFINITION(1) | Smooth |
VIDEO_PUBLISH_MODE_NORMAL_DEFINITION(2) | Standard definition |
VIDEO_PUBLISH_MODE_HIGH_DEFINITION(3) | High definition |
VIDEO_PUBLISH_MODE_SUPER_DEFINITION(4) | Ultra high-definition |
VIDEO_PUBLISH_MODE_BLUERAY(5) | Blue ray |
#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 Value | Description |
---|---|
VIDEO_RENDER_MODE_FILL(0) | Pulled to full screen |
VIDEO_RENDER_MODE_ASPECT_FIT(1) | Adapt to the window |
VIDEO_RENDER_MODE_CLIP_TO_BOUNDS(2) | Clipped to full screen |
enum Thunder::ThunderVideoMirrorMode
Mirror mode for local preview video and stream pushing video.
Enumeration Value | Description |
---|---|
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_MIRROR_PUBLISH_NO_MIRROR(0) | Preview is mirrored, but stream pushing is not mirrored |
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_PUBLISH_BOTH_MIRROR(1) | Both preview and stream pushing are monitored |
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_PUBLISH_BOTH_NO_MIRROR(2) | Neither preview nor stream pushing is mirrored |
THUNDER_VIDEO_MIRROR_MODE_PREVIEW_NO_MIRROR_PUBLISH_MIRROR(3) | Preview is mirrored, but stream pushing 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 API setVideoEncoderConfig]
int destHeight; // Width and height of output stream [this parameter has been deprecated and needs to be set according to the API setVideoEncoderConfig]
int codeRate; // Specific value of bit rate (kbps) [this parameter has been deprecated and needs to be set according to the API 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 // Room ID length
#define MAX_THUNDER_UID_LEN 65 // User ID 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 clip the upper and lower / left and right extra regions
int cropX; // X-coordinate of clipping region, left blank means default to center clipping
int cropY; // Y-coordinate of clipping region
int cropW; // Width of clipping region
int cropH; // Height of clipping 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; //Unrealized
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, and 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 features.
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.