Skip to content

Commit

Permalink
[AUTO] Generate codes by terra (#841)
Browse files Browse the repository at this point in the history
Co-authored-by: guoxianzhe <[email protected]>
  • Loading branch information
sda-rob and guoxianzhe authored Dec 3, 2024
1 parent 199b576 commit a1f5eed
Show file tree
Hide file tree
Showing 7 changed files with 184 additions and 100 deletions.
55 changes: 33 additions & 22 deletions src/AgoraBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -772,11 +772,11 @@ export enum OrientationMode {
*/
export enum DegradationPreference {
/**
* @ignore
* 0: (Default) Automatic mode. The SDK will automatically select MaintainFramerate, MaintainBalanced or MaintainResolution based on the video scenario you set, in order to achieve the best overall quality of experience (QoE).
*/
MaintainAuto = -1,
/**
* 0: (Default) Prefers to reduce the video frame rate while maintaining video resolution during video encoding under limited bandwidth. This degradation preference is suitable for scenarios where video quality is prioritized.
* 0: Prefers to reduce the video frame rate while maintaining video resolution during video encoding under limited bandwidth. This degradation preference is suitable for scenarios where video quality is prioritized. Deprecated: This enumerator is deprecated. Use other enumerations instead.
*/
MaintainQuality = 0,
/**
Expand Down Expand Up @@ -1266,15 +1266,15 @@ export class EncodedVideoFrameInfo {
*/
export enum CompressionPreference {
/**
* @ignore
* -1: (Default) Automatic mode. The SDK will automatically select PreferLowLatency or PreferQuality based on the video scenario you set to achieve the best user experience.
*/
PreferCompressionAuto = -1,
/**
* 0: Low latency preference. The SDK compresses video frames to reduce latency. This preference is suitable for scenarios where smoothness is prioritized and reduced video quality is acceptable.
*/
PreferLowLatency = 0,
/**
* 1: (Default) High quality preference. The SDK compresses video frames while maintaining video quality. This preference is suitable for scenarios where video quality is prioritized.
* 1: High quality preference. The SDK compresses video frames while maintaining video quality. This preference is suitable for scenarios where video quality is prioritized.
*/
PreferQuality = 1,
}
Expand Down Expand Up @@ -2108,11 +2108,11 @@ export enum VideoApplicationScenarioType {
*/
ApplicationScenarioMeeting = 1,
/**
* ApplicationScenario1v1 (2) is suitable for 1v1 video call scenarios. 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. 2: 1v1 video call scenario.
* 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. 2: 1v1 video call scenario.
*/
ApplicationScenario1v1 = 2,
/**
* @ignore
* 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. 3. Live show scenario.
*/
ApplicationScenarioLiveshow = 3,
}
Expand Down Expand Up @@ -3285,41 +3285,45 @@ export enum VideoTranscoderError {
}

/**
* @ignore
* The source of the audio streams that are mixed locally.
*/
export class MixedAudioStream {
/**
* @ignore
* The type of the audio source. See AudioSourceType.
*/
sourceType?: AudioSourceType;
/**
* @ignore
* The user ID of the remote user. Set this parameter if the source type of the locally mixed audio steams is AudioSourceRemoteUser.
*/
remoteUserUid?: number;
/**
* @ignore
* The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters (89 characters in total):
* All lowercase English letters: a to z.
* All uppercase English letters: A to Z.
* All numeric characters: 0 to 9.
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", "," Set this parameter if the source type of the locally mixed audio streams is AudioSourceRemoteChannel or AudioSourceRemoteUser.
*/
channelId?: string;
/**
* @ignore
* The audio track ID. Set this parameter to the custom audio track ID returned in createCustomAudioTrack. Set this parameter if the source type of the locally mixed audio steams is AudioSourceCustom.
*/
trackId?: number;
}

/**
* @ignore
* The configurations for mixing the lcoal audio.
*/
export class LocalAudioMixerConfiguration {
/**
* @ignore
* The number of the audio streams that are mixed locally.
*/
streamCount?: number;
/**
* @ignore
* The source of the audio streams that are mixed locally. See MixedAudioStream.
*/
audioInputStreams?: MixedAudioStream[];
/**
* @ignore
* Whether the mxied audio stream uses the timestamp of the audio frames captured by the local microphone. true : (Default) Yes. Set to this value if you want all locally captured audio streams synchronized. false : No. The SDK uses the timestamp of the audio frames at the time when they are mixed.
*/
syncWithLocalMic?: boolean;
}
Expand Down Expand Up @@ -3855,15 +3859,22 @@ export class FaceShapeBeautyOptions {
}

/**
* @ignore
* Filter effect options.
*/
export class FilterEffectOptions {
/**
* @ignore
* The absolute path to the local cube map texture file, which can be used to customize the filter effect. The specified .cude file should strictly follow the Cube LUT Format Specification; otherwise, the filter options do not take effect. The following is a sample of the .cude file:
* LUT_3D_SIZE 32
* 0.0039215689 0 0.0039215682
* 0.0086021447 0.0037950677 0
* ...
* 0.0728652592 0.0039215689 0
* The identifier LUT_3D_SIZE on the first line of the cube map file represents the size of the three-dimensional lookup table. The LUT size for filter effect can only be set to 32.
* The SDK provides a built-in built_in_whiten_filter.cube file. You can pass the absolute path of this file to get the whitening filter effect.
*/
path?: string;
/**
* @ignore
* The intensity of the filter effect, with a range value of [0.0,1.0], in which 0.0 represents no filter effect. The default value is 0.5. The higher the value, the stronger the filter effect.
*/
strength?: number;
}
Expand Down Expand Up @@ -3925,15 +3936,15 @@ export enum VideoDenoiserMode {
}

/**
* The video noise reduction level.
* Video noise reduction level.
*/
export enum VideoDenoiserLevel {
/**
* 0: (Default) Promotes video quality during video noise reduction. balances performance consumption and video noise reduction quality. The performance consumption is moderate, the video noise reduction speed is moderate, and the overall video quality is optimal.
*/
VideoDenoiserLevelHighQuality = 0,
/**
* 1: Promotes reducing performance consumption during video noise reduction. prioritizes reducing performance consumption over video noise reduction quality. The performance consumption is lower, and the video noise reduction speed is faster. To avoid a noticeable shadowing effect (shadows trailing behind moving objects) in the processed video, Agora recommends that you use this settinging when the camera is fixed.
* 1: Promotes reducing performance consumption during video noise reduction. It prioritizes reducing performance consumption over video noise reduction quality. The performance consumption is lower, and the video noise reduction speed is faster. To avoid a noticeable shadowing effect (shadows trailing behind moving objects) in the processed video, Agora recommends that you use this setting when the camera is fixed.
*/
VideoDenoiserLevelFast = 1,
}
Expand Down Expand Up @@ -4089,7 +4100,7 @@ export class AudioTrackConfig {
*/
enableLocalPlayback?: boolean;
/**
* @ignore
* Whether to enable audio processing module: true Enable the audio processing module to apply the Automatic Echo Cancellation (AEC), Automatic Noise Suppression (ANS), and Automatic Gain Control (AGC) effects. false : (Default) Do not enable the audio processing module. This parameter only takes effect on AudioTrackDirect in custom audio capturing.
*/
enableAudioProcessing?: boolean;
}
Expand Down Expand Up @@ -4784,7 +4795,7 @@ export class ChannelMediaRelayConfiguration {
/**
* The information of the target channel ChannelMediaInfo. It contains the following members: channelName : The name of the target channel. token : The token for joining the target channel. It is generated with the channelName and uid you set in destInfos.
* If you have not enabled the App Certificate, set this parameter as the default value null, which means the SDK applies the App ID.
* If you have enabled the App Certificate, you must use the token generated with the channelName and uid. If the token of any target channel expires, the whole media relay stops; hence Agora recommends that you specify the same expiration time for the tokens of all the target channels. uid : The unique user ID to identify the relay stream in the target channel. The value ranges from 0 to (2 32 -1). To avoid user ID conflicts, this user ID must be different from any other user ID in the target channel. The default value is 0, which means the SDK generates a random user ID.
* If you have enabled the App Certificate, you must use the token generated with the channelName and uid. If the token of any target channel expires, the whole media relay stops; hence Agora recommends that you specify the same expiration time for the tokens of all the target channels. uid : The unique user ID to identify the relay stream in the target channel. The value ranges from 0 to (2 32 -1). To avoid user ID conflicts, this user ID must be different from any other user ID in the target channel. The default value is 0, which means the SDK generates a random UID.
*/
destInfos?: ChannelMediaInfo[];
/**
Expand Down
44 changes: 23 additions & 21 deletions src/AgoraMediaBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,39 +106,39 @@ export enum VideoSourceType {
}

/**
* @ignore
* The audio source type.
*/
export enum AudioSourceType {
/**
* @ignore
* 0: (Default) Microphone.
*/
AudioSourceMicrophone = 0,
/**
* @ignore
* 1: Custom audio stream.
*/
AudioSourceCustom = 1,
/**
* @ignore
* 2: Media player.
*/
AudioSourceMediaPlayer = 2,
/**
* @ignore
* 3: System audio stream captured during screen sharing.
*/
AudioSourceLoopbackRecording = 3,
/**
* @ignore
*/
AudioSourceMixedStream = 4,
/**
* @ignore
* 5: Audio stream from a specified remote user.
*/
AudioSourceRemoteUser = 5,
/**
* @ignore
* 6: Mixed audio streams from all users in the current channel.
*/
AudioSourceRemoteChannel = 6,
/**
* @ignore
* 100: An unknown audio source.
*/
AudioSourceUnknown = 100,
}
Expand Down Expand Up @@ -536,11 +536,11 @@ export enum VideoPixelFormat {
*/
export enum RenderModeType {
/**
* 1: Hidden mode. Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). One dimension of the video may have clipped contents.
* 1: Hidden mode. The priority is to fill the window. Any excess video that does not match the window size will be cropped.
*/
RenderModeHidden = 1,
/**
* 2: Fit mode. Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to disparity in the aspect ratio are filled with black.
* 2: Fit mode. The priority is to ensure that all video content is displayed. Any areas of the window that are not filled due to the mismatch between video size and window size will be filled with black.
*/
RenderModeFit = 2,
/**
Expand Down Expand Up @@ -876,27 +876,27 @@ export class Hdr10MetadataInfo {
}

/**
* @ignore
* The relative position of alphaBuffer and video frames.
*/
export enum AlphaStitchMode {
/**
* @ignore
* 0: (Default) Only video frame, that is, alphaBuffer is not stitched with the video frame.
*/
NoAlphaStitch = 0,
/**
* @ignore
* 1: alphaBuffer is above the video frame.
*/
AlphaStitchUp = 1,
/**
* @ignore
* 2: alphaBuffer is below the video frame.
*/
AlphaStitchBelow = 2,
/**
* @ignore
* 3: alphaBuffer is to the left of the video frame.
*/
AlphaStitchLeft = 3,
/**
* @ignore
* 4: alphaBuffer is to the right of the video frame.
*/
AlphaStitchRight = 4,
}
Expand Down Expand Up @@ -1032,7 +1032,7 @@ export class ExternalVideoFrame {
*/
hdr10MetadataInfo?: Hdr10MetadataInfo;
/**
* @ignore
* By default, the color space properties of video frames will apply the Full Range and BT.709 standard configurations. You can configure the settings according your needs for custom video capturing and rendering.
*/
colorSpace?: ColorSpace;
}
Expand Down Expand Up @@ -1130,7 +1130,7 @@ export class VideoFrame {
*/
hdr10MetadataInfo?: Hdr10MetadataInfo;
/**
* @ignore
* By default, the color space properties of video frames will apply the Full Range and BT.709 standard configurations. You can configure the settings according your needs for custom video capturing and rendering.
*/
colorSpace?: ColorSpace;
}
Expand Down Expand Up @@ -1178,15 +1178,17 @@ export enum VideoModulePosition {
}

/**
* @ignore
* The snapshot configuration.
*/
export class SnapshotConfig {
/**
* @ignore
* The local path (including filename extensions) of the snapshot. For example:
* iOS: /App Sandbox/Library/Caches/example.jpg
* Android: /storage/emulated/0/Android/data/<package name>/files/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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/AgoraMediaPlayerTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ export class MediaSource {
*/
startPos?: number;
/**
* Whether to enable autoplay once the media file is opened: true : (Default) Enables autoplay. false : Disables autoplay. If autoplay is disabled, you need to call the play method to play a media file after it is opened.
* Whether to enable autoplay once the media file is opened: true : (Default) Yes. false : No. If autoplay is disabled, you need to call the play method to play a media file after it is opened.
*/
autoPlay?: boolean;
/**
Expand Down
15 changes: 8 additions & 7 deletions src/IAgoraMediaPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ export abstract class IMediaPlayer {
* @param index The index of the media stream. This parameter must be less than the return value of getStreamCount.
*
* @returns
* If the call succeeds, returns the detailed information of the media stream. See PlayerStreamInfo.
* If the call fails, returns null.
* If the call succeeds, returns the detailed information of the media stream. See PlayerStreamInfo. null, if the method call fails.
*/
abstract getStreamInfo(index: number): PlayerStreamInfo;

Expand All @@ -177,8 +176,8 @@ export abstract class IMediaPlayer {
*
* Call this method after calling open.
*
* @param speed The playback speed. Agora recommends that you limit this value to a range between 50 and 400, which is defined as follows:
* 50: Half the original speed.
* @param speed The playback speed. Agora recommends that you set this to a value between 30 and 400, defined as follows:
* 30: 0.3 times the original speed.
* 100: The original speed.
* 400: 4 times the original speed.
*
Expand Down Expand Up @@ -493,22 +492,24 @@ export abstract class IMediaPlayer {
*
* You can call this method to switch the media resource to be played according to the current network status. For example:
* When the network is poor, the media resource to be played is switched to a media resource address with a lower bitrate.
* When the network is good, the media resource to be played is switched to a media resource address with a higher bitrate. After calling this method, if you receive the PlayerEventSwitchComplete event in the onPlayerEvent callback, the switch is successful; If you receive the PlayerEventSwitchError event in the onPlayerEvent callback, the switch fails.
* When the network is good, the media resource to be played is switched to a media resource address with a higher bitrate. After calling this method, if you receive the onPlayerEvent callback report the PlayerEventSwitchComplete event, the switching is successful. If the switching fails, the SDK will automatically retry 3 times. If it still fails, you will receive the onPlayerEvent callback reporting the PlayerEventSwitchError event indicating an error occurred during media resource switching.
* Ensure that you call this method after open.
* To ensure normal playback, pay attention to the following when calling this method:
* Do not call this method when playback is paused.
* Do not call the seek method during switching.
* Before switching the media resource, make sure that the playback position does not exceed the total duration of the media resource to be switched.
*
* @param src The URL of the media resource.
* @param syncPts Whether to synchronize the playback position (ms) before and after the switch: true : Synchronize the playback position before and after the switch. false : (Default) Do not synchronize the playback position before and after the switch. Make sure to set this parameter as false if you need to play live streams, or the switch fails. If you need to play on-demand streams, you can set the value of this parameter according to your scenarios.
* @param syncPts Whether to synchronize the playback position (ms) before and after the switch: true : Synchronize the playback position before and after the switch. false : (Default) Do not synchronize the playback position before and after the switch.
*/
abstract switchSrc(src: string, syncPts?: boolean): number;

/**
* Preloads a media resource.
*
* You can call this method to preload a media resource into the playlist. If you need to preload multiple media resources, you can call this method multiple times. After calling this method, if you receive the PlayerPreloadEventComplete event in the onPreloadEvent callback, the preload is successful; If you receive the PlayerPreloadEventError event in the onPreloadEvent callback, the preload fails. If the preload is successful and you want to play the media resource, call playPreloadedSrc; if you want to clear the playlist, call stop. Agora does not support preloading duplicate media resources to the playlist. However, you can preload the media resources that are being played to the playlist again.
* You can call this method to preload a media resource into the playlist. If you need to preload multiple media resources, you can call this method multiple times. After calling this method, if you receive the PlayerPreloadEventComplete event in the onPreloadEvent callback, the preload is successful; If you receive the PlayerPreloadEventError event in the onPreloadEvent callback, the preload fails. If the preload is successful and you want to play the media resource, call playPreloadedSrc; if you want to clear the playlist, call stop.
* Before calling this method, ensure that you have called open or openWithMediaSource to open the media resource successfully.
* Agora does not support preloading duplicate media resources to the playlist. However, you can preload the media resources that are being played to the playlist again.
*
* @param src The URL of the media resource.
* @param startPos The starting position (ms) for playing after the media resource is preloaded to the playlist. When preloading a live stream, set this parameter to 0.
Expand Down
Loading

0 comments on commit a1f5eed

Please sign in to comment.