From 305eb62e41d65c07089af63950d3414cd038f10a Mon Sep 17 00:00:00 2001 From: xiayangqun Date: Fri, 6 Dec 2024 06:33:11 +0000 Subject: [PATCH] [AUTO] Generate codes by terra --- ts/Private/AgoraBase.ts | 10 +-- ts/Private/AgoraMediaBase.ts | 10 ++- ts/Private/IAgoraMediaEngine.ts | 5 -- ts/Private/IAgoraRtcEngine.ts | 25 ++++-- ts/Private/IAgoraRtcEngineEx.ts | 35 ++++++++ ts/Private/IAudioDeviceManager.ts | 13 ++- ts/Private/impl/IAgoraMediaEngineImpl.ts | 18 ---- ts/Private/impl/IAgoraRtcEngineExImpl.ts | 103 +++++++++++++++++++++++ ts/Private/impl/IAgoraRtcEngineImpl.ts | 21 ++--- 9 files changed, 183 insertions(+), 57 deletions(-) diff --git a/ts/Private/AgoraBase.ts b/ts/Private/AgoraBase.ts index 4d2d148cb..d34ee1c01 100644 --- a/ts/Private/AgoraBase.ts +++ b/ts/Private/AgoraBase.ts @@ -1421,7 +1421,7 @@ export class VideoEncoderConfiguration { */ frameRate?: number; /** - * The encoding bitrate (Kbps) of the video.. This parameter does not need to be set; keeping the default value STANDARD_BITRATE is sufficient. The SDK automatically matches the most suitable bitrate based on the video resolution and frame rate you have set. For the correspondence between video resolution and frame rate, see. STANDARD_BITRATE (0): (Recommended) Standard bitrate mode. COMPATIBLE_BITRATE (-1): Adaptive bitrate mode. In general, Agora suggests that you do not use this value. + * The encoding bitrate (Kbps) of the video. This parameter does not need to be set; keeping the default value STANDARD_BITRATE is sufficient. The SDK automatically matches the most suitable bitrate based on the video resolution and frame rate you have set. For the correspondence between video resolution and frame rate, see. STANDARD_BITRATE (0): (Recommended) Standard bitrate mode. COMPATIBLE_BITRATE (-1): Adaptive bitrate mode. In general, Agora suggests that you do not use this value. */ bitrate?: number; /** @@ -3014,7 +3014,7 @@ export class LiveTranscoding { */ height?: number; /** - * The encoding bitrate (Kbps) of the video.. This parameter does not need to be set; keeping the default value STANDARD_BITRATE is sufficient. The SDK automatically matches the most suitable bitrate based on the video resolution and frame rate you have set. For the correspondence between video resolution and frame rate, see. + * The encoding bitrate (Kbps) of the video. This parameter does not need to be set; keeping the default value STANDARD_BITRATE is sufficient. The SDK automatically matches the most suitable bitrate based on the video resolution and frame rate you have set. For the correspondence between video resolution and frame rate, see. */ videoBitrate?: number; /** @@ -3763,11 +3763,11 @@ export enum VideoDenoiserLevel { */ export class VideoDenoiserOptions { /** - * Video noise reduction mode.. + * Video noise reduction mode. */ mode?: VideoDenoiserMode; /** - * Video noise reduction level.. + * Video noise reduction level. */ level?: VideoDenoiserLevel; } @@ -4939,7 +4939,7 @@ export class ScreenVideoParameters { */ bitrate?: number; /** - * The content hint for screen sharing.. + * The content hint for screen sharing. */ contentHint?: VideoContentHint; } diff --git a/ts/Private/AgoraMediaBase.ts b/ts/Private/AgoraMediaBase.ts index 2af49b051..97b42aa2e 100644 --- a/ts/Private/AgoraMediaBase.ts +++ b/ts/Private/AgoraMediaBase.ts @@ -772,15 +772,17 @@ export class ContentInspectConfig { } /** - * @ignore + * The snapshot configuration. */ export class SnapshotConfig { /** - * @ignore + * The local path (including filename extensions) of the snapshot. For example: + * Windows: C:\Users\\AppData\Local\Agora\\example.jpg + * macOS: ~/Library/Logs/example.jpg Ensure that the path you specify exists and is writable. */ filePath?: string; /** - * @ignore + * The position of the snapshot video frame in the video pipeline. See VideoModulePosition. */ position?: VideoModulePosition; } @@ -796,7 +798,7 @@ export interface IAudioPcmFrameSink { * * After registering the audio frame observer, the callback occurs every time the player receives an audio frame, reporting the detailed information of the audio frame. * - * @param frame The audio frame information.. See AudioPcmFrame. + * @param frame The audio frame information. See AudioPcmFrame. */ onFrame?(frame: AudioPcmFrame): void; } diff --git a/ts/Private/IAgoraMediaEngine.ts b/ts/Private/IAgoraMediaEngine.ts index cff58573d..812894738 100644 --- a/ts/Private/IAgoraMediaEngine.ts +++ b/ts/Private/IAgoraMediaEngine.ts @@ -308,9 +308,4 @@ export abstract class IMediaEngine { * < 0: Failure. */ abstract unregisterFaceInfoObserver(observer: IFaceInfoObserver): number; - - /** - * @ignore - */ - abstract setExternalRemoteEglContext(eglContext: any): number; } diff --git a/ts/Private/IAgoraRtcEngine.ts b/ts/Private/IAgoraRtcEngine.ts index 86efd557a..d6fa485fd 100644 --- a/ts/Private/IAgoraRtcEngine.ts +++ b/ts/Private/IAgoraRtcEngine.ts @@ -500,7 +500,7 @@ export class LocalVideoStats { */ dualStreamEnabled?: boolean; /** - * The local video encoding acceleration type.. + * The local video encoding acceleration type. * 0: Software encoding is applied without acceleration. * 1: Hardware encoding is applied for acceleration. */ @@ -1060,7 +1060,7 @@ export class ScreenCaptureSourceInfo { */ isOccluded?: boolean; /** - * The position of a window relative to the entire screen space (including all shareable screens). See Rectangle.. + * The position of a window relative to the entire screen space (including all shareable screens). See Rectangle. */ position?: Rectangle; /** @@ -3482,7 +3482,7 @@ export abstract class IRtcEngine { * If someone subscribes to the low-quality stream, the SDK enables the low-quality stream and resets it to the SimulcastStreamConfig configuration used in the most recent calling of setDualStreamMode. If no configuration has been set by the user previously, the following values are used: * Resolution: 480 × 272 * Frame rate: 15 fps - * Bitrate: 500 Kbps ApplicationScenario1v1 (2) This is applicable to the scenario. To meet the requirements for low latency and high-quality video in this scenario, the SDK optimizes its strategies, improving performance in terms of video quality, first frame rendering, latency on mid-to-low-end devices, and smoothness under weak network conditions. (3) This is applicable to the scenario. In response to the high demands for first-frame rendering time and image quality, the SDK focuses on reducing first-frame rendering time and enhancing overall image quality, even in poor network conditions or on low-end devices. + * Bitrate: 500 Kbps ApplicationScenario1v1 (2) This is applicable to the scenario. To meet the requirements for low latency and high-quality video in this scenario, the SDK optimizes its strategies, improving performance in terms of video quality, first frame rendering, latency on mid-to-low-end devices, and smoothness under weak network conditions. ApplicationScenarioLiveshow (3) This is applicable to the scenario. In this scenario, fast video rendering and high image quality are crucial. The SDK implements several performance optimizations, including automatically enabling accelerated audio and video frame rendering to minimize first-frame latency (no need to call enableInstantMediaRendering), and B-frame encoding to achieve better image quality and bandwidth efficiency. The SDK also provides enhanced video quality and smooth playback, even in poor network conditions or on lower-end devices. * * @returns * 0: Success. @@ -5468,8 +5468,8 @@ export abstract class IRtcEngine { * * You can call this method before sharing a screen or window to get a list of shareable screens and windows, which enables a user to use thumbnails in the list to easily choose a particular screen or window to share. This list also contains important information such as window ID and screen ID, with which you can call startScreenCaptureByWindowId or startScreenCaptureByDisplayId to start the sharing. * - * @param thumbSize The target size of the screen or window thumbnail (the width and height are in pixels).. The SDK scales the original image to make the length of the longest side of the image the same as that of the target size without distorting the original image. For example, if the original image is 400 × 300 and thumbSize is 100 × 100, the actual size of the thumbnail is 100 × 75. If the target size is larger than the original size, the thumbnail is the original image and the SDK does not scale it. - * @param iconSize The target size of the icon corresponding to the application program (the width and height are in pixels).. The SDK scales the original image to make the length of the longest side of the image the same as that of the target size without distorting the original image. For example, if the original image is 400 × 300 and iconSize is 100 × 100, the actual size of the icon is 100 × 75. If the target size is larger than the original size, the icon is the original image and the SDK does not scale it. + * @param thumbSize The target size of the screen or window thumbnail (the width and height are in pixels). The SDK scales the original image to make the length of the longest side of the image the same as that of the target size without distorting the original image. For example, if the original image is 400 × 300 and thumbSize is 100 × 100, the actual size of the thumbnail is 100 × 75. If the target size is larger than the original size, the thumbnail is the original image and the SDK does not scale it. + * @param iconSize The target size of the icon corresponding to the application program (the width and height are in pixels). The SDK scales the original image to make the length of the longest side of the image the same as that of the target size without distorting the original image. For example, if the original image is 400 × 300 and iconSize is 100 × 100, the actual size of the icon is 100 × 75. If the target size is larger than the original size, the icon is the original image and the SDK does not scale it. * @param includeScreen Whether the SDK returns the screen information in addition to the window information: true : The SDK returns screen and window information. false : The SDK returns window information only. * * @returns @@ -5494,7 +5494,7 @@ export abstract class IRtcEngine { * Captures the video stream of a screen or a part of the screen area. * * @param displayId The display ID of the screen to be shared. For the Windows platform, if you need to simultaneously share two screens (main screen and secondary screen), you can set displayId to -1 when calling this method. - * @param regionRect (Optional) Sets the relative location of the region to the screen. Pass in nil to share the entire screen.. + * @param regionRect (Optional) Sets the relative location of the region to the screen. Pass in nil to share the entire screen. * @param captureParams Screen sharing configurations. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges. See ScreenCaptureParameters. The video properties of the screen sharing stream only need to be set through this parameter, and are unrelated to setVideoEncoderConfiguration. * * @returns @@ -5631,7 +5631,7 @@ export abstract class IRtcEngine { /** * @ignore */ - abstract setExternalMediaProjection(mediaProjection: any): number; + abstract setExternalMediaProjection(): any; /** * Sets the screen sharing scenario. @@ -6796,7 +6796,16 @@ export abstract class IRtcEngine { abstract getNativeHandle(): number; /** - * @ignore + * Takes a screenshot of the video at the specified observation point. + * + * 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 config The configuration of the snaptshot. See SnapshotConfig. + * + * @returns + * 0: Success. + * < 0: Failure. */ abstract takeSnapshotWithConfig(uid: number, config: SnapshotConfig): number; } diff --git a/ts/Private/IAgoraRtcEngineEx.ts b/ts/Private/IAgoraRtcEngineEx.ts index 926337b67..cde1a072c 100644 --- a/ts/Private/IAgoraRtcEngineEx.ts +++ b/ts/Private/IAgoraRtcEngineEx.ts @@ -973,6 +973,41 @@ export abstract class IRtcEngineEx extends IRtcEngine { /** * @ignore */ + abstract preloadEffectEx( + connection: RtcConnection, + soundId: number, + filePath: string, + startPos?: number + ): number; + + /** + * @ignore + */ + abstract playEffectEx( + connection: RtcConnection, + soundId: number, + filePath: string, + loopCount: number, + pitch: number, + pan: number, + gain: number, + publish?: boolean, + startPos?: number + ): number; + + /** + * Gets a video screenshot of the specified observation point using the 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 config The configuration of the snaptshot. See SnapshotConfig. + * + * @returns + * 0: Success. + * < 0: Failure. + */ abstract takeSnapshotWithConfigEx( connection: RtcConnection, uid: number, diff --git a/ts/Private/IAudioDeviceManager.ts b/ts/Private/IAudioDeviceManager.ts index df1f45ea4..d238cde4d 100644 --- a/ts/Private/IAudioDeviceManager.ts +++ b/ts/Private/IAudioDeviceManager.ts @@ -181,12 +181,21 @@ export abstract class IAudioDeviceManager { abstract getPlaybackDeviceMute(): boolean; /** - * @ignore + * Sets the mute status of the audio capture device. + * + * @param mute Whether to mute the audio recording device: true : Mute the audio capture device. false : Unmute the audio capture device. + * + * @returns + * 0: Success. + * < 0: Failure. */ abstract setRecordingDeviceMute(mute: boolean): number; /** - * @ignore + * Gets whether the audio capture device is muted. + * + * @returns + * true : The microphone is muted. false : The microphone is unmuted. */ abstract getRecordingDeviceMute(): boolean; diff --git a/ts/Private/impl/IAgoraMediaEngineImpl.ts b/ts/Private/impl/IAgoraMediaEngineImpl.ts index 20cf48c95..ddc9e7a5c 100644 --- a/ts/Private/impl/IAgoraMediaEngineImpl.ts +++ b/ts/Private/impl/IAgoraMediaEngineImpl.ts @@ -468,24 +468,6 @@ export class IMediaEngineImpl implements IMediaEngine { ): string { return 'MediaEngine_unregisterFaceInfoObserver'; } - - setExternalRemoteEglContext(eglContext: any): number { - const apiType = this.getApiTypeFromSetExternalRemoteEglContext(eglContext); - const jsonParams = { - eglContext: eglContext, - toJSON: () => { - return { - eglContext: eglContext, - }; - }, - }; - const jsonResults = callIrisApi.call(this, apiType, jsonParams); - return jsonResults.result; - } - - protected getApiTypeFromSetExternalRemoteEglContext(eglContext: any): string { - return 'MediaEngine_setExternalRemoteEglContext_f337cbf'; - } } import { callIrisApi } from '../internal/IrisApiEngine'; diff --git a/ts/Private/impl/IAgoraRtcEngineExImpl.ts b/ts/Private/impl/IAgoraRtcEngineExImpl.ts index f454f6d2a..608cfac8f 100644 --- a/ts/Private/impl/IAgoraRtcEngineExImpl.ts +++ b/ts/Private/impl/IAgoraRtcEngineExImpl.ts @@ -1634,6 +1634,109 @@ export class IRtcEngineExImpl extends IRtcEngineImpl implements IRtcEngineEx { return 'RtcEngineEx_sendAudioMetadataEx_e2bf1c4'; } + preloadEffectEx( + connection: RtcConnection, + soundId: number, + filePath: string, + startPos: number = 0 + ): number { + const apiType = this.getApiTypeFromPreloadEffectEx( + connection, + soundId, + filePath, + startPos + ); + const jsonParams = { + connection: connection, + soundId: soundId, + filePath: filePath, + startPos: startPos, + toJSON: () => { + return { + connection: connection, + soundId: soundId, + filePath: filePath, + startPos: startPos, + }; + }, + }; + const jsonResults = callIrisApi.call(this, apiType, jsonParams); + return jsonResults.result; + } + + protected getApiTypeFromPreloadEffectEx( + connection: RtcConnection, + soundId: number, + filePath: string, + startPos: number = 0 + ): string { + return 'RtcEngineEx_preloadEffectEx_c9fae88'; + } + + playEffectEx( + connection: RtcConnection, + soundId: number, + filePath: string, + loopCount: number, + pitch: number, + pan: number, + gain: number, + publish: boolean = false, + startPos: number = 0 + ): number { + const apiType = this.getApiTypeFromPlayEffectEx( + connection, + soundId, + filePath, + loopCount, + pitch, + pan, + gain, + publish, + startPos + ); + const jsonParams = { + connection: connection, + soundId: soundId, + filePath: filePath, + loopCount: loopCount, + pitch: pitch, + pan: pan, + gain: gain, + publish: publish, + startPos: startPos, + toJSON: () => { + return { + connection: connection, + soundId: soundId, + filePath: filePath, + loopCount: loopCount, + pitch: pitch, + pan: pan, + gain: gain, + publish: publish, + startPos: startPos, + }; + }, + }; + const jsonResults = callIrisApi.call(this, apiType, jsonParams); + return jsonResults.result; + } + + protected getApiTypeFromPlayEffectEx( + connection: RtcConnection, + soundId: number, + filePath: string, + loopCount: number, + pitch: number, + pan: number, + gain: number, + publish: boolean = false, + startPos: number = 0 + ): string { + return 'RtcEngineEx_playEffectEx_ae5345c'; + } + takeSnapshotWithConfigEx( connection: RtcConnection, uid: number, diff --git a/ts/Private/impl/IAgoraRtcEngineImpl.ts b/ts/Private/impl/IAgoraRtcEngineImpl.ts index ad0111979..e10278c67 100644 --- a/ts/Private/impl/IAgoraRtcEngineImpl.ts +++ b/ts/Private/impl/IAgoraRtcEngineImpl.ts @@ -5359,24 +5359,15 @@ export class IRtcEngineImpl implements IRtcEngine { return 'RtcEngine_queryCameraFocalLengthCapability_2dee6af'; } - setExternalMediaProjection(mediaProjection: any): number { - const apiType = - this.getApiTypeFromSetExternalMediaProjection(mediaProjection); - const jsonParams = { - mediaProjection: mediaProjection, - toJSON: () => { - return { - mediaProjection: mediaProjection, - }; - }, - }; + setExternalMediaProjection(): any { + const apiType = this.getApiTypeFromSetExternalMediaProjection(); + const jsonParams = {}; const jsonResults = callIrisApi.call(this, apiType, jsonParams); - return jsonResults.result; + const mediaProjection = jsonResults.mediaProjection; + return mediaProjection; } - protected getApiTypeFromSetExternalMediaProjection( - mediaProjection: any - ): string { + protected getApiTypeFromSetExternalMediaProjection(): string { return 'RtcEngine_setExternalMediaProjection_f337cbf'; }