Skip to main content
AOQ SDK

AOQ Client SDK macOS API reference

This topic describes the Objective-C APIs, callbacks, and data types of AOQ Client SDK for macOS.

The AOQ SDK provides generic video APIs. Qwen-Audio-Realtime does not support video input or output. For the media capabilities of other models, see their access documentation.
The SDK holds the engine instance as a global singleton, provides APIs through the AoqClientEngine class, and reports asynchronous events through the AoqEngineDelegate protocol.

API index

Engine lifecycle

APIDescription
createEngineCreate an engine instance (singleton)
destroyDestroy the engine instance
getVersionGet the SDK version
connectConnect to the Relay server
disconnectDisconnect from the server

Audio device management

APIDescription
startAudioCaptureOpen the audio capture device (microphone)
stopAudioCaptureClose the audio capture device
muteAudioCaptureMute or unmute audio capture
startAudioPlayerStart audio rendering (remote audio playback)
stopAudioPlayerStop audio rendering
pauseAudioPlayerPause audio rendering, with optional fade-out
resumeAudioPlayerResume audio rendering, with optional fade-in
interruptAudioPlayerInterrupt the current audio session

Audio encoding configuration

APIDescription
setAudioEncoderConfigSet audio encoding parameters
setAudioDecoderConfigSet audio decoding parameters

Audio file playback

APIDescription
startAudioFileStart playing and publishing a local audio file
stopAudioFileStop audio file playback
pauseAudioFilePause audio file playback
resumeAudioFileResume audio file playback
getAudioFileDurationGet the total duration of the audio file
getAudioFileCurrentPositionGet the current playback position of the audio file
setAudioFilePositionMillisSeek to a position in the audio file
setAudioFileVolumeSet the audio file volume
getAudioFileVolumeGet the current audio file volume

External audio streams

APIDescription
addAudioExternalStreamAdd an external audio stream
pushAudioExternalStreamDataPush external PCM audio data
setAudioExternalStreamVolumeSet the external audio stream volume
getAudioExternalStreamVolumeGet the external audio stream volume
clearAudioExternalStreamBufferClear the external audio stream buffer
removeAudioExternalStreamRemove an external audio stream

Audio frame callbacks

APIDescription
setAudioFrameObserverSet the audio frame callback delegate
enableAudioFrameObserverEnable or disable audio frame callbacks at a specified stage

Local audio volume indication

APIDescription
enableLocalAudioVolumeIndicationEnable or disable local capture volume indication

Video device management

APIDescription
startVideoCaptureOpen the video capture device (camera)
stopVideoCaptureClose the video capture device
setLocalViewSet or remove the local video rendering window
setRemoteViewSet or remove the remote video rendering window

Video encoding and external input

APIDescription
setVideoEncoderConfigSet video encoding parameters
setVideoDecoderConfigSet video decoding parameters
pushExternalVideoCapturedFramePush externally captured video frames
pushExternalVideoEncodedFramePush externally encoded video frames

Screen capture

APIDescription
getScreenSourceListGet the list of screen capture sources (Mac desktop only)
startScreenCaptureStart screen capture
stopScreenCaptureStop screen capture

Media stream transmission control

APIDescription
enableSendMediaStreamEnable or disable local media stream transmission

Video frame callbacks

APIDescription
setVideoFrameObserverSet the video frame callback delegate
enableVideoFrameObserverEnable or disable video frame callbacks at a specified stage

Real-time messages

APIDescription
sendDataMsgSend a real-time data message

AoqEngineDelegate

APIDescription
onErrorEngine error callback
onWarningEngine warning callback
onConnectionStatusChangeConnection status change callback
onStatsEngine statistics callback
onAudioDeviceStateChangedAudio device operation status change callback
onAudioDeviceRouteChangedAudio output route change callback
onAudioFileStateAudio file playback status callback
onLocalAudioVolumeIndicationLocal capture volume indication callback
onVideoDeviceStateChangedVideo device operation status change callback
onDataMsgReceived real-time data message callback

AoqAudioFrameDelegate

APIDescription
onCapturedAudioFrameCalled when a raw audio frame is captured. The frame contains unprocessed PCM data.
onProcessCapturedAudioFrameCalled for an audio frame after 3A processing, such as echo cancellation and noise suppression.
onPublishAudioFrameCalled for an audio frame before publishing, immediately before encoding and transmission.
onPlaybackAudioFrameCalled for a remote audio frame before playback, after decoding and mixing.

AoqVideoFrameDelegate

APIDescription
onCapturedVideoFrameCalled when a raw video frame is captured, before preprocessing. trackType distinguishes Video and Screen tracks.
onPreEncodeVideoFrameCalled for a video frame after preprocessing and before encoding.
onRemoteVideoFrameCalled for a remote video frame after decoding and before rendering.

API details

Engine lifecycle

createEngine:delegate:

Creates the engine instance. The SDK holds the engine as a global singleton, so calling this method again returns the existing instance.
+ (instancetype _Nonnull)createEngine:(AoqCreateConfig * _Nonnull)config
                             delegate:(id<AoqEngineDelegate> _Nonnull)delegate;
Parameters
ParametersTypeDescription
configAoqCreateConfig *Engine creation configuration. For more information, see AoqCreateConfig.
delegateid<AoqEngineDelegate>Engine event callback delegate. For more information, see AoqEngineDelegate.
Returns: The engine instance. nil is never returned.

destroy

Destroys the engine instance. After the engine is destroyed, you must call createEngine:delegate: again before you can continue to use it.
+ (int)destroy;
Returns: 0 on success; non-zero on failure.

getVersion

Gets the SDK version.
+ (NSString * _Nonnull)getVersion;
Returns: The version string.

connect:

Connects to the relay server. The application server obtains temporary AOQ connection parameters based on the protocol in use and sends them to the client. For more information, see Token authentication.
- (int)connect:(AoqConnectConfig * _Nonnull)config;
Parameters
ParameterTypeDescription
configAoqConnectConfig *Connection authentication configuration. For more information, see AoqConnectConfig.
Returns: 0 indicates that the call is dispatched and runs asynchronously; non-zero indicates that parameter validation failed.

disconnect

Disconnects from the server.
- (int)disconnect;
Returns: 0 indicates that the call is dispatched and runs asynchronously; non-zero indicates a failure.

Audio device management

startAudioCapture:

Opens the audio capture device (microphone).
- (int)startAudioCapture:(AoqAudioCaptureConfig * _Nonnull)config;
Parameters
ParameterTypeDescription
configAoqAudioCaptureConfig *Audio capture configuration. For more information, see AoqAudioCaptureConfig.
Returns: 0 on success; non-zero on failure.

stopAudioCapture

Closes the audio capture device.
- (int)stopAudioCapture;
Returns: 0 on success; non-zero on failure.

muteAudioCapture:

