Skip to content

Commit

Permalink
[AUTO] Generate codes by terra (#1227)
Browse files Browse the repository at this point in the history
Co-authored-by: guoxianzhe <guoxianzhe@users.noreply.github.com>
  • Loading branch information
sda-rob and guoxianzhe authored Sep 27, 2024
1 parent 9af0542 commit 5166409
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 137 deletions.
2 changes: 1 addition & 1 deletion ts/Private/IAgoraMediaEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export abstract class IMediaEngine {
/**
* @ignore
*/
abstract setExternalRemoteEglContext(): any;
abstract setExternalRemoteEglContext(eglContext: any): number;

/**
* Sets the external audio source parameters.
Expand Down
21 changes: 5 additions & 16 deletions ts/Private/IAgoraRtcEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6481,22 +6481,6 @@ export abstract class IRtcEngine {
*/
abstract takeSnapshot(uid: number, filePath: string): number;

/**
* Takes a snapshot of a video stream.
*
* This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path.
*
* @param uid The user ID. Set uid as 0 if you want to take a snapshot of the local user's video.
* @param filePath The local path (including filename extensions) of the snapshot. For example:
* Windows: C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.jpg
* macOS: ~/Library/Logs/example.jpg Ensure that the path you specify exists and is writable.
*
* @returns
* 0: Success.
* < 0: Failure.
*/
abstract takeSnapshot(uid: number, config: SnapshotConfig): number;

/**
* Enables or disables video screenshot and upload.
*
Expand Down Expand Up @@ -6888,6 +6872,11 @@ export abstract class IRtcEngine {
* The native handle of the SDK.
*/
abstract getNativeHandle(): number;

/**
* @ignore
*/
abstract takeSnapshotWithConfig(uid: number, config: SnapshotConfig): number;
}

/**
Expand Down
40 changes: 10 additions & 30 deletions ts/Private/IAgoraRtcEngineEx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,13 @@ export abstract class IRtcEngineEx extends IRtcEngine {
options?: LeaveChannelOptions
): number;

/**
* @ignore
*/
abstract leaveChannelWithUserAccountEx(
channelId: string,
userAccount: string
): number;

/**
* @ignore
*/
abstract leaveChannelWithUserAccountEx(
channelId: string,
userAccount: string,
options: LeaveChannelOptions
options?: LeaveChannelOptions
): number;

/**
Expand Down Expand Up @@ -916,27 +908,6 @@ export abstract class IRtcEngineEx extends IRtcEngine {
filePath: string
): number;

/**
* Takes a snapshot of a video stream using connection ID.
*
* This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path.
*
* @param connection The connection information. See RtcConnection.
* @param uid The user ID. Set uid as 0 if you want to take a snapshot of the local user's video.
* @param filePath The local path (including filename extensions) of the snapshot. For example:
* Windows: C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.jpg
* macOS: ~/Library/Logs/example.jpg Ensure that the path you specify exists and is writable.
*
* @returns
* 0: Success.
* < 0: Failure.
*/
abstract takeSnapshotEx(
connection: RtcConnection,
uid: number,
config: SnapshotConfig
): number;

/**
* Enables or disables video screenshot and upload.
*
Expand Down Expand Up @@ -999,4 +970,13 @@ export abstract class IRtcEngineEx extends IRtcEngine {
metadata: string,
length: number
): number;

/**
* @ignore
*/
abstract takeSnapshotWithConfigEx(
connection: RtcConnection,
uid: number,
config: SnapshotConfig
): number;
}
18 changes: 12 additions & 6 deletions ts/Private/impl/IAgoraMediaEngineImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,21 @@ export class IMediaEngineImpl implements IMediaEngine {
return 'MediaEngine_setExternalVideoSource_fff99b6';
}

