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
Audio and video functions

Functions

int com.portsip.PortSipSdk.setVideoDeviceId (int deviceId)
 
int com.portsip.PortSipSdk.setVideoResolution (int width, int height)
 
int com.portsip.PortSipSdk.setAudioBitrate (long sessionId, int enum_audiocodec, int bitrateKbps)
 
int com.portsip.PortSipSdk.setVideoBitrate (long sessionId, int bitrateKbps)
 
int com.portsip.PortSipSdk.setVideoFrameRate (long sessionId, int frameRate)
 
int com.portsip.PortSipSdk.sendVideo (long sessionId, boolean send)
 
void com.portsip.PortSipSdk.setLocalVideoWindow (PortSIPVideoRenderer renderer)
 
int com.portsip.PortSipSdk.setRemoteVideoWindow (long sessionId, PortSIPVideoRenderer renderer)
 
void com.portsip.PortSipSdk.displayLocalVideo (boolean state)
 
int com.portsip.PortSipSdk.setVideoNackStatus (boolean state)
 
int com.portsip.PortSipSdk.setChannelOutputVolumeScaling (long sessionId, int scaling)
 
Set< PortSipEnumDefine.AudioDevice > com.portsip.PortSipSdk.getAudioDevices ()
 
int com.portsip.PortSipSdk.setAudioDevice (PortSipEnumDefine.AudioDevice defaultDevice)
 

Detailed Description

Function Documentation

◆ setVideoDeviceId()

int com.portsip.PortSipSdk.setVideoDeviceId ( int  deviceId)

Set the video device that will be used for video call.

Parameters
deviceIdDevice ID (index) for video device (camera).
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ setVideoResolution()

int com.portsip.PortSipSdk.setVideoResolution ( int  width,
int  height 
)

Set the video capturing resolution.

Parameters
widthVideo resolution, width
heightVideo resolution, height
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ setAudioBitrate()

int com.portsip.PortSipSdk.setAudioBitrate ( long  sessionId,
int  enum_audiocodec,
int  bitrateKbps 
)

Set the audio bitrate.

Parameters
sessionIdThe session ID of the call.
enum_audiocodecAudio codec type allowed: ENUM_AUDIOCODEC_OPUS
bitrateKbpsThe Audio bitrate in KBPS.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ setVideoBitrate()

int com.portsip.PortSipSdk.setVideoBitrate ( long  sessionId,
int  bitrateKbps 
)

Set the video bitrate.

Parameters
sessionIdThe session ID of the call.
bitrateKbpsThe video bitrate in KBPS.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ setVideoFrameRate()

int com.portsip.PortSipSdk.setVideoFrameRate ( long  sessionId,
int  frameRate 
)

Set the video frame rate. Usually you do not need to call this function to set the frame rate since the SDK uses default frame rate.

Parameters
sessionIdThe session ID of the call.
frameRateThe frame rate value, with its minimum of 5, and maximum value of 30. The greater the value is, the better video quality enabled and more bandwidth required;
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ sendVideo()

int com.portsip.PortSipSdk.sendVideo ( long  sessionId,
boolean  send 
)

Send the video to remote side.

Parameters
sessionIdThe session ID of the call.
sendSet to true to send the video, or false to stop sending.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ setLocalVideoWindow()

void com.portsip.PortSipSdk.setLocalVideoWindow ( PortSIPVideoRenderer  renderer)

Set the window that is used for displaying the local video image.

Parameters
rendererSurfaceView a SurfaceView for displaying local video image from camera.

◆ setRemoteVideoWindow()

int com.portsip.PortSipSdk.setRemoteVideoWindow ( long  sessionId,
PortSIPVideoRenderer  renderer 
)

Set the window for a session that is used for displaying the received remote video image.

Parameters
sessionIdThe session ID of the call.
rendererSurfaceView a SurfaceView for displaying the received remote video image.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ displayLocalVideo()

void com.portsip.PortSipSdk.displayLocalVideo ( boolean  state)

Start/stop displaying the local video image.

Parameters
stateSet to true to display local video image.

◆ setVideoNackStatus()

int com.portsip.PortSipSdk.setVideoNackStatus ( boolean  state)

Enable/disable the NACK feature (rfc6642) which helps to improve the video quality.

Parameters
stateSet to true to enable.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ setChannelOutputVolumeScaling()

int com.portsip.PortSipSdk.setChannelOutputVolumeScaling ( long  sessionId,
int  scaling 
)

Set a volume |scaling| to be applied to the outgoing signal of a specific audio channel.

Parameters
sessionIdThe session ID of the call.
scalingValid scale ranges [0, 1000]. Default is 100.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ getAudioDevices()

Set<PortSipEnumDefine.AudioDevice> com.portsip.PortSipSdk.getAudioDevices ( )

Get current set of available/selectable audio devices.

Returns
Current set of available/selectable audio devices.

◆ setAudioDevice()

int com.portsip.PortSipSdk.setAudioDevice ( PortSipEnumDefine.AudioDevice  defaultDevice)

Set the audio device that will used for audio call. For Android and iOS, switch between earphone and Loudspeaker allowed.

Parameters
defaultDeviceSet to true the SDK use loudspeaker for audio call, this just available for mobile platform only.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.