Skip to content

Commit

Permalink
feat: support native 4.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe committed Mar 11, 2024
1 parent eee2a51 commit 1526048
Show file tree
Hide file tree
Showing 26 changed files with 540 additions and 104 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"yuv-canvas": "1.2.6"
},
"agora_electron": {
"iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.3.0-build.2_DCG_Windows_Video_20240219_0110.zip",
"iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.3.0-build.2_DCG_Mac_Video_20240219_0110.zip"
"iris_sdk_win": "https://download.agora.io/sdk/release/iris_4.3.1-dev.2_DCG_Windows_Video_20240308_1205.zip",
"iris_sdk_mac": "https://download.agora.io/sdk/release/iris_4.3.1-dev.2_DCG_Mac_Video_20240308_1205.zip"
}
}
2 changes: 1 addition & 1 deletion scripts/terra/config/impl_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parsers:
- name: RTCParser
package: '@agoraio-extensions/terra_shared_configs'
args:
sdkVersion: 4.3.0
sdkVersion: 4.3.1
definesMacros:
- __ELECTRON__
FixEnumConstantParser:
Expand Down
2 changes: 1 addition & 1 deletion scripts/terra/config/types_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parsers:
- name: RTCParser
package: '@agoraio-extensions/terra_shared_configs'
args:
sdkVersion: 4.3.0
sdkVersion: 4.3.1
definesMacros:
- __ELECTRON__
FixEnumConstantParser:
Expand Down
2 changes: 1 addition & 1 deletion scripts/terra/impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type ClazzMethodUserData = IrisApiIdParserUserData & {
};

