PortSIP VoIP SDK Manual for Android  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 com.portsip.PortSipSdk.enableSendPcmStreamToRemote (long sessionId, boolean state, int streamSamplesPerSec)
 
int com.portsip.PortSipSdk.sendPcmStreamToRemote (long sessionId, byte[] data, int dataLength)
 
int com.portsip.PortSipSdk.enableSendVideoStreamToRemote (long sessionId, boolean state)
 
int com.portsip.PortSipSdk.sendVideoStreamToRemote (long sessionId, byte[] data, int dataLength, int width, int height)
 

Detailed Description

Function Documentation

◆ enableSendPcmStreamToRemote()

int com.portsip.PortSipSdk.enableSendPcmStreamToRemote ( long  sessionId,
boolean  state,
int  streamSamplesPerSec 
)

Enable the SDK send PCM stream data to remote side from another source instead of microphone. This function MUST be called first to send the PCM stream data to another side.

Parameters
sessionIdThe session ID of call.
stateSet to true to enable the send 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.

◆ sendPcmStreamToRemote()

int com.portsip.PortSipSdk.sendPcmStreamToRemote ( long  sessionId,
byte []  data,
int  dataLength 
)

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 16bit, mono.
dataLengthThe size of data.
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:
enableSendPcmStreamToRemote(sessionId, true, 16000);
sendPcmStreamToRemote(sessionId, data, dataSize);

◆ enableSendVideoStreamToRemote()

int com.portsip.PortSipSdk.enableSendVideoStreamToRemote ( long  sessionId,
boolean  state 
)

Enable the SDK to send video stream data to remote side from another source instead of camera.
This function MUST be called first to send the video stream data to another side.

Parameters
sessionIdThe session ID of call.
stateSet to true to enable the send 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()

int com.portsip.PortSipSdk.sendVideoStreamToRemote ( long  sessionId,
byte []  data,
int  dataLength,
int  width,
int  height 
)

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.

Parameters
sessionIdSession ID of the call conversation.
dataThe video stream data. It must be in i420 format.
dataLengthThe size of data.
widthThe width of the video image.
heightThe height of video image.
Returns
If the function succeeds, it will return value is 0. If the function fails, it will return a specific error code.