zego-express-engine-electron-plugin-blend-image-private 1.2.8

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.
package/index.js ADDED
@@ -0,0 +1,537 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZegoExpressPluginBlendImageInstance = exports.ZegoExpressPluginScreenCaptureWindowStatus = exports.ZegoExpressPluginScreenCaptureWindowMode = exports.ZegoBlendImageViewMode = exports.ZegoExpressPluginCustomSourceLayer = exports.ZGCustomCaptureSourceType = exports.ZegoExpressPluginBlendImageLogLevel = void 0;
4
+ let os = require("os");
5
+ let ZegoBlendImageNodeArch = "";
6
+ if (os.platform() === "win32") {
7
+ ZegoBlendImageNodeArch = process.arch === 'x64' ? `./win/x64` : `./win/x86`;
8
+ }
9
+ else if (os.platform() === "darwin") {
10
+ ZegoBlendImageNodeArch = "./mac";
11
+ }
12
+ else {
13
+ throw ("Platform not supported");
14
+ }
15
+ /*content begin*/
16
+ const EventEmitter = require('events').EventEmitter;
17
+ const ZegoBlendImageNode = require(ZegoBlendImageNodeArch + "/ZegoBlendImageNode.node");
18
+ const PackageJson = require('./package.json');
19
+ const WebGLRender = require('./ZegoExpressWebgl');
20
+ /**
21
+ * ZegoExpressPluginBlendImageLogLevel
22
+ * @enum {number}
23
+ */
24
+ const ZegoExpressPluginBlendImageLogLevel = {
25
+ LogLevelGrievous: 0,
26
+ LogLevelError: 1,
27
+ LogLevelWarning: 2,
28
+ LogLevelGeneric: 3,
29
+ LogLevelDebug: 4,
30
+ };
31
+ exports.ZegoExpressPluginBlendImageLogLevel = ZegoExpressPluginBlendImageLogLevel;
32
+ const ZGCustomCaptureSourceType = {
33
+ IMAGE_TYPE: 0,
34
+ CAMERA_TYPE: 1,
35
+ VIDEO_FILE_TYPE: 2,
36
+ SCREEN_TYPE: 3,
37
+ IMAGE_GIF_TYPE: 4,
38
+ COMPLEX_TYPE: 5,
39
+ WINDOW_TYPE: 6,
40
+ CUSTOM_DATA_TYPE: 7,
41
+ };
42
+ exports.ZGCustomCaptureSourceType = ZGCustomCaptureSourceType;
43
+ /**
44
+ * ZegoExpressPluginCustomSourceLayer
45
+ * @enum {number}
46
+ */
47
+ const ZegoExpressPluginCustomSourceLayer = {
48
+ /**
49
+ * @description reverse all layer.
50
+ */
51
+ CustomSourceReverseLayer: 5,
52
+ /**
53
+ * @description let source keep toplayer.
54
+ */
55
+ CustomSourceTopLayer: 4,
56
+ /**
57
+ * @description let source move to uplayer.
58
+ */
59
+ CustomSourceUpLayer: 3,
60
+ /**
61
+ * @description let source move to downlayer.
62
+ */
63
+ CustomSourceDownLayer: 2,
64
+ /**
65
+ * @description let source keep bottomlayer.
66
+ */
67
+ CustomSourceBottomLayer: 1,
68
+ };
69
+ exports.ZegoExpressPluginCustomSourceLayer = ZegoExpressPluginCustomSourceLayer;
70
+ /**
71
+ * Video rendering fill mode.
72
+ * 视图填充模式
73
+ * @enum {number}
74
+ */
75
+ const ZegoBlendImageViewMode = {
76
+ /**
77
+ * @description The proportional scaling up, there may be black borders
78
+ * @description 等比缩放,可能有黑边
79
+ */
80
+ AspectFit: 0,
81
+ /**
82
+ * @description The proportional zoom fills the entire View and may be partially cut
83
+ * @description 等比缩放填充整View,可能有部分被裁减
84
+ */
85
+ AspectFill: 1,
86
+ /**
87
+ * @description Fill the entire view, the image may be stretched
88
+ * @description 填充整个View,会产生拉伸
89
+ */
90
+ ScaleToFill: 2,
91
+ };
92
+ exports.ZegoBlendImageViewMode = ZegoBlendImageViewMode;
93
+ /**
94
+ * ZegoExpressPluginScreenCaptureWindowMode
95
+ * @enum {number}
96
+ */
97
+ const ZegoExpressPluginScreenCaptureWindowMode = {
98
+ /**
99
+ * @description Capture the target window even when it's covered by other window.
100
+ */
101
+ ScreenCaptureWindowModeNormal: 1,
102
+ /**
103
+ * @description After the target window is covered, the covered area uses content of the upper window.
104
+ */
105
+ ScreenCaptureWindowModeUseUpper: 2,
106
+ /**
107
+ * @description Capture the whole screen of the window, compared with ScreenCaptureWindowModeNormal, there is no window switching process in this mode(only for windows).
108
+ */
109
+ ScreenCaptureWindowModeNormal2: 3,
110
+ };
111
+ exports.ZegoExpressPluginScreenCaptureWindowMode = ZegoExpressPluginScreenCaptureWindowMode;
112
+ const ZegoExpressPluginScreenCaptureWindowStatus = {
113
+ /**
114
+ * @description the target window has no change.
115
+ */
116
+ ScreenCaptureWindowStatusNoChange: 0,
117
+ /**
118
+ * @description the target window is destroyed.
119
+ */
120
+ ScreenCaptureWindowStatusDestroy: 1,
121
+ /**
122
+ * @description the target window is maximized.
123
+ */
124
+ ScreenCaptureWindowStatusMaximize: 2,
125
+ /**
126
+ * @description the target window is minimized.
127
+ */
128
+ ScreenCaptureWindowStatusMinimize: 3,
129
+ /**
130
+ * @description the target window is actived.
131
+ */
132
+ ScreenCaptureWindowStatusActive: 4,
133
+ /**
134
+ * @description the target window is deactived
135
+ */
136
+ ScreenCaptureWindowStatusDeactive: 5,
137
+ /**
138
+ * @description the target window is is showed
139
+ */
140
+ ScreenCaptureWindowStatusShow: 6,
141
+ /**
142
+ * @description the target window is hided
143
+ */
144
+ ScreenCaptureWindowStatusHide: 7,
145
+ /**
146
+ * @description the target window is movded
147
+ */
148
+ ScreenCaptureWindowStatusMove: 8,
149
+ /**
150
+ * @description the target window is covered
151
+ */
152
+ ScreenCaptureWindowStatusCover: 9,
153
+ /**
154
+ * @description the target window is uncovered
155
+ */
156
+ ScreenCaptureWindowStatusUnCover: 10,
157
+ };
158
+ exports.ZegoExpressPluginScreenCaptureWindowStatus = ZegoExpressPluginScreenCaptureWindowStatus;
159
+ ;
160
+ /**
161
+ * ZegoExpressPluginBlendImage
162
+ */
163
+ class ZegoExpressPluginBlendImage extends EventEmitter {
164
+ constructor() {
165
+ super();
166
+ this._addonInstance = new ZegoBlendImageNode.ZegoExpressBlendImageWrapper();
167
+ this.previewGLRenders = new Map();
168
+ this.previewBuffers = new Map();
169
+ }
170
+ /**
171
+ * register callback for the specific event.
172
+ */
173
+ on(event, callBack) {
174
+ return super.on(event, callBack);
175
+ }
176
+ /**
177
+ * unregister callback for the specific event.
178
+ */
179
+ off(event, callBack) {
180
+ return super.off(event, callBack);
181
+ }
182
+ /**
183
+ * Gets the SDK's version number.
184
+ *
185
+ * @return {string} - SDK version
186
+ */
187
+ getVersion() {
188
+ return PackageJson.version;
189
+ }
190
+ /**
191
+ * Init screen capture.
192
+ *
193
+ * @remarks
194
+ * call this function before you call any other function
195
+ */
196
+ init() {
197
+ let tsfn = this.callEmit.bind(this);
198
+ this._addonInstance.init({ tsfn });
199
+ }
200
+ /**
201
+ * Uninit screen capture.
202
+ */
203
+ uninit() {
204
+ this.removeAllListeners();
205
+ this._addonInstance.uninit({});
206
+ }
207
+ /**
208
+ * Get screen list.
209
+ *
210
+ * @return {Array<IZegoExpressPluginScreenCaptureScreenItem>} - the screen list
211
+ */
212
+ enumScreenList() {
213
+ return this._addonInstance.enumScreenList({});
214
+ }
215
+ /**
216
+ * Get screen thumbnail list.
217
+ *
218
+ * @return {Promise<Array<IZegoExpressPluginScreenCaptureScreenThumbnailItem>>} - the screen thumbnail list
219
+ */
220
+ enumScreenThumbnail() {
221
+ return this._addonInstance.enumScreenThumbnail({});
222
+ }
223
+ /**
224
+ * Get window list.
225
+ *
226
+ * @param {boolean} isIncludeIconic - include the iconic window or not
227
+ *
228
+ * @return {Array<IZegoExpressPluginScreenCaptureWindowItem>} - the window list
229
+ */
230
+ enumWindowList(isIncludeIconic = true) {
231
+ return this._addonInstance.enumWindowList({ isIncludeIconic });
232
+ }
233
+ /**
234
+ * Get window thumbnail list.
235
+ *
236
+ * @return {Promise<Array<IZegoExpressPluginScreenCaptureWindowThumbnailItem>>} - the window thumbnail list
237
+ */
238
+ enumWindowThumbnail() {
239
+ return this._addonInstance.enumWindowThumbnail({});
240
+ }
241
+ /**
242
+ * 检测窗口是否可以采集,若还未获取辅助功能权限,则调用该函数会申请辅助功能,Windows和Mac均可调用,只有Mac生效;
243
+ * @param {object} option - 参数对象
244
+ * @param {number} option.handle - 窗口句柄,目标窗口句柄,从接口enumWindowList 返回的对象数组列表中每项的handle字段
245
+ * @return {boolean} 是否可以采集该窗口
246
+ */
247
+ checkWindowSourceAuthorityPermission(handle) {
248
+ return this._addonInstance.checkWindowSourceAuthorityPermission({ handle });
249
+ }
250
+ /**
251
+ * 预览源数据,同一时间只允许预览一个源数据(变更源可以直接切换到其他源预览,不支持合图源),如果需要预览时不合图,可以调用setCustomCaptureSourceVisible
252
+ * @param {number} captureSrc
253
+ * @param {Object} canvas
254
+ * @param {number} viewMode
255
+ * @param {number} backgroundColor
256
+ */
257
+ startPreviewSource(captureSrc, canvas, viewMode, backgroundColor) {
258
+ let handle = this._addonInstance.startPreviewSource({ captureSrc });
259
+ if (handle >= 0) {
260
+ this.previewGLRenders[handle] = new WebGLRender();
261
+ this.previewGLRenders[handle].setViewMode(viewMode);
262
+ this.previewGLRenders[handle].enablePreserveDrawingBuffer(false);
263
+ this.previewGLRenders[handle].initBkColor(backgroundColor);
264
+ this.previewGLRenders[handle].initGLfromCanvas(canvas);
265
+ this.flipMode = 0;
266
+ }
267
+ }
268
+ /**
269
+ *
270
+ */
271
+ stopPreviewSource(captureSrc) {
272
+ let handle = this._addonInstance.stopPreviewSource({ captureSrc });
273
+ if (handle >= 0) {
274
+ if (this.previewGLRenders[handle] != null) {
275
+ this.previewGLRenders[handle].uninit2d();
276
+ this.previewGLRenders[handle] = null;
277
+ }
278
+ }
279
+ }
280
+ /**
281
+ * 创建自定义采集源,在初始化sdk成功之后调用
282
+ * @param {object} option - 参数对象
283
+ * @param {number} option.captureType - 自定义采集源的类型,支持自定义图片、摄像头(来自express插件)、视频文件(来自express插件)、屏幕分享,查看定义 <a href="./ZegoConstant.js.html" target="_blank">ZEGOCONSTANTS.ZGCustomCaptureSourceType</a>
284
+ * @param {number} option.dataPlugin - 摄像头、视频文件需要使用express的插件
285
+ * @return {number} -1 - 失败, 结果大于0 返回自定义采集源句柄
286
+ */
287
+ createCustomCaptureSource(captureType, dataPlugin = 0) {
288
+ return this._addonInstance.createCustomCaptureSource({ captureType, dataPlugin });
289
+ }
290
+ /**
291
+ * 设置窗口采集源的参数
292
+ * @param {object} option - 参数对象
293
+ * @param {number} option.captureSrc - 窗口采集源,填写通过createCustomCaptureSource接口创建返回的窗口采集源
294
+ * @param {boolean} option.activateWindowWhenCapturing - 在目标窗口模式下,初次选择窗口时,设置是否激活窗口,true - 激活窗口,false - 不激活窗口 (仅windows有效)
295
+ * @param {number} option.targetWindow - 设置采集目标窗口句柄,从接口enumWindowList 返回的对象数组列表中每项的handle字段
296
+ * @param {number} option.fps - 设置采集的帧率
297
+ * @param {number} option.targetWindowMode 1 - 窗口截屏,带窗口标题栏, 2 - 窗口客户区截屏,不带窗口标题栏,3 - 截取窗口对应屏幕区域 (窗口被覆盖后继续捕获对应区域). 4 - 截取窗口对应屏幕区域(窗口被覆盖后继续捕获,覆盖区域涂黑. 5 -截取窗口对应屏幕区域(窗口被覆盖后继续捕获,过滤上层覆盖的窗口,win8及以后系统生效)
298
+ *
299
+ */
300
+ setWindowCaptureSourceParam(captureSrc, activateWindowWhenCapturing = true, targetWindow = 0, fps = 10, targetWindowMode = 5) {
301
+ return this._addonInstance.setWindowCaptureSourceParam({ captureSrc, activateWindowWhenCapturing, targetWindow, fps, targetWindowMode });
302
+ }
303
+ /**
304
+ *
305
+ * @param captureSrc 自定义采集源对象
306
+ * @param dataPlugin 外部实现的采集源插件指针,需要继承实现即构的ZegoCustomVideoCapturePluginBase
307
+ * @returns
308
+ */
309
+ setCustomDataSourceParam(captureSrc, dataPlugin) {
310
+ return this._addonInstance.setCustomDataSourceParam({ captureSrc, dataPlugin });
311
+ }
312
+ /**
313
+ *
314
+ * @param captureSrc 摄像头源对象
315
+ * @param effectPlugin 外部实现的美颜插件指针,使用前咨询请使用方式
316
+ * @returns
317
+ */
318
+ setCameraCaptureSourceParam(captureSrc, effectPlugin) {
319
+ return this._addonInstance.setCameraCaptureSourceParam({ captureSrc, effectPlugin });
320
+ }
321
+ /**
322
+ * 配置图像源参数,可用于切换图片,更新图片路径即可
323
+ * @param {object} option - 参数对象
324
+ * @param {number} option.captureSrc - 采集源,填写通过createCustomCaptureSource接口创建返回的图像源
325
+ * @param {string} option.imagePath - 图像路径,图像支持bmp图像 todo
326
+ * @return {boolean} true - 成功, false - 失败,输入的源无效
327
+ */
328
+ setImageCaptureSourceParam(captureSrc, imagePath) {
329
+ return this._addonInstance.setImageCaptureSourceParam({ captureSrc, imagePath });
330
+ }
331
+ /**
332
+ * 配置GIF图像源参数,可用于切换GIF图片,更新图片路径即可
333
+ * @param {object} option - 参数对象
334
+ * @param {number} option.captureSrc - 采集源,填写通过createCustomCaptureSource接口创建返回的图像源
335
+ * @param {string} option.imagePath - GIF图像路径,图像支持GIF图像
336
+ * @return {boolean} true - 成功, false - 失败,输入的源无效
337
+ */
338
+ setImageGifCaptureSourceParam(captureSrc, imagePath) {
339
+ return this._addonInstance.setImageGifCaptureSourceParam({ captureSrc, imagePath });
340
+ }
341
+ /**
342
+ * 设置屏幕分享源的参数
343
+ * @param {object} option - 参数对象
344
+ * @param {number} option.captureSrc - 屏幕采集源,填写通过createCustomCaptureSource接口创建返回的屏幕采集源
345
+ * @param {string} option.targetScreen - 设置采集目标屏幕名,从接口enumScreenList 返回的对象数组列表中每项的screen_name字段
346
+ * @param {number} option.fps - 设置采集的帧率
347
+ * @param {boolean} option.fullScreen -设置采集主屏幕全屏,true - 采集全屏
348
+ * @param {boolean} option.virtualFullScreen - 设置采集虚拟桌面全屏,true - 采集虚拟全屏。在full_screen为false时有效
349
+ * @param {boolean} option.cursorVisible - 是否显示光标,true - 显示,false - 不显示
350
+ * @param {boolean} option.clickAnimation - 是否显示鼠标点击动画,true - 显示鼠标点击动画, false - 不显示鼠标点击动画
351
+ * @param {number} option.targetRectLeft - 设置采集目标区域,单位为像素,支持高DPI,目标区域左上角横坐标
352
+ * @param {number} option.targetRectTop - 目标区域左上角纵坐标
353
+ * @param {number} option.targetRectWidth - 目标区域宽
354
+ * @param {number} option.targetRectHeight - 目标区域高
355
+ *
356
+ */
357
+ setScreenCaptureSourceParam(captureSrc, targetScreen = "", fps = 10, fullScreen = true, virtualFullScreen = false, cursorVisible = true, clickAnimation = true, targetRectLeft = 0, targetRectTop = 0, targetRectWidth = 0, targetRectHeight = 0) {
358
+ return this._addonInstance.setScreenCaptureSourceParam({ captureSrc,
359
+ targetScreen,
360
+ fps,
361
+ fullScreen,
362
+ virtualFullScreen,
363
+ cursorVisible,
364
+ clickAnimation,
365
+ targetRectLeft,
366
+ targetRectTop,
367
+ targetRectWidth,
368
+ targetRectHeight });
369
+ }
370
+ /**
371
+ * 设置组合源输出大小
372
+ * @param {object} option - 参数对象
373
+ * @param {number} option.combinedSourceID - 组合源
374
+ * @param {number} option.width - 组合源输出的宽
375
+ * @param {number} option.height - 组合源输出的高
376
+ * @param {number} option.fps - 组合源输出的帧率
377
+ * @return {boolean} true - 成功, false - 失败
378
+ */
379
+ setCombinedSourceParam(combinedSourceID, width, height, fps) {
380
+ return this._addonInstance.setCombinedSourceParam({ combinedSourceID, width, height, fps });
381
+ }
382
+ /**
383
+ * 设置组合源的背景色
384
+ * @param {object} option - 参数对象
385
+ * @param {number} option.combinedSourceID - 混合源的id
386
+ * @param {number} option.rgba - 混合源的背景色0x FF(R) 00(G) 00(B) FF(A),背景支持Alpha通道,需要配合Express Electron接口进行传输设置(无特殊需要不要配置alpha通道),默认0x000000FF(黑色)
387
+ * @return {boolean} true - 成功, false - 失败
388
+ */
389
+ setCombinedBackgroundColor(combinedSourceID, rgba) {
390
+ return this._addonInstance.setCombinedBackgroundColor({ combinedSourceID, rgba });
391
+ }
392
+ /**
393
+ * 向组合源添加采集源
394
+ * @param {object} option - 参数对象
395
+ * @param {number} option.combinedSourceID - 组合源的id
396
+ * @param {number} option.customCaptureSourceID - 采集源对象
397
+ * @return {boolean} true - 成功, false - 失败
398
+ */
399
+ addCustomCaptureSource(combinedSourceID, customCaptureSourceID) {
400
+ return this._addonInstance.addCustomCaptureSource({ combinedSourceID, customCaptureSourceID });
401
+ }
402
+ /**
403
+ * 删除组合源中的采集源
404
+ * @param {object} option - 参数对象
405
+ * @param {number} option.combinedSourceID - 组合源的id
406
+ * @param {number} option.customCaptureSourceID - 采集源对象id
407
+ * @return {boolean} true - 成功, false - 失败
408
+ */
409
+ delCustomCaptureSource(combinedSourceID, customCaptureSourceID) {
410
+ return this._addonInstance.delCustomCaptureSource({ combinedSourceID, customCaptureSourceID });
411
+ }
412
+ /**
413
+ * 设置组合源中指定采集源的平面Z轴顺序
414
+ * @param {object} option - 参数对象
415
+ * @param {number} option.combinedSourceID - 组合源的id
416
+ * @param {number} option.customCaptureSourceID - 采集源对象id
417
+ * @param {number} option.zOrder - 采集源的平面Z轴顺序,请填写ZegoExpressPluginCustomSourceLayer类型,
418
+ * 如果该参数为CustomSourceReverseLayer,则不会判断customCaptureSourceID参数
419
+ * @param {number} option.zOrderNum - 采集源的平面Z轴顺序为CustomSourceUpLayer或CustomSourceDownLayer类型时移动的层数,默认为1
420
+ * @return {boolean} true - 成功, false - 失败
421
+ */
422
+ setCustomCaptureSourceZOrder(combinedSourceID, customCaptureSourceID, zOrder, zOrderNum = 1) {
423
+ return this._addonInstance.setCustomCaptureSourceZOrder({ combinedSourceID, customCaptureSourceID, zOrder, zOrderNum });
424
+ }
425
+ /**
426
+ * 设置组合源中指定采集源是否可见
427
+ * @param {object} option - 参数对象
428
+ * @param {number} option.combinedSourceID - 组合源的id
429
+ * @param {number} option.customCaptureSourceID - 采集源的id
430
+ * @param {boolean} option.visible - 混合源是否可见 todo
431
+ * @return {boolean} true - 成功, false - 失败
432
+ */
433
+ setCustomCaptureSourceVisible(combinedSourceID, customCaptureSourceID, visible) {
434
+ return this._addonInstance.setCustomCaptureSourceVisible({ combinedSourceID, customCaptureSourceID, visible });
435
+ }
436
+ /**
437
+ * 设置组合源中指定采集源的布局
438
+ * @param {object} option - 参数对象
439
+ * @param {number} option.combinedSourceID - 组合源的id
440
+ * @param {number} option.customCaptureSourceID - 采集源的id
441
+ * @param {number} option.x - 采集源相对于画布左上角的x
442
+ * @param {number} option.y - 采集源相对于画布左上角的y
443
+ * @param {number} option.w - 采集源的宽
444
+ * @param {number} option.h - 采集源的高
445
+ * @param {number} option.viewMode - 见ZegoBlendImageViewMode
446
+ * @return {boolean} true - 成功, false - 失败
447
+ */
448
+ setCustomCaptureSourceLayout(combinedSourceID, customCaptureSourceID, x, y, w, h, viewMode = 2) {
449
+ return this._addonInstance.setCustomCaptureSourceLayout({ combinedSourceID, customCaptureSourceID, x, y, w, h, viewMode });
450
+ }
451
+ /**
452
+ * 翻转自定义采集源
453
+ * @param {object} option - 参数对象
454
+ * @param {number} option.captureSrc - 采集源,填写通过createCustomCaptureSource接口创建返回的采集源
455
+ * @param {number} option.enableFlipX - 水平方向是否翻转
456
+ * @param {number} option.enableFlipY - 垂直方向是否翻转
457
+ * @return {boolean} true - 成功, false - 失败,输入的源无效
458
+ */
459
+ flipCustomCaptureSource(captureSrc, enableFlipX, enableFlipY) {
460
+ return this._addonInstance.flipCustomCaptureSource({ captureSrc, enableFlipX, enableFlipY });
461
+ }
462
+ /**
463
+ * 旋转自定义采集源
464
+ * @param {object} option - 参数对象
465
+ * @param {number} option.captureSrc - 采集源,填写通过createCustomCaptureSource接口创建返回的采集源
466
+ * @param {number} option.rotationMode- 旋转模式,支持 0-不旋转,90-顺时针旋转90度,180-旋转180度, 270-旋转270度,-90-逆时针旋转90度,等同于旋转270度
467
+ * @return {boolean} true - 成功, false - 失败,输入的源无效,或者不支持的角度
468
+ */
469
+ rotationCustomCaptureSource(captureSrc, rotationMode) {
470
+ return this._addonInstance.rotationCustomCaptureSource({ captureSrc, rotationMode });
471
+ }
472
+ /**
473
+ * 裁剪采集源
474
+ * @param captureSrc - 采集源,填写通过createCustomCaptureSource接口创建返回的采集源
475
+ * @param cropX - 裁剪的x轴起点
476
+ * @param cropY - 裁剪的y轴起点
477
+ * @param cropWidth - 裁剪的宽度
478
+ * @param cropHeight - 裁剪的高度
479
+ * @returns
480
+ */
481
+ cropCustomCaptureSource(captureSrc, cropX, cropY, cropWidth, cropHeight) {
482
+ return this._addonInstance.cropCustomCaptureSource({ captureSrc, cropX, cropY, cropWidth, cropHeight });
483
+ }
484
+ /**
485
+ * Get the capture Plugin.todo
486
+ *
487
+ * @return {number}
488
+ */
489
+ getExpressCustomVideoCapturePlugin() {
490
+ return this._addonInstance.getCustomVideoCapturePlugin({});
491
+ }
492
+ callEmit() {
493
+ try {
494
+ if (arguments[0] === "onDebugInfo") {
495
+ console.info(arguments[1]["info"]);
496
+ }
497
+ else if (arguments[0] === "onDebugError") {
498
+ console.error(`onDebugError: funcName=${arguments[1]["funcName"]} ErrorCode=${arguments[1]["errorCode"]} ErrorInfo=${arguments[1]["errorInfo"]}`);
499
+ }
500
+ else if (arguments[0] === "onPreviewSourceSizeChanged") {
501
+ let handle = arguments[1]['handle'];
502
+ let width = arguments[1]['width'];
503
+ let height = arguments[1]['height'];
504
+ this.previewBuffers[handle] = Buffer.allocUnsafe((width * height) << 2);
505
+ this._addonInstance.resetPreviewBufferAddress({ handle, bufferAddress: this.previewBuffers[handle], width, height });
506
+ }
507
+ else if (arguments[0] === "onPreviewSourceData") {
508
+ let handle = arguments[1]['handle'];
509
+ let videoFrame = {
510
+ videoFrameParam: { width: arguments[1]['width'], height: arguments[1]['height'], flipMode: this.flipMode },
511
+ videoFrameBuffer: this.previewBuffers[handle],
512
+ };
513
+ if (this.previewGLRenders[handle] != null) {
514
+ this.previewGLRenders[handle].drawVideoFrame(videoFrame);
515
+ }
516
+ }
517
+ else {
518
+ const highFrequencyCallbacks = ["onDebugError", "onScreenCaptureWindowStatusChanged"];
519
+ if (!highFrequencyCallbacks.includes(arguments[0])) {
520
+ console.log(arguments[0], arguments[1]);
521
+ }
522
+ }
523
+ //@ts-ignore
524
+ }
525
+ catch (error) {
526
+ }
527
+ try {
528
+ this.emit(arguments[0], arguments[1]);
529
+ }
530
+ catch (error) {
531
+ console.log(`error catched in your callback ${arguments[0]} : ${error}`);
532
+ }
533
+ }
534
+ }
535
+ const ZegoExpressPluginBlendImageInstance = new ZegoExpressPluginBlendImage();
536
+ exports.ZegoExpressPluginBlendImageInstance = ZegoExpressPluginBlendImageInstance;
537
+ /*content end*/
Binary file
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>English</string>
7
+ <key>CFBundleIdentifier</key>
8
+ <string>com.apple.xcode.dsym.ZegoBlendImageNode.node</string>
9
+ <key>CFBundleInfoDictionaryVersion</key>
10
+ <string>6.0</string>
11
+ <key>CFBundlePackageType</key>
12
+ <string>dSYM</string>
13
+ <key>CFBundleSignature</key>
14
+ <string>????</string>
15
+ <key>CFBundleShortVersionString</key>
16
+ <string>1.0</string>
17
+ <key>CFBundleVersion</key>
18
+ <string>1</string>
19
+ </dict>
20
+ </plist>
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "zego-express-engine-electron-plugin-blend-image-private",
3
+ "version": "1.2.8",
4
+ "main": "index.js",
5
+ "types": "index.d.ts",
6
+ "author": "zego.im",
7
+ "description": "zego-express-engine-electron-plugin-blend-image",
8
+ "keywords": [
9
+ "zego",
10
+ "express",
11
+ "electron",
12
+ "plugin",
13
+ "blend-image"
14
+ ],
15
+ "license": "ISC",
16
+ "dependencies": {
17
+ "tsc": "^2.0.4",
18
+ "typescript": "^5.2.2"
19
+ }
20
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file