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 functions

Functions

(int) - PortSIPSDK::setVideoDeviceId:
 Set the video device that will be used for video call. More...
 
(int) - PortSIPSDK::setVideoResolution:height:
 Set the video capturing resolution. More...
 
(int) - PortSIPSDK::setAudioBitrate:codecType:bitrateKbps:
 Set the audio bit rate. More...
 
(int) - PortSIPSDK::setVideoBitrate:bitrateKbps:
 Set the video bitrate. More...
 
(int) - PortSIPSDK::setVideoFrameRate:frameRate:
 Set the video frame rate. More...
 
(int) - PortSIPSDK::sendVideo:sendState:
 Send the video to remote side. More...
 
(void) - PortSIPSDK::setLocalVideoWindow:
 Set the window on which the local video image will be displayed. More...
 
(int) - PortSIPSDK::setRemoteVideoWindow:remoteVideoWindow:
 Set the window for a session to display the received remote video image. More...
 
(int) - PortSIPSDK::displayLocalVideo:
 Start/stop displaying the local video image. More...
 
(int) - PortSIPSDK::setVideoNackStatus:
 Enable/disable the NACK feature (RFC4585) to help to improve the video quality. More...
 
(int) - PortSIPSDK::setLoudspeakerStatus:
 Set the audio device that will be used for audio call. More...
 
(int) - PortSIPSDK::setChannelOutputVolumeScaling:scaling:
 

Detailed Description

Function Documentation

◆ setVideoDeviceId:()

- (int) 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:height:()

- (int) setVideoResolution: (int)  width
height: (int)  height 

Set the video capturing resolution.

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

◆ setAudioBitrate:codecType:bitrateKbps:()

- (int) setAudioBitrate: (long)  sessionId
codecType: (AUDIOCODEC_TYPE)  codecType
bitrateKbps: (int)  bitrateKbps 

Set the audio bit rate.

Parameters
sessionIdThe session ID of the call.
codecTypeAudio codec type.
bitrateKbpsThe Audio bit rate in KBPS.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ setVideoBitrate:bitrateKbps:()

- (int) setVideoBitrate: (long)  sessionId
bitrateKbps: (int)  bitrateKbps 

Set the video bitrate.

Parameters
sessionIdThe session ID of the call. Set it to -1 for all calls.
bitrateKbpsThe video bit rate in KBPS.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

◆ setVideoFrameRate:frameRate:()

- (int) setVideoFrameRate: (long)  sessionId
frameRate: (int)  frameRate 

Set the video frame rate.

Parameters
sessionIdThe session ID of the call. Set it to -1 for all calls.
frameRateThe frame rate value, with its minimum value 5, and maximum value 30. Greater value renders better video quality but requires more bandwidth.
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.
Remarks
Usually you do not need to call this function to set the frame rate, as the SDK uses default frame rate.

◆ sendVideo:sendState:()

- (int) sendVideo: (long)  sessionId
sendState: (BOOL)  sendState 

Send the video to remote side.

Parameters
sessionIdThe session ID of the call.
sendStateSet 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) setLocalVideoWindow: (PortSIPVideoRenderView *)  localVideoWindow

Set the window on which the local video image will be displayed.

Parameters
localVideoWindowThe PortSIPVideoRenderView for displaying local video image from camera.

◆ setRemoteVideoWindow:remoteVideoWindow:()

- (int) setRemoteVideoWindow: (long)  sessionId
remoteVideoWindow: (PortSIPVideoRenderView *)  remoteVideoWindow 

Set the window for a session to display the received remote video image.

Parameters
sessionIdThe session ID of the call.
remoteVideoWindowThe PortSIPVideoRenderView for displaying 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:()

- (int) displayLocalVideo: (BOOL)  state

Start/stop displaying the local video image.

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

◆ setVideoNackStatus:()

- (int) setVideoNackStatus: (BOOL)  state

Enable/disable the NACK feature (RFC4585) to help 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.

◆ setLoudspeakerStatus:()

- (int) setLoudspeakerStatus: (BOOL)  enable

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

Parameters
enableBy setting to true the SDK uses loudspeaker for audio call. This is 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.
Remarks
Allow to switch between earphone and loudspeaker only.

◆ setChannelOutputVolumeScaling:scaling:()

- (int) setChannelOutputVolumeScaling: (long)  sessionId
scaling: (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.