@byteplus/rtc 4.60.1 → 4.60.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,25 +1,7 @@
1
1
  // Generated by dts-bundle-generator v8.0.1
2
2
 
3
- import { EventEmitter } from 'eventemitter3';
4
-
5
- declare abstract class ExtensionBase extends EventEmitter {
6
- abstract name: string;
7
- abstract type: RTCExtensionType;
8
- abstract init(engineParams?: any): Promise<void>;
9
- protected abstract _enable: boolean;
10
- isOpen(): boolean;
11
- abstract destroy(): void;
12
- isSupported(): Promise<boolean>;
13
- monitor?: any;
14
- get _reportName(): string;
15
- }
16
- declare abstract class PreProcessingExtension extends ExtensionBase {
17
- type: RTCExtensionType;
18
- abstract effect(track: ITrack, processTrack: MediaStreamTrack): Promise<MediaStreamTrack>;
19
- abstract applyConstraints(streamIndex: StreamIndex, constraints: MediaTrackConstraints): void;
20
- }
21
- declare class IRTCBeautyExtension {
22
- constructor(options: IRTCBeautyExtensionConfig);
3
+ export declare class IRTCBeautyExtension {
4
+ constructor(options?: IRTCBeautyExtensionConfig);
23
5
 
24
6
  /**
25
7
  * @brief Check the compatibility of current browser.
@@ -107,74 +89,10 @@ declare class IRTCBeautyExtension {
107
89
  * @param type The priority of the facial recognition AI algorithm.
108
90
  */
109
91
  setAIModelType: (type: BackgroundAIModelType) => void;
110
- }
111
- declare class RTCBeautyExtension extends PreProcessingExtension implements IRTCBeautyExtension {
112
- name: string;
113
- protected _enable: boolean;
114
- static _loadingProcess?: Promise<void>;
115
- static _sdk?: ArSdk;
116
- static _sdkUrl: any;
117
- static _sdkSourceUrl: any;
118
- static _sdkHash?: string;
119
- static _sdkAuthServer?: string;
120
- static _authFileUrl?: string;
121
- private _beautyExt?;
122
- private _backgroundExt?;
123
- private _enableBeauty;
124
- private _enableBackground;
125
- private _fps;
126
- private _backgroundBackend;
127
- private _backgroundAIModelType;
128
- private _backgroundMode;
129
- private _beautyDefaultValue;
130
- private _preTrack;
131
- constructor(options?: IRTCBeautyExtensionConfig);
132
- static loadWebARSDK(): Promise<void>;
133
- initWebArSDK(): Promise<void>;
134
- init(engineParams: any): Promise<void>;
135
- checkCompatibility(): Promise<CompatibilityCheckResult>;
136
- effect(track: ITrack, processTrack?: MediaStreamTrack): Promise<MediaStreamTrack>;
137
- enable(): Promise<void>;
138
- enableBeauty(): Promise<void>;
139
- disable(): Promise<void>;
140
- disableBeauty(): Promise<void>;
141
- enableVirtualBackground(): Promise<void>;
142
- disableVirtualBackground(): Promise<void>;
143
- setBeautyIntensity(beautyMode: EffectBeautyMode, intensity: number): void;
144
- setBackgroundMode(mode: BackgroundMode): void;
145
- getBackgroundImage(): string;
146
- loadBackgroundImage(url: string): Promise<void>;
147
- setAIModelType(type: BackgroundAIModelType): void;
148
- applyConstraints(streamIndex: StreamIndex, constraints: MediaTrackConstraints): void;
149
- isSupported(): Promise<boolean>;
150
- isOpen(): boolean;
151
- destroy(): void;
152
- private _rtcSdkApiCall;
153
- }
154
- declare enum RTCExtensionType {
155
- CAPTURE = 0,
156
- PRE_PROCESSING = 1,
157
- ENCODE = 2,
158
- TRANSFER = 3,
159
- POST_PROCESSING = 4,
160
- DECODE = 5,
161
- RENDERING = 6
162
- }
163
- declare enum SourceType {
164
- EXTERNAL = 0,
165
- INTERNAL = 1
166
- }
167
- declare enum StreamIndex {
168
-
169
- /**
170
- * @brief A mainstream is a media stream either captured by the internal module or from the custom source.
171
- */
172
- STREAM_INDEX_MAIN = 0,
173
-
174
- /**
175
- * @brief Screen-sharing stream, including screen-sharing video streams and/ or audio streams from sound cards
176
- */
177
- STREAM_INDEX_SCREEN = 1
92
+ setBackgroundBlurRadius: (radius: number) => void;
93
+ setBackgroundColor: (color: string) => boolean;
94
+ loadBackgroundVideo: (url: string) => Promise<void>;
95
+ getBackgroundVideo: () => string;
178
96
  }
179
97
 
180
98
  /**
@@ -185,12 +103,12 @@ export declare enum BackgroundAIBackend {
185
103
  /**
186
104
  * @brief CPU mode.
187
105
  */
188
- CPU = -1,
106
+ CPU = "cpu",
189
107
 
190
108
  /**
191
109
  * @brief GPU mode. The SDK will check whether the current browser supports GPU mode, and will automatically fall back to CPU mode if GPU mode is not supported.
192
110
  */
193
- GPU = 1
111
+ GPU = "gpu"
194
112
  }