setExternalRemoteEglContext(): any {
const apiType = this.getApiTypeFromSetExternalRemoteEglContext();
const jsonParams = {};
setExternalRemoteEglContext(eglContext: any): number {
const apiType = this.getApiTypeFromSetExternalRemoteEglContext(eglContext);
const jsonParams = {
eglContext: eglContext,
toJSON: () => {
return {
eglContext: eglContext,
};
},
};
const jsonResults = callIrisApi.call(this, apiType, jsonParams);
const eglContext = jsonResults.eglContext;
return eglContext;
return jsonResults.result;
}

protected getApiTypeFromSetExternalRemoteEglContext(): string {
protected getApiTypeFromSetExternalRemoteEglContext(eglContext: any): string {
return 'MediaEngine_setExternalRemoteEglContext_f337cbf';
}

Expand Down
97 changes: 36 additions & 61 deletions ts/Private/impl/IAgoraRtcEngineExImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,39 +92,10 @@ export class IRtcEngineExImpl extends IRtcEngineImpl implements IRtcEngineEx {
return 'RtcEngineEx_leaveChannelEx_b03ee9a';
}

leaveChannelWithUserAccountEx(
channelId: string,
userAccount: string
): number {
const apiType = this.getApiTypeFromLeaveChannelWithUserAccountEx(
channelId,
userAccount
);
const jsonParams = {
channelId: channelId,
userAccount: userAccount,
toJSON: () => {
return {
channelId: channelId,
userAccount: userAccount,
};
},
};
const jsonResults = callIrisApi.call(this, apiType, jsonParams);
return jsonResults.result;
}

protected getApiTypeFromLeaveChannelWithUserAccountEx(
channelId: string,
userAccount: string
): string {
return 'RtcEngineEx_leaveChannelWithUserAccountEx_ccad422';
}

leaveChannelWithUserAccountEx(
channelId: string,
userAccount: string,
options: LeaveChannelOptions
options?: LeaveChannelOptions
): number {
const apiType = this.getApiTypeFromLeaveChannelWithUserAccountEx(
channelId,
Expand All @@ -150,7 +121,7 @@ export class IRtcEngineExImpl extends IRtcEngineImpl implements IRtcEngineEx {
protected getApiTypeFromLeaveChannelWithUserAccountEx(
channelId: string,
userAccount: string,
options: LeaveChannelOptions
options?: LeaveChannelOptions
): string {
return 'RtcEngineEx_leaveChannelWithUserAccountEx_8bbe372';
}
Expand Down Expand Up @@ -1533,36 +1504,6 @@ export class IRtcEngineExImpl extends IRtcEngineImpl implements IRtcEngineEx {
return 'RtcEngineEx_takeSnapshotEx_de1c015';
}

takeSnapshotEx(
connection: RtcConnection,
uid: number,
config: SnapshotConfig
): number {
const apiType = this.getApiTypeFromTakeSnapshotEx(connection, uid, config);
const jsonParams = {
connection: connection,
uid: uid,
config: config,
toJSON: () => {
return {
connection: connection,
uid: uid,
config: config,
};
},
};
const jsonResults = callIrisApi.call(this, apiType, jsonParams);
return jsonResults.result;
}

protected getApiTypeFromTakeSnapshotEx(
connection: RtcConnection,
uid: number,
config: SnapshotConfig
): string {
return 'RtcEngineEx_takeSnapshotEx_b856417';
}

enableContentInspectEx(
enabled: boolean,
config: ContentInspectConfig,
Expand Down Expand Up @@ -1692,6 +1633,40 @@ export class IRtcEngineExImpl extends IRtcEngineImpl implements IRtcEngineEx {
): string {
return 'RtcEngineEx_sendAudioMetadataEx_e2bf1c4';
}

takeSnapshotWithConfigEx(
connection: RtcConnection,
uid: number,
config: SnapshotConfig
): number {
const apiType = this.getApiTypeFromTakeSnapshotWithConfigEx(
connection,
uid,
config
);
const jsonParams = {
connection: connection,
uid: uid,
config: config,
toJSON: () => {
return {
connection: connection,
uid: uid,
config: config,
};
},
};
const jsonResults = callIrisApi.call(this, apiType, jsonParams);
return jsonResults.result;
}

protected getApiTypeFromTakeSnapshotWithConfigEx(
connection: RtcConnection,
uid: number,
config: SnapshotConfig
): string {
return 'RtcEngineEx_takeSnapshotEx_b856417';
}
}

import { callIrisApi } from '../internal/IrisApiEngine';
46 changes: 23 additions & 23 deletions ts/Private/impl/IAgoraRtcEngineImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6706,29 +6706,6 @@ export class IRtcEngineImpl implements IRtcEngine {
return 'RtcEngine_takeSnapshot_1922dd1';
}

takeSnapshot(uid: number, config: SnapshotConfig): number {
const apiType = this.getApiTypeFromTakeSnapshot(uid, config);
const jsonParams = {
uid: uid,
config: config,
toJSON: () => {
return {
uid: uid,
config: config,
};
},
};
const jsonResults = callIrisApi.call(this, apiType, jsonParams);
return jsonResults.result;
}

protected getApiTypeFromTakeSnapshot(
uid: number,
config: SnapshotConfig
): string {
return 'RtcEngine_takeSnapshot_5669ea6';
}

enableContentInspect(enabled: boolean, config: ContentInspectConfig): number {
const apiType = this.getApiTypeFromEnableContentInspect(enabled, config);
const jsonParams = {
Expand Down Expand Up @@ -7338,6 +7315,29 @@ export class IRtcEngineImpl implements IRtcEngine {
protected getApiTypeFromGetNativeHandle(): string {
return 'RtcEngine_getNativeHandle';
}

takeSnapshotWithConfig(uid: number, config: SnapshotConfig): number {
const apiType = this.getApiTypeFromTakeSnapshotWithConfig(uid, config);
const jsonParams = {
uid: uid,
config: config,
toJSON: () => {
return {
uid: uid,
config: config,
};
},
};
const jsonResults = callIrisApi.call(this, apiType, jsonParams);
return jsonResults.result;
}

protected getApiTypeFromTakeSnapshotWithConfig(
uid: number,
config: SnapshotConfig
): string {
return 'RtcEngine_takeSnapshot_5669ea6';
}
}

import { callIrisApi } from '../internal/IrisApiEngine';

0 comments on commit 5166409

Please sign in to comment.