Mutes or unmutes audio capture.
- (int)muteAudioCapture:(BOOL)mute;
Parameters
ParametersTypeDescription
muteBOOLYES mutes; NO unmutes
Returns: 0 on success; non-zero on failure.

startAudioPlayer:

Starts audio rendering to play remote audio.
- (int)startAudioPlayer:(AoqAudioPlaybackConfig * _Nonnull)config;
Parameters
ParameterTypeDescription
configAoqAudioPlaybackConfig *Audio playback configuration. For more information, see AoqAudioPlaybackConfig.
Returns: 0 on success; non-zero on failure.

stopAudioPlayer

Stops audio rendering.
- (int)stopAudioPlayer;
Returns: 0 on success; non-zero on failure.

pauseAudioPlayer:

Pauses audio rendering, with fade-out supported.
- (int)pauseAudioPlayer:(NSInteger)fadeMs;
Parameters
ParametersTypeDescription
fadeMsNSIntegerFade-out duration, in milliseconds. 0 indicates immediate pause.
Returns: 0 on success; non-zero on failure.

resumeAudioPlayer:

Resumes audio rendering, with fade-in supported.
- (int)resumeAudioPlayer:(NSInteger)fadeMs;
Parameters
ParametersTypeDescription
fadeMsNSIntegerFade-in duration, in milliseconds. 0 indicates immediate resumption.
Returns: 0 on success; non-zero on failure.

interruptAudioPlayer:fadeMs:

Interrupts the current audio session and stops the audio that is currently playing.
- (int)interruptAudioPlayer:(AoqTrackType)trackType fadeMs:(NSInteger)fadeMs;
Parameters
ParameterTypeDescription
trackTypeAoqTrackTypeTrack type. For more information, see AoqTrackType.
fadeMsNSIntegerFade-out duration, in milliseconds. 0 indicates immediate interruption.
Returns: 0 on success; non-zero on failure.

Audio encoding configuration

setAudioEncoderConfig:

Sets audio encoding parameters.
- (int)setAudioEncoderConfig:(AoqAudioCodecConfig * _Nonnull)config;
Parameters
ParameterTypeDescription
configAoqAudioCodecConfig *Audio codec configuration. For more information, see AoqAudioCodecConfig.
Returns: 0 on success; non-zero on failure.

setAudioDecoderConfig:

Sets audio decoding parameters.
- (int)setAudioDecoderConfig:(AoqAudioCodecConfig * _Nonnull)config;
Parameters
ParametersTypeDescription
configAoqAudioCodecConfig *Audio codec configuration. For more information, see AoqAudioCodecConfig.
Returns: 0 on success; non-zero on failure.

Audio file playback

startAudioFile:config:

Starts playing a local audio file to the publishing stream.
- (int)startAudioFile:(NSString * _Nonnull)fileId
               config:(AoqAudioFileMixConfig * _Nonnull)config;
Parameters
ParameterTypeDescription
fileIdNSString *Audio file ID. The business layer must ensure that it is unique.
configAoqAudioFileMixConfig *Audio file mixing configuration. For more information, see AoqAudioFileMixConfig.
Returns: 0 on success; non-zero on failure.

stopAudioFile:

Stops audio file playback.
- (int)stopAudioFile:(NSString * _Nonnull)fileId;
Parameters
ParametersTypeDescription
fileIdNSString *Audio file ID
Returns: 0 on success; non-zero on failure.

pauseAudioFile:

Pauses audio file playback.
- (int)pauseAudioFile:(NSString * _Nonnull)fileId;
Parameters
ParametersTypeDescription
fileIdNSString *Audio file ID
Returns: 0 on success; non-zero on failure.

resumeAudioFile:

Resumes audio file playback.
- (int)resumeAudioFile:(NSString * _Nonnull)fileId;
Parameters
ParametersTypeDescription
fileIdNSString *Audio file ID
Returns: 0 on success; non-zero on failure.

getAudioFileDuration:

Gets the total duration of the audio file.
- (long long)getAudioFileDuration:(NSString * _Nonnull)fileId;
Parameters
ParametersTypeDescription
fileIdNSString *Audio file ID
Returns: A value greater than or equal to 0 indicates the duration of the audio file, in milliseconds; a value less than 0 indicates a failure.

getAudioFileCurrentPosition:

Gets the current playback position of the audio file.
- (long long)getAudioFileCurrentPosition:(NSString * _Nonnull)fileId;
Parameters
ParametersTypeDescription
fileIdNSString *Audio file ID
Returns: A value greater than or equal to 0 indicates the current playback position, in milliseconds; a value less than 0 indicates a failure.

setAudioFilePositionMillis:positionMillis:

Sets the playback position of the audio file (seek).
- (int)setAudioFilePositionMillis:(NSString * _Nonnull)fileId
                  positionMillis:(long long)positionMillis;
Parameters
ParametersTypeDescription
fileIdNSString *Audio file ID
positionMillislong longPlayback position, in milliseconds
Returns: 0 on success; non-zero on failure.

setAudioFileVolume:type:volume:

Sets the volume of the audio file.
- (int)setAudioFileVolume:(NSString * _Nonnull)fileId
                     type:(AoqAudioStreamDirection)type
                   volume:(NSInteger)volume;
Parameters
ParameterTypeDescription
fileIdNSString *Audio file ID
typeAoqAudioStreamDirectionAudio stream direction. For more information, see AoqAudioStreamDirection.
volumeNSIntegerVolume value. Valid values: 0 to 100.
Returns: 0 on success; non-zero on failure.

getAudioFileVolume:type:

Gets the current volume of the audio file.
- (int)getAudioFileVolume:(NSString * _Nonnull)fileId
                     type:(AoqAudioStreamDirection)type;
Parameters
ParametersTypeDescription
fileIdNSString *Audio file ID
typeAoqAudioStreamDirectionAudio stream direction. For more information, see AoqAudioStreamDirection.
Returns: A value from 0 to 100 indicates the volume; a value less than 0 indicates a failure.

External audio streams

addAudioExternalStream:config:

Adds an external audio stream.
- (int)addAudioExternalStream:(NSString * _Nonnull)streamId
                       config:(AoqAudioExternalStreamConfig * _Nonnull)config;
Parameters
ParameterTypeDescription
streamIdNSString *External audio stream ID. The business layer must ensure that it is unique.
configAoqAudioExternalStreamConfig *External audio stream configuration. For more information, see AoqAudioExternalStreamConfig.
Returns: 0 on success; non-zero on failure.

pushAudioExternalStreamData:data:

Feeds external audio PCM data. If AoqECAudioExternalBufferFull (110) is returned, the SDK buffer is full, and we recommend that you wait about 20 ms and then send the current data frame again.
- (int)pushAudioExternalStreamData:(NSString * _Nonnull)streamId
                              data:(AoqAudioFrameData * _Nonnull)data;
