PortSIP VoIP SDK Manual for Mac  15.1
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...
 
(int) - PortSIPSDK::setVideoOrientation:
 Change the orientation of the video. 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...
 
(void) - PortSIPSDK::muteMicrophone:
 Mute the device microphone. It's unavailable for Android and iOS. More...
 
(void) - PortSIPSDK::muteSpeaker:
 Mute the device speaker. It's unavailable for Android and iOS. More...
 
(int) - PortSIPSDK::setAudioDeviceId:outputDeviceId:
 Set the audio device that will be used for audio call. More...
 
(void) - PortSIPSDK::getDynamicVolumeLevel:microphoneVolume:
 Obtain the dynamic microphone volume level from current 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.

§ setVideoOrientation:()

- (int) setVideoOrientation: (int)  rotation

Change the orientation of the video.

Parameters
rotationThe video rotation that you want to set (0, 90, 180 or 270).
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.

§ muteMicrophone:()

- (void) muteMicrophone: (BOOL)  mute

Mute the device microphone. It's unavailable for Android and iOS.

Parameters
muteIf the value is set to true, the microphone is muted, or false to have it un-muted.

§ muteSpeaker:()

- (void) muteSpeaker: (BOOL)  mute

Mute the device speaker. It's unavailable for Android and iOS.

Parameters
muteIf the value is set to true, the speaker is muted, or set to false to un-mute it.

§ setAudioDeviceId:outputDeviceId:()

- (int) setAudioDeviceId: (int)  inputDeviceId
outputDeviceId: (int)  outputDeviceId 

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

Parameters
inputDeviceIdDevice ID (index) for audio recording (Microphone).
outputDeviceIdDevice ID (index) for audio playback (Speaker).
Returns
If the function succeeds, it will return value 0. If the function fails, it will return a specific error code.

§ getDynamicVolumeLevel:microphoneVolume:()

- (void) getDynamicVolumeLevel: (int *)  speakerVolume
microphoneVolume: (int *)  microphoneVolume 

Obtain the dynamic microphone volume level from current call.

Parameters
speakerVolumeReturn the dynamic speaker volume by this parameter. It ranges from 0 - 9.
microphoneVolumeReturn the dynamic microphone volume by this parameter. It ranges is 0 - 9.
Remarks
Usually set a timer to call this function to refresh the volume level indicator.

§ 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.