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
Send audio and video stream functions

Functions

(int) - PortSIPSDK::enableSendPcmStreamToRemote:state:streamSamplesPerSec:
 Enable the SDK to send PCM stream data to remote side from another source instead of microphone. More...
 
(int) - PortSIPSDK::sendPcmStreamToRemote:data:
 Send the audio stream in PCM format from another source instead of audio device capturing (microphone). More...
 
(int) - PortSIPSDK::enableSendVideoStreamToRemote:state:
 Enable the SDK to send video stream data to remote side from another source instead of camera. More...
 
(int) - PortSIPSDK::sendVideoStreamToRemote:data:width:height:
 Send the video stream to remote side. More...
 

Detailed Description

Function Documentation

◆ enableSendPcmStreamToRemote:state:streamSamplesPerSec:()

- (int) enableSendPcmStreamToRemote: (long)  sessionId
state: (BOOL)  state
streamSamplesPerSec: (int)  streamSamplesPerSec 

Enable the SDK to send PCM stream data to remote side from another source instead of microphone.

Parameters
sessionIdThe session ID of call.
stateSet to true to enable the sending stream, or false to disable.
streamSamplesPerSecThe PCM stream data sample in seconds. For example: 8000 or 16000.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.
Remarks
To send the PCM stream data to another side, this function MUST be called first.

◆ sendPcmStreamToRemote:data:()

- (int) sendPcmStreamToRemote: (long)  sessionId
data: (NSData *)  data 

Send the audio stream in PCM format from another source instead of audio device capturing (microphone).

Parameters
sessionIdSession ID of the call conversation.
dataThe PCM audio stream data. It must be in 16bit, mono.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.
Remarks
Usually we should use it like below:
[myVoIPSdk enableSendPcmStreamToRemote:sessionId state:YES streamSamplesPerSec:16000];
[myVoIPSdk sendPcmStreamToRemote:sessionId data:data];

◆ enableSendVideoStreamToRemote:state:()

- (int) enableSendVideoStreamToRemote: (long)  sessionId
state: (BOOL)  state 

Enable the SDK to send video stream data to remote side from another source instead of camera.

Parameters
sessionIdThe session ID of call.
stateSet to true to enable the sending stream, or false to disable.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ sendVideoStreamToRemote:data:width:height:()

- (int) sendVideoStreamToRemote: (long)  sessionId
data: (NSData *)  data
width: (int)  width
height: (int)  height 

Send the video stream to remote side.

Parameters
sessionIdSession ID of the call conversation.
dataThe video stream data. It must be in i420 format.
widthThe video image width.
heightThe video image height.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.
Remarks
Send the video stream in i420 from another source instead of video device capturing (camera).
Before calling this function, you MUST call the enableSendVideoStreamToRemote function.
Usually we should use it like below:
[myVoIPSdk enableSendVideoStreamToRemote:sessionId state:YES];
[myVoIPSdk sendVideoStreamToRemote:sessionId data:data width:352 height:288];