Parameters
ParametersTypeDescription
streamIdNSString *External audio stream ID
dataAoqAudioFrameData *Raw external audio data. For more information, see AoqAudioFrameData.
Returns: 0 on success; non-zero on failure.
Best practice: In real-time capture scenarios, push 10 ms of data at a time and push whenever data is available. When the data comes from a file, push 40 ms of data at a time at 30 ms intervals, and handle the AoqECAudioExternalBufferFull return value.

setAudioExternalStreamVolume:type:volume:

Sets the volume of an external audio stream.
- (int)setAudioExternalStreamVolume:(NSString * _Nonnull)streamId
                               type:(AoqAudioStreamDirection)type
                             volume:(NSInteger)volume;
Parameters
ParameterTypeDescription
streamIdNSString *External audio stream ID
typeAoqAudioStreamDirectionExternal audio stream type. For more information, see AoqAudioStreamDirection.
volumeNSIntegerVolume value. Valid values: 0 to 100.
Returns: 0 on success; non-zero on failure.

getAudioExternalStreamVolume:type:

Gets the volume of an external audio stream.
- (int)getAudioExternalStreamVolume:(NSString * _Nonnull)streamId
                               type:(AoqAudioStreamDirection)type;
Parameters
ParametersTypeDescription
streamIdNSString *External audio stream ID
typeAoqAudioStreamDirectionExternal audio stream type. For more information, see AoqAudioStreamDirection.
Returns: A value from 0 to 100 indicates the volume; a value less than 0 indicates a failure.

clearAudioExternalStreamBuffer:fadeoutMs:

Clears the buffer of an external audio stream.
- (void)clearAudioExternalStreamBuffer:(NSString * _Nonnull)streamId
                              fadeoutMs:(NSInteger)fadeoutMs;
Parameters
ParametersTypeDescription
streamIdNSString *External audio stream ID
fadeoutMsNSIntegerFade-out duration. -1 uses the SDK's default fade-out, 0 clears everything without a fade-out, and a value greater than 0 keeps a fade-out of the specified number of milliseconds.
Returns: None.

removeAudioExternalStream:

Removes an external audio stream.
- (int)removeAudioExternalStream:(NSString * _Nonnull)streamId;
Parameters
ParametersTypeDescription
streamIdNSString *External audio stream ID
Returns: 0 on success; non-zero on failure.

Audio frame callbacks

setAudioFrameObserver:

Sets the audio frame data callback delegate. Pass nil to stop callbacks. After you set the delegate, call enableAudioFrameObserver:audioSource:config: to enable the callback for the corresponding data source.
- (int)setAudioFrameObserver:(id<AoqAudioFrameDelegate> _Nullable)delegate;
Parameters
ParameterTypeDescription
delegateid<AoqAudioFrameDelegate>Audio frame callback delegate. For more information, see AoqAudioFrameDelegate. Pass nil to stop callbacks.
Returns: 0 on success; non-zero on failure.

enableAudioFrameObserver:audioSource:config:

Enables or disables the audio frame callback at a specified position.
- (int)enableAudioFrameObserver:(BOOL)enabled
                   audioSource:(AoqAudioSource)audioSource
                        config:(AoqAudioObserverConfig * _Nonnull)config;
Parameters
ParameterTypeDescription
enabledBOOLSpecifies whether to allow data callbacks
audioSourceAoqAudioSourceType of the raw audio data source. For more information, see AoqAudioSource.
configAoqAudioObserverConfig *Callback parameter settings. For more information, see AoqAudioObserverConfig.
Returns: 0 on success; non-zero on failure.

Local audio volume indication

enableLocalAudioVolumeIndication:

Enables or disables local capture volume indication. After it is enabled, the onLocalAudioVolumeIndication: callback is triggered at the interval specified by config.interval. If config.interval <= 0, the callback is disabled. You must call this method after startAudioCapture: to obtain volume data.
- (int)enableLocalAudioVolumeIndication:(AoqAudioVolumeIndicationConfig * _Nonnull)config;
Parameters
ParameterTypeDescription
configAoqAudioVolumeIndicationConfig *Volume indication configuration. For more information, see AoqAudioVolumeIndicationConfig.
Returns: 0 on success; non-zero on failure.

Video device management

startVideoCapture:

Opens the video capture device (camera). When isExternal=YES is configured, the camera is not opened, and frames are fed by pushExternalVideoCapturedFrame:frame:.
- (int)startVideoCapture:(AoqVideoCaptureConfig * _Nonnull)config;
Parameters
ParameterTypeDescription
configAoqVideoCaptureConfig *Video capture configuration. For more information, see AoqVideoCaptureConfig.
Returns: 0 on success; non-zero on failure.

stopVideoCapture

Closes the video capture device.
- (int)stopVideoCapture;
Returns: 0 on success; non-zero on failure.

setLocalView:canvas:

Sets or removes the local video rendering window. If you pass nil for canvas or canvas.view is nil, the binding is removed.
- (int)setLocalView:(AoqTrackType)trackType canvas:(AoqVideoCanvas * _Nullable)canvas;
Parameters
ParameterTypeDescription
trackTypeAoqTrackTypeVideo track. Pass AoqTrackTypeVideo.
canvasAoqVideoCanvas *Rendering canvas. For more information, see AoqVideoCanvas. Pass nil to remove the binding.
Returns: 0 on success; non-zero on failure.

setRemoteView:canvas:

Sets or removes the remote video rendering window. If you pass nil for canvas or canvas.view is nil, the binding is removed.
- (int)setRemoteView:(AoqTrackType)trackType canvas:(AoqVideoCanvas * _Nullable)canvas;
Parameters
ParametersTypeDescription
trackTypeAoqTrackTypeVideo track. Pass AoqTrackTypeVideo.
canvasAoqVideoCanvas *Rendering canvas. For more information, see AoqVideoCanvas. Pass nil to remove the binding.
Returns: 0 on success; non-zero on failure.

Video encoding and external input

setVideoEncoderConfig:

Sets video encoding parameters and routes them based on config.trackType.
- (int)setVideoEncoderConfig:(AoqVideoCodecConfig * _Nonnull)config;
Parameters
ParameterTypeDescription
configAoqVideoCodecConfig *Video codec configuration. For more information, see AoqVideoCodecConfig.
Returns: 0 on success; non-zero on failure.

setVideoDecoderConfig:

Sets video decoding parameters (a codec proposal on the subscribing side, which must be called before connect:). The call is routed based on config.trackType.
- (int)setVideoDecoderConfig:(AoqVideoCodecConfig * _Nonnull)config;
Parameters
ParametersTypeDescription
configAoqVideoCodecConfig *Video codec configuration. For more information, see AoqVideoCodecConfig.
Returns: 0 on success; non-zero on failure.

pushExternalVideoCapturedFrame:frame:

Pushes an external video frame. You must first call startVideoCapture: and configure isExternal=YES. If external video capture is not started or the format is not supported, AoqECParamInvalid is returned.
- (int)pushExternalVideoCapturedFrame:(AoqTrackType)trackType
                                frame:(AoqVideoFrame * _Nonnull)frame;
