AOQ macOS SDK Objective-C API reference
This topic describes the Objective-C APIs, callbacks, and data types of AOQ Client SDK for macOS.
The SDK holds the engine instance as a global singleton, provides APIs through the
Creates the engine instance. The SDK holds the engine as a global singleton, so calling this method again returns the existing instance.
Parameters
Returns: The engine instance. nil is never returned.
Destroys the engine instance. After the engine is destroyed, you must call
Returns: 0 on success; non-zero on failure.
Gets the SDK version.
Returns: The version string.
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, seeToken authentication.
Parameters
Returns: 0 indicates that the call is dispatched and runs asynchronously; non-zero indicates that parameter validation failed.
Disconnects from the server.
Returns: 0 indicates that the call is dispatched and runs asynchronously; non-zero indicates a failure.
Opens the audio capture device (microphone).
Parameters
Returns: 0 on success; non-zero on failure.
Closes the audio capture device.
Returns: 0 on success; non-zero on failure.
Mutes or unmutes audio capture.
Parameters
Returns: 0 on success; non-zero on failure.
Starts audio rendering to play remote audio.
Parameters
Returns: 0 on success; non-zero on failure.
Stops audio rendering.
Returns: 0 on success; non-zero on failure.
Pauses audio rendering, with fade-out supported.
Parameters
Returns: 0 on success; non-zero on failure.
Resumes audio rendering, with fade-in supported.
Parameters
Returns: 0 on success; non-zero on failure.
Interrupts the current audio session and stops the audio that is currently playing.
Parameters
Returns: 0 on success; non-zero on failure.
Enables or disables local capture volume indication. After it is enabled, the
Parameters
Returns: 0 on success; non-zero on failure.
Sets audio encoding parameters.
Parameters
Returns: 0 on success; non-zero on failure.
Sets audio decoding parameters.
Parameters
Returns: 0 on success; non-zero on failure.
Opens the video capture device (camera). When
Parameters
Returns: 0 on success; non-zero on failure.
Closes the video capture device.
Returns: 0 on success; non-zero on failure.
Sets or removes the local video rendering window. If you pass nil for
Parameters
Returns: 0 on success; non-zero on failure.
Sets or removes the remote video rendering window. If you pass nil for
Parameters
Returns: 0 on success; non-zero on failure.
Sets video encoding parameters and routes them based on
Parameters
Returns: 0 on success; non-zero on failure.
Sets video decoding parameters (a codec proposal on the subscribing side, which must be called before
Parameters
Returns: 0 on success; non-zero on failure.
Pushes an external video frame. You must first call
Parameters
Returns: 0 on success;
Pushes an externally encoded video frame directly, bypassing the encoder. You must first call
Parameters
Returns: 0 on success; non-zero on failure.
Enables or disables sending of a local media stream. We recommend that you disable sending after initialization and enable it only after the
Parameters
Returns: 0 indicates that the call is dispatched and runs asynchronously; non-zero indicates a failure.
Starts playing a local audio file to the publishing stream.
Parameters
Returns: 0 on success; non-zero on failure.
Stops audio file playback.
Parameters
Returns: 0 on success; non-zero on failure.
Pauses audio file playback.
Parameters
Returns: 0 on success; non-zero on failure.
Resumes audio file playback.
Parameters
Returns: 0 on success; non-zero on failure.
Gets the total duration of the audio file.
Parameters
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.
Gets the current playback position of the audio file.
Parameters
Returns: A value greater than or equal to 0 indicates the current playback position, in milliseconds; a value less than 0 indicates a failure.
Sets the playback position of the audio file (seek).
Parameters
Returns: 0 on success; non-zero on failure.
Sets the volume of the audio file.
Parameters
Returns: 0 on success; non-zero on failure.
Gets the current volume of the audio file.
Parameters
Returns: A value from 0 to 100 indicates the volume; a value less than 0 indicates a failure.
Adds an external audio stream.
Parameters
Returns: 0 on success; non-zero on failure.
Feeds external audio PCM data. If
Parameters
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
Sets the volume of an external audio stream.
Parameters
Returns: 0 on success; non-zero on failure.
Gets the volume of an external audio stream.
Parameters
Returns: A value from 0 to 100 indicates the volume; a value less than 0 indicates a failure.
Clears the buffer of an external audio stream.
Parameters
Returns: None.
Removes an external audio stream.
Parameters
Returns: 0 on success; non-zero on failure.
Sends a real-time data message.
Parameters
Returns: 0 on success; non-zero on failure.
Sets the audio frame data callback delegate. Pass nil to stop callbacks. After you set the delegate, call
Parameters
Returns: 0 on success; non-zero on failure.
Enables or disables the audio frame callback at a specified position.
Parameters
Returns: 0 on success; non-zero on failure.
Sets the video frame data callback delegate. Pass nil to stop callbacks. After you set the delegate, call
Parameters
Returns: 0 on success; non-zero on failure.
Enables or disables the video frame callback at a specified position.
Parameters
Returns: 0 on success; non-zero on failure.
Engine error callback.
Parameters
Engine warning callback.
Parameters
Engine connection status change callback.
Parameters
Engine statistics callback.
Parameters
Callback for audio device capture and playback operation status changes.
Parameters
Audio output route change callback.
Parameters
Callback for audio file playback status.
Parameters
Local capture volume indication callback. To enable it, call
Parameters
Callback for video device capture operation status changes.
Parameters
Callback for a received real-time data message.
Parameters
Protocol for audio frame data callbacks. All methods are
Callback for raw captured data. To enable it, call
Parameters
Callback for data after 3A processing. To enable it, call
Parameters
Callback for publishing data. To enable it, call
Parameters
Callback for playback data. To enable it, call
Parameters
Protocol for video frame data callbacks. All methods are
Callback for local raw data after capture, before preprocessing. To enable it, call
Parameters
Returns:
Callback for local raw data before encoding, after preprocessing. To enable it, call
Parameters
Returns:
Callback for remote raw data after decoding and before rendering. To enable it, call
Parameters
Returns:
Engine creation configuration.
Configuration for connecting to the relay server.
A relay access point.
The track attribute.
Data structure of a real-time message.
Engine statistics.
Network statistics.
Publishing statistics for audio.
Publishing statistics for video.
Publishing statistics for data messages.
Subscribing statistics for audio.
Subscribing statistics for video.
Subscribing statistics for data messages.
Error code enumeration.
Warning code enumeration.
Track type.
Encoder type.
Streaming or non-streaming mode. Effective only for the audio downlink.
Engine connection status.
Audio capture configuration.
Audio playback configuration.
Audio codec configuration.
Audio device state.
Audio device state code.
Audio device route type.
Configuration for playing an audio file to the publishing stream.
Audio file state.
Audio file state code.
Audio file playback error code.
External audio stream configuration.
External audio data.
Direction of an external audio stream.
External audio stream switching state.
Data source of the audio frame callback.
Audio frame callback mode.
Audio frame callback configuration.
Local volume indication configuration.
Local volume information.
Video capture configuration.
Data structure for video rendering.
The caller must ensure that the lifecycle of
Rendering display mode.
Video pixel format.
External video data.
An externally encoded video frame. The caller performs the encoding, and the SDK packages and sends the frame directly without re-encoding.
The codec type of the externally encoded frame.
Video device state.
Video device state code.
Mirror mode.
Orientation mode.
Video codec parameters, which are shared by encoding and decoding. For decoding, only
Data source of the video frame callback (position in the pipeline).
Video frame callback mode.
Width alignment method for video output.
Video frame callback configuration.
The rendering view control, which inherits from
The event delegate protocol of the rendering view.
AoqClientEngine class, and reports asynchronous events through the AoqEngineDelegate protocol.
API index
Engine lifecycle
| API | Description |
|---|---|
createEngine:delegate: | Create the engine instance (singleton) |
destroy | Destroy the engine instance |
getVersion | Get the SDK version |
connect: | Connect to the relay server |
disconnect | Disconnect from the server |
Audio device management
| API | Description |
|---|---|
startAudioCapture: | Open the audio capture device (microphone) |
stopAudioCapture | Close the audio capture device |
muteAudioCapture: | Mute or unmute audio capture |
startAudioPlayer: | Start audio rendering to play remote audio |
stopAudioPlayer | Stop audio rendering |
pauseAudioPlayer: | Pause audio rendering (fade-out supported) |
resumeAudioPlayer: | Resume audio rendering (fade-in supported) |
interruptAudioPlayer:fadeMs: | Interrupt the current audio session |
enableLocalAudioVolumeIndication: | Enable or disable local capture volume indication |
Audio encoding configuration
| API | Description |
|---|---|
setAudioEncoderConfig: | Set audio encoding parameters |
setAudioDecoderConfig: | Set audio decoding parameters |
Video device management
| API | Description |
|---|---|
startVideoCapture: | Open the video capture device (camera) |
stopVideoCapture | Close the video capture device |
setLocalView:canvas: | Set or remove the local video rendering window |
setRemoteView:canvas: | Set or remove the remote video rendering window |
Video encoding and external input
| API | Description |
|---|---|
setVideoEncoderConfig: | Set video encoding parameters |
setVideoDecoderConfig: | Set video decoding parameters |
pushExternalVideoCapturedFrame:frame: | Push an externally captured video frame |
pushExternalVideoEncodedFrame:frame: | Push an externally encoded video frame |
Media stream control
| API | Description |
|---|---|
enableSendMediaStream:enable: | Enable or disable sending of a local media stream |
Audio file playback
| API | Description |
|---|---|
startAudioFile:config: | Start playing a local audio file to the publishing stream |
stopAudioFile: | Stop audio file playback |
pauseAudioFile: | Pause audio file playback |
resumeAudioFile: | Resume audio file playback |
getAudioFileDuration: | Query the total duration of the audio file |
getAudioFileCurrentPosition: | Query the current playback position of the audio file |
setAudioFilePositionMillis:positionMillis: | Set the playback position of the audio file (seek) |
setAudioFileVolume:type:volume: | Set the volume of the audio file |
getAudioFileVolume:type: | Query the current volume of the audio file |
External audio streams
| API | Description |
|---|---|
addAudioExternalStream:config: | Add an external audio stream |
pushAudioExternalStreamData:data: | Feed external audio PCM data |
setAudioExternalStreamVolume:type:volume: | Set the volume of an external audio stream |
getAudioExternalStreamVolume:type: | Query the volume of an external audio stream |
clearAudioExternalStreamBuffer:fadeoutMs: | Clear the buffer of an external audio stream |
removeAudioExternalStream: | Remove an external audio stream |
Real-time messaging
| API | Description |
|---|---|
sendDataMsg: | Send a real-time data message |
Audio frame callbacks
| API | Description |
|---|---|
setAudioFrameObserver: | Set the audio frame data callback listener |
enableAudioFrameObserver:audioSource:config: | Enable or disable the audio frame callback at a specified position |
Video frame callbacks
| API | Description |
|---|---|
setVideoFrameObserver: | Set the video frame data callback listener |
enableVideoFrameObserver:videoSource:config: | Enable or disable the video frame callback at a specified position |
AoqEngineDelegate callbacks
| Callback | Description |
|---|---|
onError:message: | Engine error callback |
onWarning:message: | Engine warning callback |
onConnectionStatusChange: | Connection status change callback |
onStats: | Engine statistics callback |
onAudioDeviceStateChanged: | Audio device operation status change callback |
onAudioDeviceRouteChanged: | Audio output route change callback |
onAudioFileState: | Audio file playback status callback |
onLocalAudioVolumeIndication: | Local capture volume indication callback |
onVideoDeviceStateChanged: | Video device operation status change callback |
onDataMsg: | Callback for a received real-time data message |
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.
| Parameters | Type | Description |
|---|---|---|
config | AoqCreateConfig * | Engine creation configuration. For more information, see AoqCreateConfig. |
delegate | id<aoqenginedelegate> | Engine event callback delegate. For more information, see AoqEngineDelegate. |
destroy
Destroys the engine instance. After the engine is destroyed, you must call createEngine:delegate: again before you can continue to use it.
getVersion
Gets the SDK version.
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, seeToken authentication.
| Parameters | Type | Description |
|---|---|---|
config | AoqConnectConfig * | Connection authentication configuration. For more information, see AoqConnectConfig. |
disconnect
Disconnects from the server.
Audio device management
startAudioCapture:
Opens the audio capture device (microphone).
| Parameters | Type | Description |
|---|---|---|
config | AoqAudioCaptureConfig * | Audio capture configuration. For more information, see AoqAudioCaptureConfig. |
stopAudioCapture
Closes the audio capture device.
muteAudioCapture:
Mutes or unmutes audio capture.
| Parameters | Type | Description |
|---|---|---|
mute | BOOL | YES mutes;NO unmutes |
startAudioPlayer:
Starts audio rendering to play remote audio.
| Parameters | Type | Description |
|---|---|---|
config | AoqAudioPlaybackConfig * | Audio playback configuration. For more information, see AoqAudioPlaybackConfig. |
stopAudioPlayer
Stops audio rendering.
pauseAudioPlayer:
Pauses audio rendering, with fade-out supported.
| Parameters | Type | Description |
|---|---|---|
fadeMs | NSInteger | Fade-out duration, in milliseconds. 0 indicates immediate pause. |
resumeAudioPlayer:
Resumes audio rendering, with fade-in supported.
| Parameters | Type | Description |
|---|---|---|
fadeMs | NSInteger | Fade-in duration, in milliseconds. 0 indicates immediate resumption. |
interruptAudioPlayer:fadeMs:
Interrupts the current audio session and stops the audio that is currently playing.
| Parameters | Type | Description |
|---|---|---|
trackType | AoqTrackType | Track type. For more information, see AoqTrackType. |
fadeMs | NSInteger | Fade-out duration, in milliseconds. 0 indicates immediate interruption. |
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.
| Parameters | Type | Description |
|---|---|---|
config | AoqAudioVolumeIndicationConfig * | Volume indication configuration. For more information, see AoqAudioVolumeIndicationConfig. |
Audio encoding configuration
setAudioEncoderConfig:
Sets audio encoding parameters.
| Parameters | Type | Description |
|---|---|---|
config | AoqAudioCodecConfig * | Audio codec configuration. For more information, see AoqAudioCodecConfig. |
setAudioDecoderConfig:
Sets audio decoding parameters.
| Parameters | Type | Description |
|---|---|---|
config | AoqAudioCodecConfig * | Audio codec configuration. For more information, see AoqAudioCodecConfig. |
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:.
| Parameters | Type | Description |
|---|---|---|
config | AoqVideoCaptureConfig * | Video capture configuration. For more information, see AoqVideoCaptureConfig. |
stopVideoCapture
Closes the video capture device.
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.
| Parameters | Type | Description |
|---|---|---|
trackType | AoqTrackType | Video track. Pass AoqTrackTypeVideo. |
canvas | AoqVideoCanvas * | Rendering canvas. For more information, see AoqVideoCanvas. Pass nil to remove the binding. |
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.
| Parameters | Type | Description |
|---|---|---|
trackType | AoqTrackType | Video track. Pass AoqTrackTypeVideo. |
canvas | AoqVideoCanvas * | Rendering canvas. For more information, see AoqVideoCanvas. Pass nil to remove the binding. |
Video encoding and external input
setVideoEncoderConfig:
Sets video encoding parameters and routes them based on config.trackType.
| Parameters | Type | Description |
|---|---|---|
config | AoqVideoCodecConfig * | Video codec configuration. For more information, see AoqVideoCodecConfig. |
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.
| Parameters | Type | Description |
|---|---|---|
config | AoqVideoCodecConfig * | Video codec configuration. For more information, see AoqVideoCodecConfig. |
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.
| Parameters | Type | Description |
|---|---|---|
trackType | AoqTrackType | Routing target. Pass AoqTrackTypeVideo. |
frame | AoqVideoFrame * | External video frame data. For more information, see AoqVideoFrame. |
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.
| Parameters | Type | Description |
|---|---|---|
trackType | AoqTrackType | Routing target. Pass AoqTrackTypeVideo. |
frame | AoqVideoEncodedFrame * | Externally encoded frame data. For more information, see AoqVideoEncodedFrame. |
Media stream 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.
| Parameters | Type | Description |
|---|---|---|
trackType | AoqTrackType | Routing target. AoqTrackTypeAudio and AoqTrackTypeVideo are supported. |
enable | BOOL | YES enables sending;NO disables sending |
Audio file playback
startAudioFile:config:
Starts playing a local audio file to the publishing stream.
| Parameters | Type | Description |
|---|---|---|
fileId | NSString * | Audio file ID. The business layer must ensure that it is unique. |
config | AoqAudioFileMixConfig * | Audio file mixing configuration. For more information, see AoqAudioFileMixConfig. |
stopAudioFile:
Stops audio file playback.
| Parameters | Type | Description |
|---|---|---|
fileId | NSString * | Audio file ID |
pauseAudioFile:
Pauses audio file playback.
| Parameters | Type | Description |
|---|---|---|
fileId | NSString * | Audio file ID |
resumeAudioFile:
Resumes audio file playback.
| Parameters | Type | Description |
|---|---|---|
fileId | NSString * | Audio file ID |
getAudioFileDuration:
Gets the total duration of the audio file.
| Parameters | Type | Description |
|---|---|---|
fileId | NSString * | Audio file ID |
getAudioFileCurrentPosition:
Gets the current playback position of the audio file.
| Parameters | Type | Description |
|---|---|---|
fileId | NSString * | Audio file ID |
setAudioFilePositionMillis:positionMillis:
Sets the playback position of the audio file (seek).
| Parameters | Type | Description |
|---|---|---|
fileId | NSString * | Audio file ID |
positionMillis | long long | Playback position, in milliseconds |
setAudioFileVolume:type:volume:
Sets the volume of the audio file.
| Parameters | Type | Description |
|---|---|---|
fileId | NSString * | Audio file ID |
type | AoqAudioStreamDirection | Audio stream direction. For more information, see AoqAudioStreamDirection. |
volume | NSInteger | Volume value. Valid values: 0 to 100. |
getAudioFileVolume:type:
Gets the current volume of the audio file.
| Parameters | Type | Description |
|---|---|---|
fileId | NSString * | Audio file ID |
type | AoqAudioStreamDirection | Audio stream direction. For more information, see AoqAudioStreamDirection. |
External audio streams
addAudioExternalStream:config:
Adds an external audio stream.
| Parameters | Type | Description |
|---|---|---|
streamId | NSString * | External audio stream ID. The business layer must ensure that it is unique. |
config | AoqAudioExternalStreamConfig * | External audio stream configuration. For more information, see AoqAudioExternalStreamConfig. |
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.
| Parameters | Type | Description |
|---|---|---|
streamId | NSString * | External audio stream ID |
data | AoqAudioFrameData * | Raw external audio data. For more information, see AoqAudioFrameData. |
AoqECAudioExternalBufferFull return value.
setAudioExternalStreamVolume:type:volume:
Sets the volume of an external audio stream.
| Parameters | Type | Description |
|---|---|---|
streamId | NSString * | External audio stream ID |
type | AoqAudioStreamDirection | External audio stream type. For more information, see AoqAudioStreamDirection. |
volume | NSInteger | Volume value. Valid values: 0 to 100. |
getAudioExternalStreamVolume:type:
Gets the volume of an external audio stream.
| Parameters | Type | Description |
|---|---|---|
streamId | NSString * | External audio stream ID |
type | AoqAudioStreamDirection | External audio stream type. For more information, see AoqAudioStreamDirection. |
clearAudioExternalStreamBuffer:fadeoutMs:
Clears the buffer of an external audio stream.
| Parameters | Type | Description |
|---|---|---|
streamId | NSString * | External audio stream ID |
fadeoutMs | NSInteger | Fade-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. |
removeAudioExternalStream:
Removes an external audio stream.
| Parameters | Type | Description |
|---|---|---|
streamId | NSString * | External audio stream ID |
Real-time messaging
sendDataMsg:
Sends a real-time data message.
| Parameters | Type | Description |
|---|---|---|
msg | AoqDataMsg * | Message content. For more information, see AoqDataMsg. |
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.
| Parameters | Type | Description |
|---|---|---|
delegate | id<aoqaudioframedelegate> | Audio frame callback delegate. For more information, see AoqAudioFrameDelegate. Pass nil to stop callbacks. |
enableAudioFrameObserver:audioSource:config:
Enables or disables the audio frame callback at a specified position.
| Parameters | Type | Description |
|---|---|---|
enabled | BOOL | Specifies whether to allow data callbacks |
audioSource | AoqAudioSource | Type of the raw audio data source. For more information, see AoqAudioSource. |
config | AoqAudioObserverConfig * | Callback parameter settings. For more information, see AoqAudioObserverConfig. |
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.
| Parameters | Type | Description |
|---|---|---|
delegate | id<aoqvideoframedelegate> | Video frame callback delegate. For more information, see AoqVideoFrameDelegate. Pass nil to stop callbacks. |
enableVideoFrameObserver:videoSource:config:
Enables or disables the video frame callback at a specified position.
| Parameters | Type | Description |
|---|---|---|
enabled | BOOL | Specifies whether to enable data callbacks at a position |
videoSource | AoqVideoSource | Data source of the video frame callback (position in the pipeline). For more information, see AoqVideoSource. |
config | AoqVideoObserverConfig * | Callback parameter settings. For more information, see AoqVideoObserverConfig. |
Callbacks
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.
| Parameters | Type | Description |
|---|---|---|
code | NSInteger | Error code. For more information, see AoqErrorCode. |
message | NSString * | Error description |
onWarning:message:
Engine warning callback.
| Parameters | Type | Description |
|---|---|---|
code | NSInteger | Warning code. For more information, see AoqWarningCode. |
message | NSString * | Warning description |
onConnectionStatusChange:
Engine connection status change callback.
| Parameters | Type | Description |
|---|---|---|
status | AoqConnectionStatus | Connection status. For more information, see AoqConnectionStatus. |
onStats:
Engine statistics callback.
| Parameters | Type | Description |
|---|---|---|
stats | AoqStats * | Statistics data. For more information, see AoqStats. |
onAudioDeviceStateChanged:
Callback for audio device capture and playback operation status changes.
| Parameters | Type | Description |
|---|---|---|
state | AoqAudioDeviceState * | Audio device state. For more information, see AoqAudioDeviceState. |
onAudioDeviceRouteChanged:
Audio output route change callback.
| Parameters | Type | Description |
|---|---|---|
routeType | NSInteger | Route type. For the valid values, see AoqAudioDeviceRouteType. |
onAudioFileState:
Callback for audio file playback status.
| Parameters | Type | Description |
|---|---|---|
state | AoqAudioFileState * | File playback state. For more information, see AoqAudioFileState. |
onLocalAudioVolumeIndication:
Local capture volume indication callback. To enable it, call enableLocalAudioVolumeIndication:.
| Parameters | Type | Description |
|---|---|---|
volume | AoqAudioVolume * | Local volume information. For more information, see AoqAudioVolume. |
onVideoDeviceStateChanged:
Callback for video device capture operation status changes.
| Parameters | Type | Description |
|---|---|---|
state | AoqVideoDeviceState * | Video device state. For more information, see AoqVideoDeviceState. |
onDataMsg:
Callback for a received real-time data message.
| Parameters | Type | Description |
|---|---|---|
msg | AoqDataMsg * | 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.
| Parameters | Type | Description |
|---|---|---|
frame | AoqAudioFrameData * | 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.
| Parameters | Type | Description |
|---|---|---|
frame | AoqAudioFrameData * | 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.
| Parameters | Type | Description |
|---|---|---|
trackType | AoqTrackType | Track type. For more information, see AoqTrackType. |
frame | AoqAudioFrameData * | 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.
| Parameters | Type | Description |
|---|---|---|
frame | AoqAudioFrameData * | 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.
| Parameters | Type | Description |
|---|---|---|
frame | AoqVideoFrame * | Captured video frame data. For more information, see AoqVideoFrame. |
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.
| Parameters | Type | Description |
|---|---|---|
trackType | AoqTrackType | Video track type. For more information, see AoqTrackType. |
frame | AoqVideoFrame * | Video frame data before encoding. For more information, see AoqVideoFrame. |
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.
| Parameters | Type | Description |
|---|---|---|
trackType | AoqTrackType | Video track type. For more information, see AoqTrackType. |
frame | AoqVideoFrame * | Remote video frame data. For more information, see AoqVideoFrame. |
YES indicates that the data is modified and must be written back to the SDK;NO indicates read-only.
Data types and enumerations
General types
AoqCreateConfig
Engine creation configuration.
| Field | Type | Default value | Description |
|---|---|---|---|
workDir | NSString * | "" | SDK working directory |
enableDumpAudio | BOOL | NO | Specifies whether to enable raw audio data dump (for debugging) |
extras | NSString * | "" | Extended parameters |
AoqConnectConfig
Configuration for connecting to the relay server.
| Field | Type | Description |
|---|---|---|
token | NSString * | Connection authentication token |
sid | NSString * | Session ID |
certFingerprint | NSString * | Server certificate fingerprint |
relayEndpoints | NSArray<aoqrelayendpoint *>* | List of relay access points |
workspaceIdHash | NSString * | Workspace hash ID |
publishTracks | NSArray<aoqtrackparam *>* | Array of local publishing track attributes |
subscribeTracks | NSArray<aoqtrackparam *>* | Array of local subscribing track attributes |
AoqRelayEndpoint
A relay access point.
| Field | Type | Default value | Description |
|---|---|---|---|
routeIndex | NSInteger | -1 | Path index |
endpoint | NSString * | "" | Server address (domain name or IP address) |
port | NSInteger | 0 | Server port |
AoqTrackParam
The track attribute.
| Field | Type | Default value | Description |
|---|---|---|---|
trackType | AoqTrackType | Audio | Track type |
trackMode | AoqTrackMode | Segment | Streaming or non-streaming mode. Effective only for the audio downlink. |
AoqDataMsg
Data structure of a real-time message.
| Field | Type | Description |
|---|---|---|
data | NSData * | Message content. It points to memory held by the caller. |
Statistics types
AoqStats
Engine statistics.
| Field | Type | Description |
|---|---|---|
audioPublishStats | NSArray<aoqaudiopublishstats *>* | Array of publishing statistics for audio |
videoPublishStats | NSArray<aoqvideopublishstats *>* | Array of publishing statistics for video |
dataMsgPublishStats | NSArray<aoqdatamsgpublishstats *>* | Array of publishing statistics for data messages |
audioSubscribeStats | NSArray<aoqaudiosubscribestats *>* | Array of subscribing statistics for audio |
videoSubscribeStats | NSArray<aoqvideosubscribestats *>* | Array of subscribing statistics for video |
dataMsgSubscribeStats | NSArray<aoqdatamsgsubscribestats *>* | Array of subscribing statistics for data messages |
networkStats | AoqNetworkStats * | Network statistics |
AoqNetworkStats
Network statistics.
| Field | Type | Description |
|---|---|---|
sendBitrate | NSUInteger | Send bitrate, in bit/s |
sendBytes | NSUInteger | Cumulative bytes sent |
recvBitrate | NSUInteger | Receive bitrate, in bit/s |
recvBytes | NSUInteger | Cumulative bytes received |
loss | NSUInteger | Packet loss rate, from 0 to 100 |
rtt | NSUInteger | Round-trip latency, in ms |
AoqAudioPublishStats
Publishing statistics for audio.
| Field | Type | Description |
|---|---|---|
trackType | AoqTrackType | Track type |
bitrate | NSUInteger | Bitrate, in bit/s |
bytes | NSUInteger | Cumulative bytes |
encodeVolume | NSUInteger | Encoding volume of the publishing stream |
AoqVideoPublishStats
Publishing statistics for video.
| Field | Type | Description |
|---|---|---|
trackType | AoqTrackType | Track type |
bitrate | NSUInteger | Bitrate, in bit/s |
bytes | NSUInteger | Cumulative bytes |
encodeFps | NSUInteger | Encoding frame rate |
AoqDataMsgPublishStats
Publishing statistics for data messages.
| Field | Type | Description |
|---|---|---|
trackType | AoqTrackType | Track type |
bitrate | NSUInteger | Bitrate, in bit/s |
bytes | NSUInteger | Cumulative bytes |
AoqAudioSubscribeStats
Subscribing statistics for audio.
| Field | Type | Description |
|---|---|---|
trackType | AoqTrackType | Track type |
bitrate | NSUInteger | Bitrate, in bit/s |
bytes | NSUInteger | Cumulative bytes |
playVolume | NSUInteger | Playback volume |
AoqVideoSubscribeStats
Subscribing statistics for video.
| Field | Type | Description |
|---|---|---|
trackType | AoqTrackType | Track type |
bitrate | NSUInteger | Bitrate, in bit/s |
bytes | NSUInteger | Cumulative bytes |
decodeFps | NSUInteger | Decoding frame rate |
renderFps | NSUInteger | Rendering frame rate |
AoqDataMsgSubscribeStats
Subscribing statistics for data messages.
| Field | Type | Description |
|---|---|---|
trackType | AoqTrackType | Track type |
bitrate | NSUInteger | Bitrate, in bit/s |
bytes | NSUInteger | Cumulative bytes |
Enumerations
AoqErrorCode
Error code enumeration.
| Enum value | Value | Description |
|---|---|---|
AoqECOK | 0 | Success |
AoqECParamInvalid | 1 | Invalid parameter |
AoqECStateInvalid | 2 | Invalid state |
AoqECUnSupport | 3 | The API is not supported |
AoqECAudio | 100 | Generic audio error |
AoqECAudioExternalBufferFull | 110 | External audio buffer is full |
AoqECAudioDevice | 120 | Generic audio device error |
AoqECAudioDeviceRecordingAuthFailed | 121 | Recording permission not granted |
AoqECAudioDeviceRecordingOccupied | 122 | Recording device is in use |
AoqECAudioDeviceRecordingBackgroundStart | 123 | Start recording in the background |
AoqECAudioDeviceRecordingStartFail | 124 | Failed to start recording |
AoqECAudioDevicePlayoutOccupied | 125 | Playback device is in use |
AoqECAudioDevicePlayoutBackgroundStart | 126 | Start playback in the background |
AoqECAudioDevicePlayoutStartFail | 127 | Failed to start playback |
AoqECVideo | 200 | Generic video error |
AoqECVideoExternalBufferFull | 210 | External video buffer is full |
AoqECVideoExternalCaptureNotEnabled | 211 | External video capture is not enabled |
AoqECVideoExternalEncoderNotEnabled | 212 | External video encoding is not enabled |
AoqECVideoDevice | 220 | Generic video device error |
AoqECVideoDeviceCameraOpenFail | 221 | Failed to open the camera |
AoqECVideoDeviceCameraAuthFailed | 222 | Camera permission not granted |
AoqECVideoDeviceCameraOccupied | 223 | Camera is in use |
AoqECVideoDeviceCameraRunningError | 224 | Camera runtime error |
AoqECVideoCodec | 230 | Generic video codec error |
AoqECVideoCodecEncoderInitFail | 231 | Failed to initialize the encoder |
AoqECVideoRender | 240 | Generic video rendering error |
AoqECVideoRenderCreateFail | 241 | Failed to create the rendering view |
AoqECVideoRenderDrawError | 242 | Rendering drawing error |
AoqWarningCode
Warning code enumeration.
| Enum value | Value | Description |
|---|---|---|
AoqWCOK | 0 | No warning |
AoqWCAudio | 100 | Generic audio warning |
AoqWCAudioHowling | 101 | Audio howling detected |
AoqWCAudioDevice | 120 | Generic audio device warning |
AoqWCAudioDeviceMicEnumerateError | 121 | Microphone enumeration error |
AoqWCAudioDeviceMicStartTimeout | 122 | Microphone startup timed out |
AoqWCAudioDeviceRecordingError | 123 | Recording error |
AoqWCAudioDeviceSpeakerEnumerateError | 124 | Speaker enumeration error |
AoqWCAudioDeviceSpeakerStartTimeout | 125 | Speaker startup timed out |
AoqWCAudioDevicePlayoutError | 126 | Playback error |
AoqWCVideo | 200 | Generic video warning |
AoqWCVideoCameraEnumerateError | 201 | Camera enumeration error |
AoqWCVideoEncoderSwitched | 202 | Video encoder switched |
AoqWCVideoRenderDowngrade | 203 | Video rendering downgraded |
AoqTrackType
Track type.
| Enum value | Value | Description |
|---|---|---|
AoqTrackTypeAudio | 0 | Audio track |
AoqTrackTypeVideo | 1 | Video track |
AoqTrackTypeData | 2 | Data message track |
AoqEncoderType
Encoder type.
| Enum value | Value | Description |
|---|---|---|
AoqEncoderTypeUnknown | 0 | Unknown format |
AoqEncoderTypeAudioPCM | 1 | Audio PCM |
AoqEncoderTypeAudioOpus | 2 | Audio Opus |
AoqEncoderTypeVideoH264 | 3 | Video H.264 |
AoqEncoderTypeVideoJpeg | 4 | Video JPEG |
AoqEncoderTypeDataText | 5 | Message text |
AoqTrackMode
Streaming or non-streaming mode. Effective only for the audio downlink.
| Enum value | Value | Description |
|---|---|---|
AoqTrackModeSegment | 0 | Segmented: data is packaged and delivered in semantic segments, such as a sentence. |
AoqTrackModeStream | 1 | Streaming: data is delivered continuously. |
AoqConnectionStatus
Engine connection status.
| Enum value | Value | Description |
|---|---|---|
AoqConnectionStatusDisconnected | 0 | Disconnected |
AoqConnectionStatusConnecting | 1 | Connecting |
AoqConnectionStatusConnected | 2 | Connected |
AoqConnectionStatusFailed | 3 | Connection failed |
Audio types
AoqAudioCaptureConfig
Audio capture configuration.
| Field | Type | Default value | Description |
|---|---|---|---|
isExternal | BOOL | NO | Specifies whether to use external capture |
channel | NSInteger | 1 | Number of audio capture channels. 1 and 2 are supported. |
AoqAudioPlaybackConfig
Audio playback configuration.
| Field | Type | Default value | Description |
|---|---|---|---|
isExternal | BOOL | NO | Specifies whether to use external playback |
channel | NSInteger | 1 | Number of audio playback channels. 1 and 2 are supported. |
AoqAudioCodecConfig
Audio codec configuration.
| Field | Type | Default value | Description |
|---|---|---|---|
trackType | AoqTrackType | Audio | Track type |
codecType | AoqEncoderType | AudioPCM | Codec format |
sampleRate | NSInteger | 48000 | Sample rate, in Hz |
channel | NSInteger | 1 | Number of channels |
bitrate | NSInteger | 32000 | Bitrate, in bit/s |
AoqAudioDeviceState
Audio device state.
| Field | Type | Description |
|---|---|---|
state | AoqAudioDeviceStateCode | Status code |
reason | NSInteger | Error code (AoqErrorCode) |
AoqAudioDeviceStateCode
Audio device state code.
| Enum value | Value | Description |
|---|---|---|
AoqAudioDeviceNone | 0 | No state |
AoqAudioDeviceRecordStarting | 1 | Capture starting |
AoqAudioDeviceRecordStarted | 2 | Capture started |
AoqAudioDeviceRecordStopping | 3 | Capture stopping |
AoqAudioDeviceRecordStopped | 4 | Capture stopped |
AoqAudioDeviceRecordFail | 5 | Capture failed |
AoqAudioDevicePlayStarting | 6 | Playback starting |
AoqAudioDevicePlayStarted | 7 | Playback started |
AoqAudioDevicePlayStopping | 8 | Playback stopping |
AoqAudioDevicePlayStopped | 9 | Playback stopped |
AoqAudioDevicePlayFail | 10 | Playback failed |
AoqAudioDeviceRouteType
Audio device route type.
| Enum value | Value | Description |
|---|---|---|
AoqAudioDeviceRouteDefault | 0 | Default |
AoqAudioDeviceRouteHeadset | 1 | Headphones |
AoqAudioDeviceRouteEarpiece | 2 | Receiver |
AoqAudioDeviceRouteHeadsetNoMic | 3 | Headphones without a microphone |
AoqAudioDeviceRouteSpeakerPhone | 4 | Built-in speaker |
AoqAudioDeviceRouteUsb | 5 | USB |
AoqAudioDeviceRouteBluetooth | 6 | Bluetooth |
AoqAudioDeviceRouteBluetoothA2dp | 7 | Bluetooth A2DP |
AoqAudioFileMixConfig
Configuration for playing an audio file to the publishing stream.
| Field | Type | Default value | Description |
|---|---|---|---|
fileName | NSString * | - | File name (including the path). Required. |
cycles | NSInteger | -1 | Number of loops. -1 indicates unlimited looping. |
startPosMs | NSInteger | 0 | Start playback position, in ms |
publishVolume | NSInteger | 100 | Publishing volume. Valid values: 0 to 100. |
playoutVolume | NSInteger | 100 | Playback volume. Valid values: 0 to 100. |
AoqAudioFileState
Audio file state.
| Field | Type | Description |
|---|---|---|
fileId | NSString * | File ID |
stateCode | AoqAudioFileStateCode | Status code |
errorCode | AoqAudioFileErrorCode | Error code |
AoqAudioFileStateCode
Audio file state code.
| Enum value | Value | Description |
|---|---|---|
AoqAudioFileNone | 0 | No state |
AoqAudioFileStarted | 1 | Started |
AoqAudioFileStopped | 2 | Stopped |
AoqAudioFilePaused | 3 | Paused |
AoqAudioFileResumed | 4 | Resumed |
AoqAudioFileEnded | 5 | Playback completed |
AoqAudioFileBuffering | 6 | Buffering |
AoqAudioFileBufferingEnd | 7 | Buffering ended |
AoqAudioFileFailed | 8 | Playback failed |
AoqAudioFileErrorCode
Audio file playback error code.
| Enum value | Value | Description |
|---|---|---|
AoqAudioFileNoError | 0 | No error |
AoqAudioFileOpenFailed | 1 | Failed to open the file |
AoqAudioFileDecodeFailed | 2 | Failed to decode the file |
AoqAudioExternalStreamConfig
External audio stream configuration.
| Field | Type | Default value | Description |
|---|---|---|---|
trackType | AoqTrackType | Audio | Audio track type |
codecType | AoqEncoderType | AudioPCM | Audio stream format. PCM is supported. |
channels | NSInteger | 1 | Number of channels |
sampleRate | NSInteger | 48000 | Sample rate, in Hz |
playoutVolume | NSInteger | 100 | Playback volume. Valid values: 0 to 100. |
publishVolume | NSInteger | 100 | Publishing volume. Valid values: 0 to 100. |
maxBufferDuration | NSInteger | 1000 | Maximum buffer duration, in ms |
enable3A | BOOL | NO | Specifies whether to apply 3A processing to the input PCM |
AoqAudioFrameData
External audio data.
| Field | Type | Description |
|---|---|---|
dataPtr | void * | Pointer to the raw audio PCM data |
dataSize | NSInteger | Number of bytes of the PCM data |
numOfSamples | NSInteger | Number of samples (per channel) |
bytesPerSample | NSInteger | Bytes per sample |
numOfChannels | NSInteger | Number of channels |
samplesPerSec | NSInteger | Number of samples per second |
pushSequence | int32_t | PCM input round |
timeStamp | int64_t | Timestamp |
autoGenMute | BOOL | Valid in data callbacks. YES indicates silent data generated by the SDK. |
AoqAudioStreamDirection
Direction of an external audio stream.
| Enum value | Value | Description |
|---|---|---|
AoqAudioStreamPublish | 0 | Publishing audio |
AoqAudioStreamPlayout | 1 | Playback audio |
AoqAudioExternalStreamToggle
External audio stream switching state.
| Enum value | Value | Description |
|---|---|---|
AoqAudioExternalStreamToggleNormal | 0 | Recovered |
AoqAudioExternalStreamTogglePause | 1 | Paused |
AoqAudioSource
Data source of the audio frame callback.
| Enum value | Value | Description |
|---|---|---|
AoqAudioSourceCaptured | 0 | Captured audio data |
AoqAudioSourceProcessCaptured | 1 | Audio data after 3A processing |
AoqAudioSourcePublish | 2 | Audio data to be published (requires a successful Connect) |
AoqAudioSourcePlayback | 3 | Audio data to be played |
AoqAudioObserverMode
Audio frame callback mode.
| Enum value | Value | Description |
|---|---|---|
AoqAudioObserverModeReadOnly | 0 | Read-only |
AoqAudioObserverModeReadWrite | 1 | Read-write |
AoqAudioObserverConfig
Audio frame callback configuration.
| Field | Type | Default value | Description |
|---|---|---|---|
sampleRate | NSInteger | 48000 | Sample rate of the callback audio |
channels | NSInteger | 1 | Number of audio channels in the callback |
mode | AoqAudioObserverMode | ReadOnly | Read-write mode |
AoqAudioVolumeIndicationConfig
Local volume indication configuration.
| Field | Type | Default value | Description |
|---|---|---|---|
interval | NSInteger | 0 | Callback interval, in ms. A value less than or equal to 0 disables the callback. A value greater than 0 and less than 10 is treated as 10. |
smooth | NSInteger | 3 | Volume smoothing coefficient. Valid values: 0 to 10. A larger value results in smoother output. |
AoqAudioVolume
Local volume information.
| Field | Type | Description |
|---|---|---|
volume | NSInteger | Smoothed instantaneous volume. Valid values: 0 to 255. |
Video types
AoqVideoCaptureConfig
Video capture configuration.
| Field | Type | Default value | Description |
|---|---|---|---|
width | NSInteger | 1280 | Capture width, in pixels. This parameter is ineffective when isExternal=YES. |
height | NSInteger | 720 | Capture height, in pixels. This parameter is ineffective when isExternal=YES. |
fps | NSInteger | 15 | Capture frame rate. This parameter is ineffective when isExternal=YES (the pace is determined by frame delivery). |
isExternal | BOOL | NO | Specifies 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.
| Field | Type | Default value | Description |
|---|---|---|---|
view | NSView * | nil | Display view. Pass nil to remove the rendering binding. |
renderMode | AoqRenderMode | Auto | Rendering mode |
view outlasts the period during which it is set by setLocalView:/setRemoteView:.
AoqRenderMode
Rendering display mode.
| Enum value | Value | Description |
|---|---|---|
AoqRenderModeAuto | 0 | Auto mode |
AoqRenderModeStretch | 1 | Stretch-to-fill mode. When the aspect ratios do not match, the image is stretched to the target ratio and becomes distorted. |
AoqRenderModeFill | 2 | Letterbox mode. When the aspect ratios do not match, black bars are added to the top and bottom or the left and right. |
AoqRenderModeCrop | 3 | Crop mode. When the aspect ratios do not match, the width or height is cropped and part of the image is lost. |
AoqVideoPixelFormat
Video pixel format.
| Enum value | Value | Description |
|---|---|---|
AoqVideoPixelFormatUnknown | 0 | Unknown format |
AoqVideoPixelFormatI420 | 1 | I420 |
AoqVideoPixelFormatNV12 | 2 | NV12 |
AoqVideoPixelFormatNV21 | 3 | NV21 |
AoqVideoPixelFormatBGRA | 4 | BGRA |
AoqVideoPixelFormatRGBA | 5 | RGBA |
AoqVideoPixelFormatCVPixelBuffer | 6 | Zero-copy path. Set the pixelBuffer field to CVPixelBufferRef. |
AoqVideoFrame
External video data.
| Field | Type | Description |
|---|---|---|
format | AoqVideoPixelFormat | Pixel format |
width | NSInteger | Width, in pixels |
height | NSInteger | Height, in pixels |
data | NSData * | Packed-format data (NV12/NV21/BGRA/RGBA) |
dataY/dataU/dataV | NSData * | Data of the three I420 planes |
strideY/strideU/strideV | NSInteger | Stride of the three I420 planes |
pixelBuffer | CVPixelBufferRef | Zero-copy, which is used when format=AoqVideoPixelFormatCVPixelBuffer |
timeStamp | int64_t | Timestamp, in ms. If it is 0, the SDK fills it in with the local clock. |
AoqVideoEncodedFrame
An externally encoded video frame. The caller performs the encoding, and the SDK packages and sends the frame directly without re-encoding.
| Field | Type | Description |
|---|---|---|
codec | AoqVideoCodecType | Codec format |
data | NSData * | Encoded data |
width | NSInteger | Width, in pixels |
height | NSInteger | Height, in pixels |
timeStamp | int64_t | Timestamp, 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 value | Value | Description |
|---|---|---|
AoqVideoCodecTypeJPEG | 0 | JPEG |
AoqVideoDeviceState
Video device state.
| Field | Type | Description |
|---|---|---|
state | AoqVideoDeviceStateCode | Status code |
reason | NSInteger | Error code (AoqErrorCode) |
AoqVideoDeviceStateCode
Video device state code.
| Enum value | Value | Description |
|---|---|---|
AoqVideoDeviceNone | 0 | No state |
AoqVideoDeviceCaptureStarting | 1 | Camera starting |
AoqVideoDeviceCaptureStarted | 2 | Camera started |
AoqVideoDeviceCaptureStopping | 3 | Camera stopping |
AoqVideoDeviceCaptureStopped | 4 | Camera stopped |
AoqVideoDeviceCaptureFail | 5 | Failed to start the camera |
AoqMirrorMode
Mirror mode.
| Enum value | Value | Description |
|---|---|---|
AoqMirrorModeDisabled | 0 | Disable mirroring |
AoqMirrorModeEnabled | 1 | Enable mirroring |
AoqOrientationMode
Orientation mode.
| Enum value | Value | Description |
|---|---|---|
AoqOrientationModeAuto | 0 | Auto |
AoqOrientationModePortrait | 1 | Portrait |
AoqOrientationModeLandscape | 2 | Landscape |
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.
| Field | Type | Default value | Description |
|---|---|---|---|
isExternal | BOOL | NO | External encoding mode. When it is YES, you push encoded frames, and the SDK does not perform capture or encoding. |
trackType | AoqTrackType | Video | Track type |
codecType | AoqEncoderType | VideoH264 | Codec format |
width | NSInteger | 540 | Resolution width |
height | NSInteger | 960 | Resolution height |
fps | NSInteger | 5 | Frame rate |
bitrate | NSInteger | 500000 | Initial bitrate, in bit/s |
minBitrate | NSInteger | 128000 | Minimum bitrate, in bit/s |
keyframeInterval | NSInteger | 2 | Keyframe interval, in seconds |
mirrorMode | AoqMirrorMode | Disabled | Mirror mode |
orientationMode | AoqOrientationMode | Auto | Orientation mode |
AoqVideoSource
Data source of the video frame callback (position in the pipeline).
| Enum value | Value | Description |
|---|---|---|
AoqVideoSourceCaptured | 0 | Captured video data before preprocessing |
AoqVideoSourcePreEncode | 1 | Video data before encoding, after preprocessing |
AoqVideoSourceRemote | 2 | Remote video data after decoding and before rendering |
AoqVideoObserverMode
Video frame callback mode.
| Enum value | Value | Description |
|---|---|---|
AoqVideoObserverModeReadOnly | 0 | Read-only |
AoqVideoObserverModeReadWrite | 1 | Read-write |
AoqVideoObserverAlignment
Width alignment method for video output.
| Enum value | Value | Description |
|---|---|---|
AoqVideoObserverAlignmentDefault | 0 | Default |
AoqVideoObserverAlignmentEven | 1 | Even-number alignment |
AoqVideoObserverAlignment4 | 2 | 4-byte alignment |
AoqVideoObserverAlignment8 | 3 | 8-byte alignment |
AoqVideoObserverAlignment16 | 4 | 16-byte alignment |
AoqVideoObserverConfig
Video frame callback configuration.
| Field | Type | Default value | Description |
|---|---|---|---|
format | AoqVideoPixelFormat | I420 | Expected pixel format of the callback data |
alignment | AoqVideoObserverAlignment | Default | Width alignment policy |
mode | AoqVideoObserverMode | ReadOnly | Read-write mode. ReadWrite is supported only for I420 / CVPixelBuffer. |
mirrorApplied | BOOL | NO | Specifies whether to mirror the callback data |
AoqRenderView
The rendering view control, which inherits from NSView and can be used as AoqVideoCanvas.view.
| Attribute | Type | Description |
|---|---|---|
engineDisplayView | NSView * (read-only) | Display view used internally by the engine |
renderWidth | int (read-only) | Rendering width |
renderHeight | int (read-only) | Rendering height |
enableMetal | BOOL (read-only) | Specifies whether to enable Metal rendering |
delegate | id<aoqrenderviewdelegate> | Event delegate of the rendering view |
AoqRenderViewDelegate
The event delegate protocol of the rendering view.
| Callback | Description |
|---|---|
onRenderViewSizeChanged: | Callback for rendering view size changes |