Skip to content

Commit

Permalink
[AUTO] Generate code by terra
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 authored Apr 7, 2023
1 parent 52e046f commit 531cfb4
Show file tree
Hide file tree
Showing 12 changed files with 262 additions and 313 deletions.
41 changes: 21 additions & 20 deletions ts/Private/AgoraBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2241,11 +2241,11 @@ export enum RemoteVideoDownscaleLevel {
*/
export class AudioVolumeInfo {
/**
* The user ID.In the local user's callback, uid = 0.In the remote users' callback, uid is the user ID of a remote user whose instantaneous volume is one of the three highest.
* The user ID.In the local user's callback, uid is 0.In the remote users' callback, uid is the user ID of a remote user whose instantaneous volume is the highest.
*/
uid?: number;
/**
* The volume of the user. The value ranges between 0 (lowest volume) and 255 (highest volume).
* The volume of the user. The value ranges between 0 (the lowest volume) and 255 (the highest volume). If the local user enables audio capturing and calls muteLocalAudioStream and set it as true to mute, the value of volume indicates the volume of locally captured audio signal.
*/
volume?: number;
/**
Expand Down Expand Up @@ -2389,24 +2389,23 @@ export enum RtmpStreamPublishState {
*/
RtmpStreamPublishStateIdle = 0,
/**
* 1: The SDK is connecting to Agora's streaming server and the CDN server.
* 1: The streaming server and CDN server are being connected.
*/
RtmpStreamPublishStateConnecting = 1,
/**
* 2: The RTMP or RTMPS streaming publishes. The SDK successfully publishes the RTMP or RTMPS streaming and returns this state.
*/
RtmpStreamPublishStateRunning = 2,
/**
* 3: The RTMP or RTMPS streaming is recovering. When exceptions occur to the CDN, or the streaming is interrupted, the SDK tries to resume RTMP or RTMPS streaming and returns this state.If the SDK successfully resumes the streaming, RtmpStreamPublishStateRunning(2) returns.
* If the streaming does not resume within 60 seconds or server errors occur, RtmpStreamPublishStateFailure(4) returns. You can also reconnect to the server by calling the stopRtmpStream method.
* 3: The RTMP or RTMPS streaming is recovering. When exceptions occur to the CDN, or the streaming is interrupted, the SDK tries to resume RTMP or RTMPS streaming and returns this state.If the SDK successfully resumes the streaming, RtmpStreamPublishStateRunning(2) returns.If the streaming does not resume within 60 seconds or server errors occur, RtmpStreamPublishStateFailure(4) returns. If you feel that 60 seconds is too long, you can also actively try to reconnect.
*/
RtmpStreamPublishStateRecovering = 3,
/**
* 4: The RTMP or RTMPS streaming fails. See the errCode parameter for the detailed error information.
* 4: The RTMP or RTMPS streaming fails. After a failure, you can troubleshoot the cause of the error through the returned error code.
*/
RtmpStreamPublishStateFailure = 4,
/**
* 5: The SDK is disconnecting from the Agora streaming server and CDN. When you call stopRtmpStream to stop the streaming normally, the SDK reports the streaming state as RtmpStreamPublishStateDisconnecting and RtmpStreamPublishStateIdle in sequence.
* 5: The SDK is disconnecting from the Agora streaming server and CDN. When you call stopRtmpStream to stop the Media Push normally, the SDK reports the Media Push state as RtmpStreamPublishStateDisconnecting and RtmpStreamPublishStateIdle in sequence.
*/
RtmpStreamPublishStateDisconnecting = 5,
}
Expand All @@ -2416,7 +2415,7 @@ export enum RtmpStreamPublishState {
*/
export enum RtmpStreamPublishErrorType {
/**
* 0: The RTMP or RTMPS streaming publishes successfully.
* 0: The RTMP or RTMPS streaming has not started or has ended.
*/
RtmpStreamPublishErrorOk = 0,
/**
Expand All @@ -2428,19 +2427,19 @@ export enum RtmpStreamPublishErrorType {
*/
RtmpStreamPublishErrorEncryptedStreamNotAllowed = 2,
/**
* 3: Timeout for the RTMP or RTMPS streaming. Try to publish the streaming again.
* 3: Timeout for the RTMP or RTMPS streaming.
*/
RtmpStreamPublishErrorConnectionTimeout = 3,
/**
* 4: An error occurs in Agora's streaming server. Try to publish the streaming again.
* 4: An error occurs in Agora's streaming server.
*/
RtmpStreamPublishErrorInternalServerError = 4,
/**
* 5: An error occurs in the CDN server.
*/
RtmpStreamPublishErrorRtmpServerError = 5,
/**
* 6: The RTMP or RTMPS streaming publishing requests are too frequent.
* 6: The RTMP or RTMPS streaming publishes too frequently.
*/
RtmpStreamPublishErrorTooOften = 6,
/**
Expand All @@ -2460,11 +2459,11 @@ export enum RtmpStreamPublishErrorType {
*/
RtmpStreamPublishErrorFormatNotSupported = 10,
/**
* 11: The user role is not host, so the user cannot use the CDN live streaming function. Check your app code logic.
* 11: The user role is not host, so the user cannot use the CDN live streaming function. Check your application code logic.
*/
RtmpStreamPublishErrorNotBroadcaster = 11,
/**
* 13: The updateRtmpTranscoding or setLiveTranscoding method is called to update the transcoding configuration in a scenario where there is streaming without transcoding. Check your application code logic.
* 13: The updateRtmpTranscoding method is called to update the transcoding configuration in a scenario where there is streaming without transcoding. Check your application code logic.
*/
RtmpStreamPublishErrorTranscodingNoMixStream = 13,
/**
Expand All @@ -2476,25 +2475,25 @@ export enum RtmpStreamPublishErrorType {
*/
RtmpStreamPublishErrorInvalidAppid = 15,
/**
* @ignore
* 16: Your project does not have permission to use streaming services. Refer to Media Push to enable the Media Push permission.
*/
RtmpStreamPublishErrorInvalidPrivilege = 16,
/**
* 100: The streaming has been stopped normally. After you call stopRtmpStream to stop streaming, the SDK returns this value.
* 100: The streaming has been stopped normally. After you stop the media push, the SDK returns this value.
*/
RtmpStreamUnpublishErrorOk = 100,
}

/**
* Events during the media push.
* Events during the Media Push.
*/
export enum RtmpStreamingEvent {
/**
* 1: An error occurs when you add a background image or a watermark image in the media push.
* 1: An error occurs when you add a background image or a watermark image in the Media Push.
*/
RtmpStreamingEventFailedLoadImage = 1,
/**
* 2: The streaming URL is already being used for CDN live streaming. If you want to start new streaming, use a new streaming URL.
* 2: The streaming URL is already being used for Media Push. If you want to start new streaming, use a new streaming URL.
*/
RtmpStreamingEventUrlAlreadyInUse = 2,
/**
Expand Down Expand Up @@ -3156,7 +3155,7 @@ export class VideoCanvas {
*/
sourceType?: VideoSourceType;
/**
* The ID of the media player. You can get the Device ID by calling getMediaPlayerId .
* The ID of the media player. You can get the media player ID by calling getMediaPlayerId .
*/
mediaPlayerId?: number;
/**
Expand Down Expand Up @@ -3846,7 +3845,9 @@ export interface IAudioEncodedFrameObserver {
* After calling registerAudioEncodedFrameObserver and setting the encoded audio as AudioEncodedFrameObserverPositionPlayback, you can get encoded audio data of all remote users through this callback.
*
* @param samplesPerSec Recording sample rate (Hz).
* @param channels The number of channels.1: Mono.2: Stereo. If the channel uses stereo, the data is interleaved.
* @param channels The number of channels.
* 1: Mono.
* 2: Stereo. If the channel uses stereo, the data is interleaved.
* @param samplesPerChannel The number of samples per channel in the audio frame.
* @param frameBuffer The audio buffer.
* @param length The data length (byte).
Expand Down
34 changes: 11 additions & 23 deletions ts/Private/AgoraMediaBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,10 @@ export enum VideoModulePosition {
*/
export interface IAudioPcmFrameSink {
/**
* Occurs each time the player receives an audio frame.
* 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.
* Occurs each time the player receives a video frame.
* After registering the video frame observer, the callback occurs every time the player receives a video frame, reporting the detailed information of the video frame.
*
* @param frame Audio frame information. See AudioPcmFrame .
* @param frame Video frame information. See VideoFrame .
*/
onFrame?(frame: AudioPcmFrame): void;
}
Expand Down Expand Up @@ -910,7 +910,7 @@ export class UserAudioSpectrumInfo {
export interface IAudioSpectrumObserver {
/**
* Gets the statistics of a local audio spectrum.
* After successfully calling registerAudioSpectrumObserver to implement the onLocalAudioSpectrumcallback in IAudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK will trigger the callback as the time interval you set to report the received remote audio data spectrum.
* After successfully calling registerAudioSpectrumObserver to implement the onLocalAudioSpectrum callback in IAudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK will trigger the callback as the time interval you set to report the received remote audio data spectrum.
*
* @param data The audio spectrum data of the local user. See AudioSpectrumData .
*
Expand Down Expand Up @@ -979,7 +979,7 @@ export enum VideoFrameProcessMode {
export interface IVideoFrameObserver {
/**
* Occurs each time the SDK receives a video frame captured by the local camera.
* After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data captured by the local camera. You can then pre-process the data according to your scenarios.After pre-processing, you can send the processed video data back to the SDK through this callback.The video data that this callback gets has not been pre-processed, and is not watermarked, cropped, rotated or beautified.If the video data type you get is RGBA, the SDK does not support processing the data of the alpha channel.
* After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data captured by the local camera. You can then pre-process the data according to your scenarios.Once the pre-processing is complete, you can directly modify videoFrame in this callback, and set the return value to true to send the modified video data to the SDK.The video data that this callback gets has not been pre-processed, and is not watermarked, cropped, rotated or beautified.If the video data type you get is RGBA, the SDK does not support processing the data of the alpha channel.
*
* @param videoFrame The video frame. See VideoFrame .The default value of the video frame data format obtained through this callback is as follows:macOS: YUV 420Windows: YUV 420
*
Expand All @@ -995,16 +995,10 @@ export interface IVideoFrameObserver {
* Occurs each time the SDK receives a video frame before encoding.
* After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data before encoding and then process the data according to your particular scenarios.After processing, you can send the processed video data back to the SDK in this callback.The video data that this callback gets has been preprocessed, with its content cropped and rotated, and the image enhanced.
*
* @param videoFrame The video frame. See VideoFrame .The default value of the video frame data format obtained through this callback is as follows:
* macOS: YUV 420
* Windows: YUV 420
* @param videoFrame The video frame. See VideoFrame .The default value of the video frame data format obtained through this callback is as follows:macOS: YUV 420Windows: YUV 420
*
* @returns
* When the video processing mode is ProcessModeReadOnly:
* true: Reserved for future use.
* false: Reserved for future use. When the video processing mode is ProcessModeReadWrite:
* true: Sets the SDK to receive the video frame.
* false: Sets the SDK to discard the video frame.
* When the video processing mode is ProcessModeReadOnly:true: Reserved for future use.false: Reserved for future use.When the video processing mode is ProcessModeReadWrite:true: Sets the SDK to receive the video frame.false: Sets the SDK to discard the video frame.
*/
onPreEncodeVideoFrame?(
sourceType: VideoSourceType,
Expand Down Expand Up @@ -1043,19 +1037,13 @@ export interface IVideoFrameObserver {
): boolean;

/**
* Occurs each time the SDK receives a video frame captured by the screen.
* After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data for screen sharing. You can then pre-process the data according to your scenarios.After pre-processing, you can send the processed video data back to the SDK through this callback.This callback does not support sending processed RGBA video data back to the SDK.The video data that this callback gets has not been pre-processed, and is not watermarked, cropped, rotated or beautified.
* Occurs each time the SDK receives a video frame before encoding.
* After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data before encoding and then process the data according to your particular scenarios.After processing, you can send the processed video data back to the SDK in this callback.The video data that this callback gets has been preprocessed, with its content cropped and rotated, and the image enhanced.
*
* @param videoFrame The video frame. See VideoFrame .The default value of the video frame data format obtained through this callback is as follows:
* macOS: YUV 420
* Windows: YUV 420
* @param videoFrame The video frame. See VideoFrame .The default value of the video frame data format obtained through this callback is as follows:macOS: YUV 420Windows: YUV 420
*
* @returns
* When the video processing mode is ProcessModeReadOnly:
* true: Reserved for future use.
* false: Reserved for future use. When the video processing mode is ProcessModeReadWrite:
* true: Sets the SDK to receive the video frame.
* false: Sets the SDK to discard the video frame.
* When the video processing mode is ProcessModeReadOnly:true: Reserved for future use.false: Reserved for future use.When the video processing mode is ProcessModeReadWrite:true: Sets the SDK to receive the video frame.false: Sets the SDK to discard the video frame.
*/
onTranscodedVideoFrame?(videoFrame: VideoFrame): boolean;
}
Expand Down
2 changes: 1 addition & 1 deletion ts/Private/IAgoraMediaEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export abstract class IMediaEngine {
* Call this method before joining a channel.
*
* @param enabled Whether to enable the external audio source:true: Enable the external audio source.false: (Default) Disable the external audio source.
* @param sampleRate The sample rate (Hz) of the external audio which can be set as 8000, 16000, 32000, 44100, or 48000.
* @param sampleRate The sample rate (Hz) of the external audio source which can be set as 8000, 16000, 32000, 44100, or 48000.
* @param channels The number of channels of the external audio source, which can be set as 1 (Mono) or 2 (Stereo).
* @param sourceNumber The number of external audio sources. The value of this parameter should be larger than 0. The SDK creates a corresponding number of custom audio tracks based on this parameter value and names the audio tracks starting from 0. In ChannelMediaOptions , you can set publishCustomAudioSourceId to the audio track ID you want to publish.
* @param localPlayback Whether to play the external audio source:true: Play the external audio source.false: (Default) Do not play the external source.
Expand Down
20 changes: 4 additions & 16 deletions ts/Private/IAgoraMediaPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,7 @@ export abstract class IMediaPlayer {
abstract setPlaybackSpeed(speed: number): number;

/**
* Gets the detailed information of the media stream.
* Call this method after calling getStreamCount .
*
* @param index The index of the media stream.
*
* @returns
* If the call succeeds, returns the detailed information of the media stream. See PlayerStreamInfo .If the call fails, returns NULL.
* @ignore
*/
abstract selectAudioTrack(index: number): number;

Expand Down Expand Up @@ -203,13 +197,7 @@ export abstract class IMediaPlayer {
abstract takeScreenshot(filename: string): number;

/**
* Gets the detailed information of the media stream.
* Call this method after calling getStreamCount .
*
* @param index The index of the media stream.
*
* @returns
* If the call succeeds, returns the detailed information of the media stream. See PlayerStreamInfo .If the call fails, returns NULL.
* @ignore
*/
abstract selectInternalSubtitle(index: number): number;

Expand Down Expand Up @@ -332,9 +320,9 @@ export abstract class IMediaPlayer {
): number;

/**
* Unregisters a receiver object for the encoded video image.
* Unregisters the encoded audio frame observer.
*
* @param observer The video observer, reporting the reception of each video frame. See IVideoEncodedFrameObserver .
* @param observer The encoded audio observer. See IAudioEncodedFrameObserver .
*
* @returns
* 0: Success.< 0: Failure.
Expand Down
8 changes: 1 addition & 7 deletions ts/Private/IAgoraMediaRecorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,7 @@ export abstract class IMediaRecorder {
abstract setMediaRecorderObserver(callback: IMediaRecorderObserver): number;

/**
* Sets the video encoder configuration.
* Sets the encoder configuration for the local video.You can call this method either before or after joining a channel. If the user does not need to reset the video encoding properties after joining the channel, Agora recommends calling this method before enableVideo to reduce the time to render the first video frame.
*
* @param config Video profile. See VideoEncoderConfiguration .
*
* @returns
* 0: Success.< 0: Failure.
* @ignore
*/
abstract startRecording(config: MediaRecorderConfiguration): number;

Expand Down
8 changes: 1 addition & 7 deletions ts/Private/IAgoraMusicContentCenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,7 @@ export abstract class MusicChartCollection {
abstract getCount(): number;

/**
* Gets the detailed information of the media stream.
* Call this method after calling getStreamCount .
*
* @param index The index of the media stream.
*
* @returns
* If the call succeeds, returns the detailed information of the media stream. See PlayerStreamInfo .If the call fails, returns NULL.
* @ignore
*/
abstract get(index: number): MusicChartInfo;
}
Expand Down
Loading

0 comments on commit 531cfb4

Please sign in to comment.