Parameters
ParameterTypeDescription
trackTypeAoqTrackTypeRouting target. Pass AoqTrackTypeVideo. AoqTrackTypeScreen is also supported.
frameAoqVideoFrame *External video frame data. For more information, see AoqVideoFrame.
Returns: 0 on success; AoqECVideoExternalBufferFull (210) indicates that the buffer is full; a value less than 0 indicates another error.

pushExternalVideoEncodedFrame:frame:

Pushes an externally encoded video frame directly, bypassing the encoder. You must first call setVideoEncoderConfig: and configure isExternal=YES. Only JPEG is currently supported.
- (int)pushExternalVideoEncodedFrame:(AoqTrackType)trackType
                               frame:(AoqVideoEncodedFrame * _Nonnull)frame;
Parameters
ParameterTypeDescription
trackTypeAoqTrackTypeRouting target. Pass AoqTrackTypeVideo. AoqTrackTypeScreen is also supported.
frameAoqVideoEncodedFrame *Externally encoded frame data. For more information, see AoqVideoEncodedFrame.
Returns: 0 on success; non-zero on failure.

Screen capture

- (int)startScreenCapture:(AoqScreenCaptureConfig * _Nonnull)config;
- (int)stopScreenCapture;
config specifies screen capture settings. Screen content is sent on the AoqTrackTypeScreen track. Returns 0 on success or a nonzero value on failure. These methods return synchronously and do not provide an onScreenCaptureStateChanged callback. Call getScreenSourceList to enumerate screens and windows, then pass the selected sourceId and sourceType in the capture configuration. For external raw frames, set isExternal=YES and supply raw Screen frames through pushExternalVideoCapturedFrame for SDK encoding. For external encoded frames, configure the Screen track for external encoding with setVideoEncoderConfig, then call pushExternalVideoEncodedFrame.

getScreenSourceList

- (AoqScreenSourceList * _Nullable)getScreenSourceList;
Returns a screen source list, or nil on failure.

Media stream transmission control

enableSendMediaStream:enable:

Enables or disables sending of a local media stream. We recommend that you disable sending after initialization and enable it only after the onConnectionStatusChange: callback reports AoqConnectionStatusConnected.
- (int)enableSendMediaStream:(AoqTrackType)trackType enable:(BOOL)enable;
Parameters
ParametersTypeDescription
trackTypeAoqTrackTypeRouting target. AoqTrackTypeAudio and AoqTrackTypeVideo are supported. AoqTrackTypeScreen is also supported.
enableBOOLYES enables sending; NO disables sending
Returns: 0 indicates that the call is dispatched and runs asynchronously; non-zero indicates a failure.

Video frame callbacks

setVideoFrameObserver:

Sets the video frame data callback delegate. Pass nil to stop callbacks. After you set the delegate, call enableVideoFrameObserver:videoSource:config: to enable the callback for the corresponding data source.
- (int)setVideoFrameObserver:(id<AoqVideoFrameDelegate> _Nullable)delegate;
Parameters
ParameterTypeDescription
delegateid<AoqVideoFrameDelegate>Video frame callback delegate. For more information, see AoqVideoFrameDelegate. Pass nil to stop callbacks.
Returns: 0 on success; non-zero on failure.

enableVideoFrameObserver:videoSource:config:

Enables or disables the video frame callback at a specified position.
- (int)enableVideoFrameObserver:(BOOL)enabled
                    videoSource:(AoqVideoSource)videoSource
                         config:(AoqVideoObserverConfig * _Nonnull)config;
Parameters
ParameterTypeDescription
enabledBOOLSpecifies whether to enable data callbacks at a position
videoSourceAoqVideoSourceData source of the video frame callback (position in the pipeline). For more information, see AoqVideoSource.
configAoqVideoObserverConfig *Callback parameter settings. For more information, see AoqVideoObserverConfig.
Returns: 0 on success; non-zero on failure.

Real-time messages

sendDataMsg:

Sends a real-time data message.
- (int)sendDataMsg:(AoqDataMsg * _Nonnull)msg;
Parameters
ParameterTypeDescription
msgAoqDataMsg *Message content. For more information, see AoqDataMsg.
Returns: 0 on success; non-zero on failure.

AoqEngineDelegate

AoqEngineDelegate is the unified entry point for all asynchronous event notifications from the SDK. It is passed in when you call createEngine:delegate:. All callback methods are @required. State transitions: Disconnected → Connecting → Connected/Failed → Disconnected.

onError:message:

Engine error callback.
- (void)onError:(NSInteger)code message:(NSString * _Nonnull)message;
Parameters
ParameterTypeDescription
codeNSIntegerError code. For more information, see AoqErrorCode.
messageNSString *Error description

onWarning:message:

Engine warning callback.
- (void)onWarning:(NSInteger)code message:(NSString * _Nonnull)message;
Parameters
ParameterTypeDescription
codeNSIntegerWarning code. For more information, see AoqWarningCode.
messageNSString *Warning description

onConnectionStatusChange:

Engine connection status change callback.
- (void)onConnectionStatusChange:(AoqConnectionStatus)status;
Parameters
ParameterTypeDescription
statusAoqConnectionStatusConnection status. For more information, see AoqConnectionStatus.

onStats:

Engine statistics callback.
- (void)onStats:(AoqStats * _Nonnull)stats;
Parameters
ParameterTypeDescription
statsAoqStats *Statistics data. For more information, see AoqStats.

onAudioDeviceStateChanged:

Callback for audio device capture and playback operation status changes.
- (void)onAudioDeviceStateChanged:(AoqAudioDeviceState * _Nonnull)state;
Parameters
ParameterTypeDescription
stateAoqAudioDeviceState *Audio device state. For more information, see AoqAudioDeviceState.

onAudioDeviceRouteChanged:

Audio output route change callback.
- (void)onAudioDeviceRouteChanged:(NSInteger)routeType;
Parameters
ParameterTypeDescription
routeTypeNSIntegerRoute type. For the valid values, see AoqAudioDeviceRouteType.

onAudioFileState:

Callback for audio file playback status.
- (void)onAudioFileState:(AoqAudioFileState * _Nonnull)state;
Parameters
ParameterTypeDescription
stateAoqAudioFileState *File playback state. For more information, see AoqAudioFileState.

onLocalAudioVolumeIndication:

Local capture volume indication callback. To enable it, call enableLocalAudioVolumeIndication:.
- (void)onLocalAudioVolumeIndication:(AoqAudioVolume * _Nonnull)volume;
Parameters
ParameterTypeDescription
volumeAoqAudioVolume *Local volume information. For more information, see AoqAudioVolume.

onVideoDeviceStateChanged:

Callback for video device capture operation status changes.
- (void)onVideoDeviceStateChanged:(AoqVideoDeviceState * _Nonnull)state;
Parameters
ParameterTypeDescription
stateAoqVideoDeviceState *Video device state. For more information, see AoqVideoDeviceState.

