PortSIP VoIP SDK Manual for iOS  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

(void) - <PortSIPEventDelegate >::onAudioRawCallback:audioCallbackMode:data:dataLength:samplingFreqHz:
 
(int) - <PortSIPEventDelegate >::onVideoRawCallback:videoCallbackMode:width:height:data:dataLength:
 

Detailed Description

Function Documentation

◆ onAudioRawCallback:audioCallbackMode:data:dataLength:samplingFreqHz:()

- (void PortSIPEventDelegate) onAudioRawCallback: (long)  sessionId
audioCallbackMode: (int)  audioCallbackMode
data: (unsigned char *)  data
dataLength: (int)  dataLength
samplingFreqHz: (int)  samplingFreqHz 

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

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 could be 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:videoCallbackMode:width:height:data:dataLength:()

- (int PortSIPEventDelegate) onVideoRawCallback: (long)  sessionId
videoCallbackMode: (int)  videoCallbackMode
width: (int)  width
height: (int)  height
data: (unsigned char *)  data
dataLength: (int)  dataLength 

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

Parameters
sessionIdThe session ID of the call.
videoCallbackModeThe type passed in enableVideoStreamCallback function.
widthThe width of video image.
heightThe height of video image.
dataThe memory of video stream. It's in YUV420 format, such as YV12.
dataLengthThe data size.
Returns
If you changed the sent video data, dataLength should be returned, otherwise 0.
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.