export function impl(parseResult: ParseResult) {
let preParseResult = deepClone(parseResult, ['parent']);
let preParseResult = deepClone(parseResult, ['parent', 'outVariable']);
let cxxfiles = parseResult.nodes as CXXFile[];
//only render file which has clazz
let view = cxxfiles
Expand Down
82 changes: 78 additions & 4 deletions ts/Private/AgoraBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ export enum ErrorCodeType {
* 121: The user ID is invalid.
*/
ErrInvalidUserId = 121,
/**
* @ignore
*/
ErrDatastreamDecryptionFailed = 122,
/**
* 123: The user is banned from the server.
*/
Expand Down Expand Up @@ -1196,6 +1200,10 @@ export class EncodedVideoFrameInfo {
* The type of video streams. See VideoStreamType.
*/
streamType?: VideoStreamType;
/**
* @ignore
*/
presentationMs?: number;
}

/**
Expand Down Expand Up @@ -1465,7 +1473,7 @@ export class WatermarkRatio {
*/
export class WatermarkOptions {
/**
* Is the watermark visible in the local preview view? true : (Default) The watermark is visible in the local preview view. false : The watermark is not visible in the local preview view.
* Whether the watermark is visible in the local preview view: true : (Default) The watermark is visible in the local preview view. false : The watermark is not visible in the local preview view.
*/
visibleInPreview?: boolean;
/**
Expand Down Expand Up @@ -1940,6 +1948,36 @@ export enum CaptureBrightnessLevelType {
CaptureBrightnessLevelDark = 2,
}

/**
* @ignore
*/
export enum CameraStabilizationMode {
/**
* @ignore
*/
CameraStabilizationModeOff = -1,
/**
* @ignore
*/
CameraStabilizationModeAuto = 0,
/**
* @ignore
*/
CameraStabilizationModeLevel1 = 1,
/**
* @ignore
*/
CameraStabilizationModeLevel2 = 2,
/**
* @ignore
*/
CameraStabilizationModeLevel3 = 3,
/**
* @ignore
*/
CameraStabilizationModeMaxLevel = 3,
}

/**
* The state of the local audio.
*/
Expand Down Expand Up @@ -2082,6 +2120,14 @@ export enum LocalVideoStreamReason {
* 10: (macOS and Windows only) The SDK cannot find the video device in the video device list. Check whether the ID of the video device is valid.
*/
LocalVideoStreamReasonDeviceInvalidId = 10,
/**
* @ignore
*/
LocalVideoStreamErrorDeviceInterrupt = 14,
/**
* @ignore
*/
LocalVideoStreamErrorDeviceFatalError = 15,
/**
* 101: The current video capture device is unavailable due to excessive system pressure.
*/
Expand Down Expand Up @@ -2201,6 +2247,14 @@ export enum RemoteAudioStateReason {
* 7: The remote user leaves the channel.
*/
RemoteAudioReasonRemoteOffline = 7,
/**
* @ignore
*/
RemoteAudioReasonNoPacketReceive = 8,
/**
* @ignore
*/
RemoteAudioReasonLocalPlayFailed = 9,
}

/**
Expand Down Expand Up @@ -2640,7 +2694,7 @@ export enum RtmpStreamPublishReason {
*/
RtmpStreamPublishReasonInvalidAppid = 15,
/**
* 16: Your project does not have permission to use streaming services. Refer to Media Push to enable the Media Push permission.
* 16: Your project does not have permission to use streaming services.
*/
RtmpStreamPublishReasonInvalidPrivilege = 16,
/**
Expand Down Expand Up @@ -3777,6 +3831,10 @@ export enum AudioEffectPreset {
* Virtual surround sound, that is, the SDK generates a simulated surround sound field on the basis of stereo channels, thereby creating a surround sound effect. If the virtual surround sound is enabled, users need to use stereo audio playback devices to hear the anticipated audio effect.
*/
RoomAcousticsVirtualSurroundSound = 0x02010900,
/**
* @ignore
*/
RoomAcousticsChorus = 0x02010d00,
/**
* A middle-aged man's voice. Agora recommends using this preset to process a male-sounding voice; otherwise, you may not hear the anticipated voice effect.
*/
Expand Down Expand Up @@ -4210,7 +4268,7 @@ export enum ChannelMediaRelayError {
*/
RelayErrorServerErrorResponse = 1,
/**
* 2: No server response. You can call leaveChannel to leave the channel. This error can also occur if your project has not enabled co-host token authentication. You can to enable the service for cohosting across channels before starting a channel media relay.
* 2: No server response. This error may be caused by poor network connections. If this error occurs when initiating a channel media relay, you can try again later; if this error occurs during channel media relay, you can call leaveChannel to leave the channel. This error can also occur if the channel media relay service is not enabled in the project. You can contact to enable the service.
*/
RelayErrorServerNoResponse = 2,
/**
Expand Down Expand Up @@ -4431,6 +4489,10 @@ export class EncryptionConfig {
* Salt, 32 bytes in length. Agora recommends that you use OpenSSL to generate salt on the server side. See Media Stream Encryption for details. This parameter takes effect only in Aes128Gcm2 or Aes256Gcm2 encrypted mode. In this case, ensure that this parameter is not 0.
*/
encryptionKdfSalt?: number[];
/**
* @ignore
*/
datastreamEncryptionEnabled?: boolean;
}

/**
Expand All @@ -4449,6 +4511,14 @@ export enum EncryptionErrorType {
* 2: Encryption errors.
*/
EncryptionErrorEncryptionFailure = 2,
/**
* @ignore
*/
EncryptionErrorDatastreamDecryptionFailure = 3,
/**
* @ignore
*/
EncryptionErrorDatastreamEncryptionFailure = 4,
}

/**
Expand Down Expand Up @@ -4605,6 +4675,10 @@ export enum EarMonitoringFilterType {
* 1<<2: Enable noise suppression to the in-ear monitor.
*/
EarMonitoringFilterNoiseSuppression = 1 << 2,
/**
* @ignore
*/
EarMonitoringFilterReusePostProcessingFilter = 1 << 15,
}

/**
Expand Down Expand Up @@ -4921,7 +4995,7 @@ export class SpatialAudioParams {
speaker_attenuation?: number;
/**
* Whether to enable the Doppler effect: When there is a relative displacement between the sound source and the receiver of the sound source, the tone heard by the receiver changes. true : Enable the Doppler effect. false : (Default) Disable the Doppler effect.
* This parameter is suitable for scenarios where the sound source is moving at high speed (for example, racing games). It is not recommended for common audio and video interactive scenarios (for example, voice chat, cohosting, or online KTV).
* This parameter is suitable for scenarios where the sound source is moving at high speed (for example, racing games). It is not recommended for common audio and video interactive scenarios (for example, voice chat, co-streaming, or online KTV).
* When this parameter is enabled, Agora recommends that you set a regular period (such as 30 ms), and then call the updatePlayerPositionInfo, updateSelfPosition, and updateRemotePosition methods to continuously update the relative distance between the sound source and the receiver. The following factors can cause the Doppler effect to be unpredictable or the sound to be jittery: the period of updating the distance is too long, the updating period is irregular, or the distance information is lost due to network packet loss or delay.
*/
enable_doppler?: boolean;
Expand Down
30 changes: 30 additions & 0 deletions ts/Private/AgoraMediaBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ export enum VideoSourceType {
* 14: The fourth screen.
*/
VideoSourceScreenFourth = 14,
/**
* @ignore
*/
VideoSourceSpeechDriven = 15,
/**
* 100: An unknown video source.
*/
Expand Down Expand Up @@ -231,6 +235,10 @@ export enum MediaSourceType {
* @ignore
*/
TranscodedVideoSource = 12,
/**
* @ignore
*/
SpeechDrivenVideoSource = 13,
/**
* 100: Unknown media source.
*/
Expand Down Expand Up @@ -449,6 +457,10 @@ export enum VideoPixelFormat {
* @ignore
*/
VideoTextureId3d11texture2d = 17,
/**
* @ignore
*/
VideoPixelI010 = 18,
}

/**
Expand Down Expand Up @@ -611,6 +623,10 @@ export class ExternalVideoFrame {
* @ignore
*/
alphaBuffer?: Uint8Array;
/**
* @ignore
*/
fillAlphaBuffer?: boolean;
/**
* This parameter only applies to video data in Windows Texture format. It represents an index of an ID3D11Texture2D texture object used by the video frame in the ID3D11Texture2D array.
*/
Expand Down Expand Up @@ -815,6 +831,10 @@ export class AudioFrame {
* @ignore
*/
audioTrackNumber?: number;
/**
* @ignore
*/
rtpTimestamp?: number;
}

/**
Expand Down Expand Up @@ -1247,6 +1267,16 @@ export class MediaRecorderConfiguration {
recorderInfoUpdateInterval?: number;
}

/**
* @ignore
*/
export interface IFaceInfoObserver {
/**
* @ignore
*/
onFaceInfo?(outFaceInfo: string): void;
}

/**
* @ignore
*/
Expand Down
20 changes: 15 additions & 5 deletions ts/Private/IAgoraMediaEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
ExternalVideoFrame,
ExternalVideoSourceType,
IAudioFrameObserver,
IFaceInfoObserver,
IVideoEncodedFrameObserver,
IVideoFrameObserver,
} from './AgoraMediaBase';
Expand Down Expand Up @@ -98,6 +99,11 @@ export abstract class IMediaEngine {
observer: IVideoEncodedFrameObserver
): number;

/**
* @ignore
*/
abstract registerFaceInfoObserver(observer: IFaceInfoObserver): number;

/**
* Pushes the external audio frame.
*
Expand All @@ -113,13 +119,12 @@ export abstract class IMediaEngine {
/**
* Pulls the remote audio data.
*
* Before calling this method, you need to call setExternalAudioSink to notify the app to enable and set the external rendering. After a successful call of this method, the app pulls the decoded and mixed audio data for playback.
* This method only supports pulling data from custom audio source. If you need to pull the data captured by the SDK, do not call this method.
* Before calling this method, call setExternalAudioSink (enabled : true) to notify the app to enable and set the external audio rendering. After a successful call of this method, the app pulls the decoded and mixed audio data for playback.
* Call this method after joining a channel.
* Once you enable the external audio sink, the app will not retrieve any audio data from the onPlaybackAudioFrame callback.
* The difference between this method and the onPlaybackAudioFrame callback is as follows:
* Both this method and onPlaybackAudioFrame callback can be used to get audio data after remote mixing. Note that after calling setExternalAudioSink to enable external audio rendering, the app no longer receives data from the onPlaybackAudioFrame callback. Therefore, you should choose between this method and the onPlaybackAudioFrame callback based on your actual business requirements. The specific distinctions between them are as follows:
* After calling this method, the app automatically pulls the audio data from the SDK. By setting the audio data parameters, the SDK adjusts the frame buffer to help the app handle latency, effectively avoiding audio playback jitter.
* The SDK sends the audio data to the app through the onPlaybackAudioFrame callback. Any delay in processing the audio frames may result in audio jitter.
* After a successful method call, the app automatically pulls the audio data from the SDK. After setting the audio data parameters, the SDK adjusts the frame buffer and avoids problems caused by jitter in the external audio playback.
* This method is only used for retrieving audio data after remote mixing. If you need to get audio data from different audio processing stages such as capture and playback, you can register the corresponding callbacks by calling registerAudioFrameObserver.
*
* @returns
* The AudioFrame instance, if the method call succeeds.
Expand Down Expand Up @@ -302,4 +307,9 @@ export abstract class IMediaEngine {
abstract unregisterVideoEncodedFrameObserver(
observer: IVideoEncodedFrameObserver
): number;

/**
* @ignore
*/
abstract unregisterFaceInfoObserver(observer: IFaceInfoObserver): number;
}
11 changes: 10 additions & 1 deletion ts/Private/IAgoraMediaPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,16 @@ export abstract class IMediaPlayer {
abstract selectAudioTrack(index: number): number;

/**
* @ignore
* Selects the audio tracks that you want to play on your local device and publish to the channel respectively.
*
* You can call this method to determine the audio track to be played on your local device and published to the channel. Before calling this method, you need to open the media file with the openWithMediaSource method and set enableMultiAudioTrack in MediaSource as true.
*
* @param playoutTrackIndex The index of audio tracks for local playback. You can obtain the index through getStreamInfo.
* @param publishTrackIndex The index of audio tracks to be published in the channel. You can obtain the index through getStreamInfo.
*
* @returns
* 0: Success.
* < 0: Failure.
*/
abstract selectMultiAudioTrack(
playoutTrackIndex: number,
Expand Down

0 comments on commit 1526048

Please sign in to comment.