onDataMsg:

Callback for a received real-time data message.
- (void)onDataMsg:(AoqDataMsg * _Nonnull)msg;
Parameters
ParameterTypeDescription
msgAoqDataMsg *Data message. For more information, see AoqDataMsg.

AoqAudioFrameDelegate

Protocol for audio frame data callbacks. All methods are @optional. Do not perform any time-consuming operations in the callbacks. Otherwise, audio anomalies may occur.

onCapturedAudioFrame:

Callback for raw captured data. To enable it, call enableAudioFrameObserver: and set audioSource = AoqAudioSourceCaptured. You can set the sample rate and the number of channels, and read-write mode is supported.
- (void)onCapturedAudioFrame:(AoqAudioFrameData * _Nonnull)frame;
Parameters
ParameterTypeDescription
frameAoqAudioFrameData *Raw captured audio data. For more information, see AoqAudioFrameData.

onProcessCapturedAudioFrame:

Callback for data after 3A processing. To enable it, call enableAudioFrameObserver: and set audioSource = AoqAudioSourceProcessCaptured. You can set the sample rate and the number of channels, and read-write mode is supported.
- (void)onProcessCapturedAudioFrame:(AoqAudioFrameData * _Nonnull)frame;
Parameters
ParameterTypeDescription
frameAoqAudioFrameData *Raw audio data after 3A processing. For more information, see AoqAudioFrameData.

onPublishAudioFrame:frame:

Callback for publishing data. To enable it, call enableAudioFrameObserver: and set audioSource = AoqAudioSourcePublish. You can set the sample rate and the number of channels, and only read-only mode is supported.
- (void)onPublishAudioFrame:(AoqTrackType)trackType
                      frame:(AoqAudioFrameData * _Nonnull)frame;
Parameters
ParameterTypeDescription
trackTypeAoqTrackTypeTrack type. For more information, see AoqTrackType.
frameAoqAudioFrameData *Raw audio data to be published. For more information, see AoqAudioFrameData.

onPlaybackAudioFrame:

Callback for playback data. To enable it, call enableAudioFrameObserver: and set audioSource = AoqAudioSourcePlayback. You can set the sample rate and the number of channels, and read-write mode is supported.
- (void)onPlaybackAudioFrame:(AoqAudioFrameData * _Nonnull)frame;
Parameters
ParameterTypeDescription
frameAoqAudioFrameData *Raw audio data for playback. For more information, see AoqAudioFrameData.

AoqVideoFrameDelegate

Protocol for video frame data callbacks. All methods are @optional. Do not perform any time-consuming operations in the callbacks. Otherwise, video stuttering may occur. A return value of YES indicates that the data is modified and must be written back to the SDK. Writing back takes effect only for I420 and CVPixelBuffer. A return value of NO indicates read-only. The data in frame is valid only during the callback. To use it asynchronously, copy it yourself.

onCapturedVideoFrame:

Callback for local raw data after capture, before preprocessing. To enable it, call enableVideoFrameObserver: and set videoSource = AoqVideoSourceCaptured.
- (BOOL)onCapturedVideoFrame:(AoqTrackType)trackType frame:(AoqVideoFrame * _Nonnull)frame;
Parameters
ParameterTypeDescription
frameAoqVideoFrame *Captured video frame data. For more information, see AoqVideoFrame.
trackTypeAoqTrackTypeVideo track type: Video or Screen.
Returns: YES indicates that the data is modified and must be written back to the SDK; NO indicates read-only.

onPreEncodeVideoFrame:frame:

Callback for local raw data before encoding, after preprocessing. To enable it, call enableVideoFrameObserver: and set videoSource = AoqVideoSourcePreEncode.
- (BOOL)onPreEncodeVideoFrame:(AoqTrackType)trackType
                        frame:(AoqVideoFrame * _Nonnull)frame;
Parameters
ParameterTypeDescription
trackTypeAoqTrackTypeVideo track type. For more information, see AoqTrackType.
frameAoqVideoFrame *Video frame data before encoding. For more information, see AoqVideoFrame.
Returns: YES indicates that the data is modified and must be written back to the SDK; NO indicates read-only.

onRemoteVideoFrame:frame:

Callback for remote raw data after decoding and before rendering. To enable it, call enableVideoFrameObserver: and set videoSource = AoqVideoSourceRemote.
- (BOOL)onRemoteVideoFrame:(AoqTrackType)trackType
                     frame:(AoqVideoFrame * _Nonnull)frame;
Parameters
ParameterTypeDescription
trackTypeAoqTrackTypeVideo track type. For more information, see AoqTrackType.
frameAoqVideoFrame *Remote video frame data. For more information, see AoqVideoFrame.
Returns: YES indicates that the data is modified and must be written back to the SDK; NO indicates read-only.

Data types and enumerations

Common types

AoqCreateConfig

Engine creation configuration.
FieldTypeDefault valueDescription
workDirNSString *""SDK working directory
enableDumpAudioBOOLNOSpecifies whether to enable raw audio data dump (for debugging)
extrasNSString *""Extended parameters
maxEncodedVideoFrameBytesNSInteger190 × 1024Maximum encoded frame size in bytes. Applies only to the SDK internal JPEG encoder. A value of 0 disables the limit.
enableDropOversizedVideoFrameBOOLNOFor the SDK internal JPEG encoder, whether to drop a frame that remains oversized at the lowest quality.

AoqConnectConfig

Configuration for connecting to the relay server.
FieldTypeDescription
tokenNSString *Connection authentication token
sidNSString *Session ID
certFingerprintNSString *Server certificate fingerprint
relayEndpointsNSArray<AoqRelayEndpoint *> *List of relay access points
workspaceIdHashNSString *Workspace hash ID
publishTracksNSArray<AoqTrackParam *> *Array of local publishing track attributes
subscribeTracksNSArray<AoqTrackParam *> *Array of local subscribing track attributes

AoqRelayEndpoint

A relay access point.
FieldTypeDefault valueDescription
routeIndexNSInteger-1Path index
endpointNSString *""Server address (domain name or IP address)
portNSInteger0Server port
tcpPortNSInteger0TCP fallback port. A value of 0 uses the SDK default port, 443.

AoqTrackParam

The track attribute.
FieldTypeDefault valueDescription
trackTypeAoqTrackTypeAudioTrack type
trackModeAoqTrackModeSegmentStreaming or non-streaming mode. Effective only for the audio downlink.

AoqDataMsg

Data structure of a real-time message.
FieldTypeDescription
dataNSData *Message content. It points to memory held by the caller.

Statistics types

AoqStats