195
113
 
196
114
  /**
@@ -201,12 +119,12 @@ export declare enum BackgroundAIModelType {
201
119
  /**
202
120
  * @brief Performance mode.
203
121
  */
204
- PERFORMANCE = 0,
122
+ PERFORMANCE = "fast",
205
123
 
206
124
  /**
207
125
  * @brief Quality mode.
208
126
  */
209
- QUALITY = 1
127
+ QUALITY = "accurate"
210
128
  }
211
129
 
212
130
  /**
@@ -222,7 +140,9 @@ export declare enum BackgroundMode {
222
140
  /**
223
141
  * @brief Image background.
224
142
  */
225
- BACKGROUND_IMAGE = "image"
143
+ BACKGROUND_IMAGE = "image-url",
144
+ BACKGROUND_COLOR = "color",
145
+ BACKGROUND_VIDEO = "video-url"
226
146
  }
227
147
 
228
148
  /**
@@ -245,22 +165,6 @@ export declare enum EffectBeautyMode {
245
165
  */
246
166
  EFFECT_SHARPEN_MODE = 2
247
167
  }
248
- export interface ArSdk {
249
- canvas?: HTMLCanvasElement;
250
- video?: {
251
- start: () => Promise<void>;
252
- stop: () => Promise<void>;
253
- };
254
- extensions: any;
255
- setOptions: (options: any) => void;
256
- setDocumentTemplate: (template: any) => Promise<void>;
257
- initialize: (options: any) => Promise<void>;
258
- setStreamInput: (stream: MediaStream) => Promise<void>;
259
- startFrame: () => void;
260
- stopFrame: () => void;
261
- setCanvasSize: (width: number, height: number) => void;
262
- checkCompatibility: () => Promise<CompatibilityCheckResult>;
263
- }
264
168
 
265
169
  /**
266
170
  * @brief Compatibility check result.
@@ -326,16 +230,9 @@ export interface IRTCBeautyExtensionConfig {
326
230
  */
327
231
  aiModelType?: BackgroundAIModelType;
328
232
  }
329
- export interface ITrack {
330
- sourceType: SourceType;
331
- mediaType: "audio" | "video";
332
- mediaTrack: MediaStreamTrack;
333
- streamIndex: number;
334
- channelCount: number;
335
- }
336
233
 
337
234
  export {
338
- RTCBeautyExtension as default,
235
+ IRTCBeautyExtension as default,
339
236
  };
340
237
 
341
238
  export {};