PortSIP VoIP SDK Manual for Windows  16.2
PortSIP features our newest, supported, quality-assured VoIP SDK used by Several hundred companies around the world for easy VoIP application develop and quality-assured code.
Functions
Audio and video stream callback events

Functions

Int32 PortSIP.SIPCallbackEvents.onAudioRawCallback (IntPtr callbackObject, Int32 sessionId, Int32 callbackType, byte[] data, Int32 dataLength, Int32 samplingFreqHz)
 
Int32 PortSIP.SIPCallbackEvents.onVideoRawCallback (IntPtr callbackObject, Int32 sessionId, Int32 callbackType, Int32 width, Int32 height, byte[] data, Int32 dataLength)
 

Detailed Description

Function Documentation

◆ onAudioRawCallback()

Int32 PortSIP.SIPCallbackEvents.onAudioRawCallback ( IntPtr  callbackObject,
Int32  sessionId,
Int32  callbackType,
byte []  data,
Int32  dataLength,
Int32  samplingFreqHz 
)

This event will be triggered once receiving the audio packets if called enableAudioStreamCallback function.

Parameters
sessionIdThe session ID of the call.
audioCallbackModeThe type that is passed in enableAudioStreamCallback function.
dataThe memory of audio stream. It's in PCM format.
dataLengthThe data size.
samplingFreqHzThe audio stream sample in HZ. For example, it's 8000 or 16000.
Note
Don't call any SDK API functions in this event directly. If you want to call the API functions or other code which is time-consuming, you should post a message to another thread and execute SDK API functions or other code in another thread.

◆ onVideoRawCallback()

Int32 PortSIP.SIPCallbackEvents.onVideoRawCallback ( IntPtr  callbackObject,
Int32  sessionId,
Int32  callbackType,
Int32  width,
Int32  height,
byte []  data,
Int32  dataLength 
)

This event will be triggered once receiving the video packets if called enableVideoStreamCallback function.

Parameters
sessionIdThe session ID of the call.
videoCallbackModeThe type which is passed in enableVideoStreamCallback function.
widthThe width of video image.
heightThe height of video image.
dataThe memory of video stream. It's in YUV420 format, YV12.
dataLengthThe data size.
Note
Don't call any SDK API functions in this event directly. If you want to call the API functions or other code which is time-consuming, you should post a message to another thread and execute SDK API functions or other code in another thread.