Engine statistics.
FieldTypeDescription
audioPublishStatsNSArray<AoqAudioPublishStats *> *Array of publishing statistics for audio
videoPublishStatsNSArray<AoqVideoPublishStats *> *Array of publishing statistics for video
dataMsgPublishStatsNSArray<AoqDataMsgPublishStats *> *Array of publishing statistics for data messages
audioSubscribeStatsNSArray<AoqAudioSubscribeStats *> *Array of subscribing statistics for audio
videoSubscribeStatsNSArray<AoqVideoSubscribeStats *> *Array of subscribing statistics for video
dataMsgSubscribeStatsNSArray<AoqDataMsgSubscribeStats *> *Array of subscribing statistics for data messages
networkStatsAoqNetworkStats *Network statistics

AoqNetworkStats

Network statistics.
FieldTypeDescription
sendBitrateNSUIntegerSend bitrate, in bit/s
sendBytesNSUIntegerCumulative bytes sent
recvBitrateNSUIntegerReceive bitrate, in bit/s
recvBytesNSUIntegerCumulative bytes received
lossNSUIntegerPacket loss rate, from 0 to 100
rttNSUIntegerRound-trip latency, in ms

AoqAudioPublishStats

Publishing statistics for audio.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate, in bit/s
bytesNSUIntegerCumulative bytes
encodeVolumeNSUIntegerEncoding volume of the publishing stream

AoqVideoPublishStats

Publishing statistics for video.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate, in bit/s
bytesNSUIntegerCumulative bytes
encodeFpsNSUIntegerEncoding frame rate

AoqDataMsgPublishStats

Publishing statistics for data messages.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate, in bit/s
bytesNSUIntegerCumulative bytes

AoqAudioSubscribeStats

Subscribing statistics for audio.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate, in bit/s
bytesNSUIntegerCumulative bytes
playVolumeNSUIntegerPlayback volume

AoqVideoSubscribeStats

Subscribing statistics for video.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate, in bit/s
bytesNSUIntegerCumulative bytes
decodeFpsNSUIntegerDecoding frame rate
renderFpsNSUIntegerRendering frame rate

AoqDataMsgSubscribeStats

Subscribing statistics for data messages.
FieldTypeDescription
trackTypeAoqTrackTypeTrack type
bitrateNSUIntegerBitrate, in bit/s
bytesNSUIntegerCumulative bytes

Enumerations

AoqErrorCode

Error code enumeration.
Enum valueValueDescription
AoqECOK0Success
AoqECParamInvalid1Invalid parameter
AoqECStateInvalid2Invalid state
AoqECUnSupport3The API is not supported
AoqECAudio100Generic audio error
AoqECAudioExternalBufferFull110External audio buffer is full
AoqECAudioDevice120Generic audio device error
AoqECAudioDeviceRecordingAuthFailed121Recording permission not granted
AoqECAudioDeviceRecordingOccupied122Recording device is in use
AoqECAudioDeviceRecordingBackgroundStart123Start recording in the background
AoqECAudioDeviceRecordingStartFail124Failed to start recording
AoqECAudioDevicePlayoutOccupied125Playback device is in use
AoqECAudioDevicePlayoutBackgroundStart126Start playback in the background
AoqECAudioDevicePlayoutStartFail127Failed to start playback
AoqECVideo200Generic video error
AoqECVideoExternalBufferFull210External video buffer is full
AoqECVideoExternalCaptureNotEnabled211External video capture is not enabled
AoqECVideoExternalEncoderNotEnabled212External video encoding is not enabled
AoqECVideoDevice220Generic video device error
AoqECVideoDeviceCameraOpenFail221Failed to open the camera
AoqECVideoDeviceCameraAuthFailed222Camera permission not granted
AoqECVideoDeviceCameraOccupied223Camera is in use
AoqECVideoDeviceCameraRunningError224Camera runtime error
AoqECVideoCodec230Generic video codec error
AoqECVideoCodecEncoderInitFail231Failed to initialize the encoder
AoqECVideoRender240Generic video rendering error
AoqECVideoRenderCreateFail241Failed to create the rendering view
AoqECVideoRenderDrawError242Rendering drawing error

AoqWarningCode

Warning code enumeration.
Enum valueValueDescription
AoqWCOK0No warning
AoqWCAudio100Generic audio warning
AoqWCAudioHowling101Audio howling detected
AoqWCAudioDevice120Generic audio device warning
AoqWCAudioDeviceMicEnumerateError121Microphone enumeration error
AoqWCAudioDeviceMicStartTimeout122Microphone startup timed out
AoqWCAudioDeviceRecordingError123Recording error
AoqWCAudioDeviceSpeakerEnumerateError124Speaker enumeration error
AoqWCAudioDeviceSpeakerStartTimeout125Speaker startup timed out
AoqWCAudioDevicePlayoutError126Playback error
AoqWCVideo200Generic video warning
AoqWCVideoCameraEnumerateError201Camera enumeration error
AoqWCVideoEncoderSwitched202Video encoder switched
AoqWCVideoRenderDowngrade203Video rendering downgraded

AoqTrackType

Track type.
Enum valueValueDescription
AoqTrackTypeAudio0Audio track
AoqTrackTypeVideo1Video track
AoqTrackTypeData2Data message track
AoqTrackTypeScreen3Screen sharing track. Supports uplink.

AoqEncoderType

Encoder type.
Enum valueValueDescription
AoqEncoderTypeUnknown0Unknown format
AoqEncoderTypeAudioPCM1Audio PCM
AoqEncoderTypeAudioOpus2Audio Opus
AoqEncoderTypeVideoH2643Video H.264
AoqEncoderTypeVideoJpeg4Video JPEG
AoqEncoderTypeDataText5Message text

AoqTrackMode

Streaming or non-streaming mode. Effective only for the audio downlink.
Enum valueValueDescription
AoqTrackModeSegment0Segmented: data is packaged and delivered in semantic segments, such as a sentence.
AoqTrackModeStream1Streaming: data is delivered continuously.

AoqConnectionStatus

Engine connection status.
Enum valueValueDescription
AoqConnectionStatusDisconnected0Disconnected
AoqConnectionStatusConnecting1Connecting
AoqConnectionStatusConnected2Connected
AoqConnectionStatusFailed3Connection failed

Audio types

AoqAudioCaptureConfig

Audio capture configuration.
FieldTypeDefault valueDescription
isExternalBOOLNOSpecifies whether to use external capture
channelNSInteger1Number of audio capture channels. 1 and 2 are supported.

AoqAudioPlaybackConfig

Audio playback configuration.
FieldTypeDefault valueDescription
isExternalBOOLNOSpecifies whether to use external playback
channelNSInteger1Number of audio playback channels. 1 and 2 are supported.

AoqAudioCodecConfig

Audio codec configuration.
FieldTypeDefault valueDescription
trackTypeAoqTrackTypeAudioTrack type
codecTypeAoqEncoderTypeAudioOpusCodec format
sampleRateNSInteger48000Sample rate, in Hz
channelNSInteger1Number of channels
bitrateNSInteger32000Bitrate, in bit/s

AoqAudioDeviceStateCode

