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

Functions

Int32 PortSIP.PortSIPLib.enableSendPcmStreamToRemote (Int32 sessionId, Boolean state, Int32 streamSamplesPerSec)
 Enable the SDK to send PCM stream data to remote side from another source instead of microphone. More...
 
Int32 PortSIP.PortSIPLib.sendPcmStreamToRemote (Int32 sessionId, byte[] data, Int32 dataLength)
 Send the audio stream in PCM format from another source instead of audio device capturing (microphone). More...
 
Int32 PortSIP.PortSIPLib.enableSendVideoStreamToRemote (Int32 sessionId, Boolean state)
 Enable the SDK send video stream data to remote side from another source instead of camera. More...
 
Int32 PortSIP.PortSIPLib.sendVideoStreamToRemote (Int32 sessionId, byte[] data, Int32 dataLength, Int32 width, Int32 height)
 Send the video stream to remote side. More...
 

Detailed Description

Function Documentation

◆ enableSendPcmStreamToRemote()

Int32 PortSIP.PortSIPLib.enableSendPcmStreamToRemote ( Int32  sessionId,
Boolean  state,
Int32  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 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.
Remarks
This function MUST be called first to send the PCM stream data to another side.

◆ sendPcmStreamToRemote()

Int32 PortSIP.PortSIPLib.sendPcmStreamToRemote ( Int32  sessionId,
byte []  data,
Int32  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 it should be used as below:
enableSendPcmStreamToRemote(sessionId, true, 16000);
sendPcmStreamToRemote(sessionId, data, dataSize);

◆ enableSendVideoStreamToRemote()

Int32 PortSIP.PortSIPLib.enableSendVideoStreamToRemote ( Int32  sessionId,
Boolean  state 
)

Enable the SDK 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()

Int32 PortSIP.PortSIPLib.sendVideoStreamToRemote ( Int32  sessionId,
byte []  data,
Int32  dataLength,
Int32  width,
Int32  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.
dataLengthThe size of data.
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 it should be used as below:
sendVideoStreamToRemote(sessionId, data, dataSize, 352, 288);