Audio device state code.
Enum valueValueDescription
AoqAudioDeviceNone0No state
AoqAudioDeviceRecordStarting1Capture starting
AoqAudioDeviceRecordStarted2Capture started
AoqAudioDeviceRecordStopping3Capture stopping
AoqAudioDeviceRecordStopped4Capture stopped
AoqAudioDeviceRecordFail5Capture failed
AoqAudioDevicePlayStarting6Playback starting
AoqAudioDevicePlayStarted7Playback started
AoqAudioDevicePlayStopping8Playback stopping
AoqAudioDevicePlayStopped9Playback stopped
AoqAudioDevicePlayFail10Playback failed

AoqAudioDeviceState

Audio device state.
FieldTypeDescription
stateAoqAudioDeviceStateCodeStatus code
reasonNSIntegerError code (AoqErrorCode)

AoqAudioDeviceRouteType

Audio device route type.
Enum valueValueDescription
AoqAudioDeviceRouteDefault0Default
AoqAudioDeviceRouteHeadset1Headphones
AoqAudioDeviceRouteEarpiece2Receiver
AoqAudioDeviceRouteHeadsetNoMic3Headphones without a microphone
AoqAudioDeviceRouteSpeakerPhone4Built-in speaker
AoqAudioDeviceRouteUsb5USB
AoqAudioDeviceRouteBluetooth6Bluetooth
AoqAudioDeviceRouteBluetoothA2dp7Bluetooth A2DP

Audio file types

AoqAudioFileMixConfig

Configuration for playing an audio file to the publishing stream.
FieldTypeDefault valueDescription
fileNameNSString *-File name (including the path). Required.
cyclesNSInteger-1Number of loops. -1 indicates unlimited looping.
startPosMsNSInteger0Start playback position, in ms
publishVolumeNSInteger100Publishing volume. Valid values: 0 to 100.
playoutVolumeNSInteger100Playback volume. Valid values: 0 to 100.

AoqAudioFileStateCode

Audio file state code.
Enum valueValueDescription
AoqAudioFileNone0No state
AoqAudioFileStarted1Started
AoqAudioFileStopped2Stopped
AoqAudioFilePaused3Paused
AoqAudioFileResumed4Resumed
AoqAudioFileEnded5Playback completed
AoqAudioFileBuffering6Buffering
AoqAudioFileBufferingEnd7Buffering ended
AoqAudioFileFailed8Playback failed

AoqAudioFileErrorCode

Audio file playback error code.
Enum valueValueDescription
AoqAudioFileNoError0No error
AoqAudioFileOpenFailed1Failed to open the file
AoqAudioFileDecodeFailed2Failed to decode the file

AoqAudioFileState

Audio file state.
FieldTypeDescription
fileIdNSString *File ID
stateCodeAoqAudioFileStateCodeStatus code
errorCodeAoqAudioFileErrorCodeError code

External audio stream and volume types

AoqAudioStreamDirection

Direction of an external audio stream.
Enum valueValueDescription
AoqAudioStreamPublish0Publishing audio
AoqAudioStreamPlayout1Playback audio

AoqAudioExternalStreamToggle

External audio stream switching state.
Enum valueValueDescription
AoqAudioExternalStreamToggleNormal0Recovered
AoqAudioExternalStreamTogglePause1Paused

AoqAudioExternalStreamConfig

External audio stream configuration.
FieldTypeDefault valueDescription
trackTypeAoqTrackTypeAudioAudio track type
codecTypeAoqEncoderTypeAudioPCMAudio stream format. PCM is supported.
channelsNSInteger1Number of channels
sampleRateNSInteger48000Sample rate, in Hz
playoutVolumeNSInteger100Playback volume. Valid values: 0 to 100.
publishVolumeNSInteger100Publishing volume. Valid values: 0 to 100.
maxBufferDurationNSInteger1000Maximum buffer duration, in ms
enable3ABOOLNOSpecifies whether to apply 3A processing to the input PCM

AoqAudioFrameData

External audio data.
FieldTypeDescription
dataPtrvoid *Pointer to the raw audio PCM data
dataSizeNSIntegerNumber of bytes of the PCM data
numOfSamplesNSIntegerNumber of samples (per channel)
bytesPerSampleNSIntegerBytes per sample
numOfChannelsNSIntegerNumber of channels
samplesPerSecNSIntegerNumber of samples per second
pushSequenceint32_tPCM input round
timeStampint64_tTimestamp
autoGenMuteBOOLValid in data callbacks. YES indicates silent data generated by the SDK.

AoqAudioSource

Data source of the audio frame callback.
Enum valueValueDescription
AoqAudioSourceCaptured0Captured audio data
AoqAudioSourceProcessCaptured1Audio data after 3A processing
AoqAudioSourcePublish2Audio data to be published (requires a successful Connect)
AoqAudioSourcePlayback3Audio data to be played

AoqAudioObserverMode

Audio frame callback mode.
Enum valueValueDescription
AoqAudioObserverModeReadOnly0Read-only
AoqAudioObserverModeReadWrite1Read-write

AoqAudioObserverConfig

Audio frame callback configuration.
FieldTypeDefault valueDescription
sampleRateNSInteger48000Sample rate of the callback audio
channelsNSInteger1Number of audio channels in the callback
modeAoqAudioObserverModeReadOnlyRead-write mode

AoqAudioVolumeIndicationConfig

Local volume indication configuration.
FieldTypeDefaultDescription
reportSpeechBOOLNOWhether to detect speech.
intervalNSInteger0Callback interval in milliseconds. Values of 0 or less disable callbacks; values between 0 and 10 use 10.
smoothNSInteger3Smoothing factor, from 0 to 10. Higher values produce smoother results.

AoqAudioVolume

Local volume information.
FieldTypeDefaultDescription
isSpeechBOOLNOWhether speech is detected.
volumeNSInteger0Smoothed instantaneous volume, from 0 to 255.

Video types

AoqVideoCaptureConfig

Video capture configuration.
FieldTypeDefault valueDescription
widthNSInteger1280Capture width, in pixels. This parameter is ineffective when isExternal=YES.
heightNSInteger720Capture height, in pixels. This parameter is ineffective when isExternal=YES.
fpsNSInteger15Capture frame rate. This parameter is ineffective when isExternal=YES (the pace is determined by frame delivery).
isExternalBOOLNOSpecifies whether to use external capture. If it is YES, the camera is not opened, and frames are fed by pushExternalVideoCapturedFrame:.

AoqVideoCanvas

Data structure for video rendering.
FieldTypeDefault valueDescription
viewNSView *nilDisplay view. Pass nil to remove the rendering binding.
renderModeAoqRenderModeAutoRendering mode
The caller must ensure that the lifecycle of view outlasts the period during which it is set by setLocalView: / setRemoteView:.

AoqRenderMode

Rendering display mode.
Enum valueValueDescription
AoqRenderModeAuto0Auto mode
AoqRenderModeStretch1Stretch-to-fill mode. When the aspect ratios do not match, the image is stretched to the target ratio and becomes distorted.
AoqRenderModeFill2Letterbox mode. When the aspect ratios do not match, black bars are added to the top and bottom or the left and right.
AoqRenderModeCrop3Crop mode. When the aspect ratios do not match, the width or height is cropped and part of the image is lost.

AoqRenderView

The rendering view control, which inherits from NSView and can be used as AoqVideoCanvas.view.
AttributeTypeDescription
engineDisplayViewNSView * (read-only)Display view used internally by the engine
renderWidthint (read-only)Rendering width
renderHeightint (read-only)Rendering height
enableMetalBOOL (read-only)Specifies whether to enable Metal rendering
delegateid<AoqRenderViewDelegate>Event delegate of the rendering view

AoqRenderViewDelegate

The event delegate protocol of the rendering view.
- (void)onRenderViewSizeChanged:(AoqRenderView * _Nonnull)view;
CallbackDescription
onRenderViewSizeChanged:Callback for rendering view size changes

AoqVideoPixelFormat

Video pixel format.
Enum valueValueDescription
AoqVideoPixelFormatUnknown0Unknown format
AoqVideoPixelFormatI4201I420
AoqVideoPixelFormatNV122NV12
AoqVideoPixelFormatNV213NV21
AoqVideoPixelFormatBGRA4BGRA
AoqVideoPixelFormatRGBA5RGBA
AoqVideoPixelFormatCVPixelBuffer6Zero-copy path. Set the pixelBuffer field to CVPixelBufferRef.

AoqVideoFrame

External video data.
FieldTypeDescription
formatAoqVideoPixelFormatPixel format
widthNSIntegerWidth, in pixels
heightNSIntegerHeight, in pixels
dataNSData *Packed-format data (NV12/NV21/BGRA/RGBA)
dataY / dataU / dataVNSData *Data of the three I420 planes
strideY / strideU / strideVNSIntegerStride of the three I420 planes
pixelBufferCVPixelBufferRefZero-copy, which is used when format=AoqVideoPixelFormatCVPixelBuffer
timeStampint64_tTimestamp, in ms. If it is 0, the SDK fills it in with the local clock.

AoqVideoCodecType

The codec type of the externally encoded frame.
Enum valueValueDescription
AoqVideoCodecTypeJPEG0JPEG

AoqVideoEncodedFrame

An externally encoded video frame. The caller performs the encoding, and the SDK packages and sends the frame directly without re-encoding.
FieldTypeDescription
codecAoqVideoCodecTypeCodec format
dataNSData *Encoded data
widthNSIntegerWidth, in pixels
heightNSIntegerHeight, in pixels
timeStampint64_tTimestamp, in ms. If it is 0, the SDK fills it in with the local clock.

AoqVideoCodecConfig

Video codec parameters, which are shared by encoding and decoding. For decoding, only trackType / codecType / width / height / fps / bitrate take effect and participate in negotiation as a subscription proposal, whereas the other fields are used only for encoding.
FieldTypeDefault valueDescription
isExternalBOOLNOExternal encoding mode. When it is YES, you push encoded frames, and the SDK does not perform capture or encoding.
trackTypeAoqTrackTypeVideoTrack type
codecTypeAoqEncoderTypeVideoH264Codec format
widthNSInteger540Resolution width
heightNSInteger960Resolution height
fpsNSInteger5Frame rate
bitrateNSInteger500000Initial bitrate, in bit/s
minBitrateNSInteger128000Minimum bitrate, in bit/s
keyframeIntervalNSInteger2Keyframe interval, in seconds
mirrorModeAoqMirrorModeDisabledMirror mode
orientationModeAoqOrientationModeAutoOrientation mode

AoqMirrorMode

Mirror mode.
Enum valueValueDescription
AoqMirrorModeDisabled0Disable mirroring
AoqMirrorModeEnabled1Enable mirroring

AoqOrientationMode

Orientation mode.
Enum valueValueDescription
AoqOrientationModeAuto0Auto
AoqOrientationModePortrait1Portrait
AoqOrientationModeLandscape2Landscape

AoqVideoDeviceStateCode

Video device state code.
Enum valueValueDescription
AoqVideoDeviceNone0No state
AoqVideoDeviceCaptureStarting1Camera starting
AoqVideoDeviceCaptureStarted2Camera started
AoqVideoDeviceCaptureStopping3Camera stopping
AoqVideoDeviceCaptureStopped4Camera stopped
AoqVideoDeviceCaptureFail5Failed to start the camera

AoqVideoDeviceState

Video device state.
FieldTypeDescription
stateAoqVideoDeviceStateCodeStatus code
reasonNSIntegerError code (AoqErrorCode)

AoqVideoSource

Data source of the video frame callback (position in the pipeline).
Enum valueValueDescription
AoqVideoSourceCaptured0Captured video data before preprocessing
AoqVideoSourcePreEncode1Video data before encoding, after preprocessing
AoqVideoSourceRemote2Remote video data after decoding and before rendering

AoqVideoObserverMode

Video frame callback mode.
Enum valueValueDescription
AoqVideoObserverModeReadOnly0Read-only
AoqVideoObserverModeReadWrite1Read-write

AoqVideoObserverAlignment

Width alignment method for video output.
Enum valueValueDescription
AoqVideoObserverAlignmentDefault0Default
AoqVideoObserverAlignmentEven1Even-number alignment
AoqVideoObserverAlignment424-byte alignment
AoqVideoObserverAlignment838-byte alignment
AoqVideoObserverAlignment16416-byte alignment

AoqVideoObserverConfig

Video frame callback configuration.
FieldTypeDefault valueDescription
formatAoqVideoPixelFormatI420Expected pixel format of the callback data
alignmentAoqVideoObserverAlignmentDefaultWidth alignment policy
modeAoqVideoObserverModeReadOnlyRead-write mode. ReadWrite is supported only for I420 / CVPixelBuffer.
mirrorAppliedBOOLNOSpecifies whether to mirror the callback data
trackTypeAoqTrackTypeAoqTrackTypeVideoVideo track to observe. Supports Video and Screen only.

Screen capture types

AoqScreenShareSourceType

ValueNumberDescription
AoqScreenShareSourceTypeDesktop0Entire desktop
AoqScreenShareSourceTypeWindow1A specific window

AoqScreenSourceInfo

FieldTypeDefaultDescription
sourceTypeAoqScreenShareSourceTypeDesktopSource type
sourceIdint64_t0Source ID
sourceNameNSString *—Source name
sourceIsSelfBOOL—Whether the window belongs to the current process

AoqScreenSourceList

FieldTypeDescription
sourceListNSArray<AoqScreenSourceInfo *> *Array of screen sources

AoqScreenCaptureConfig

FieldTypeDefaultDescription
isExternalBOOLNOWhether the application supplies raw screen frames.
sourceIdint64_t0Screen source ID.
sourceTypeAoqScreenShareSourceTypeAoqScreenShareSourceTypeWindowScreen source type.