trtc-electron-sdk 9.3.301 → 9.4.105-beta.2

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.
@@ -74,7 +74,6 @@ class Renderer {
74
74
  this.yuv = null;
75
75
  this.element = null;
76
76
  this.canvas = null;
77
- this.view = null;
78
77
  }
79
78
  refreshCanvas() {
80
79
  }
@@ -109,11 +108,49 @@ class Renderer {
109
108
  this.canvas.style.transform = 'rotateY(180deg)';
110
109
  }
111
110
  }
111
+ _adjustImageData(imageData) {
112
+ const { width, height, yUint8Array, uUint8Array, vUint8Array } = imageData;
113
+ const widthBase = 8;
114
+ const w8Modulo = width % widthBase;
115
+ if (w8Modulo !== 0) {
116
+ const newWidth = width - w8Modulo;
117
+ const newYSize = newWidth * height;
118
+ const newYArrayBuffer = new ArrayBuffer(newYSize);
119
+ const newYUint8Array = new Uint8Array(newYArrayBuffer);
120
+ let oldIndex = -1, newIndex = -1;
121
+ for (let h = 0; h < height; h += 1) {
122
+ for (let w = 0; w < newWidth; w += 1) {
123
+ oldIndex = width * h + w;
124
+ newIndex = newWidth * h + w;
125
+ newYUint8Array[newIndex] = yUint8Array[oldIndex];
126
+ }
127
+ }
128
+ const oldChromaWidth = width / 2;
129
+ const newChromaWidth = newWidth / 2;
130
+ const chromaHeight = height / 2;
131
+ const newChromaSize = newChromaWidth * chromaHeight;
132
+ const newUArrayBuffer = new ArrayBuffer(newChromaSize);
133
+ const newUInt8Array = new Uint8Array(newUArrayBuffer);
134
+ const newVArrayBuffer = new ArrayBuffer(newChromaSize);
135
+ const newVInt8Array = new Uint8Array(newVArrayBuffer);
136
+ for (let h = 0; h < chromaHeight; h += 1) {
137
+ for (let w = 0; w < newChromaWidth; w += 1) {
138
+ oldIndex = oldChromaWidth * h + w;
139
+ newIndex = newChromaWidth * h + w;
140
+ newUInt8Array[newIndex] = uUint8Array[oldIndex];
141
+ newVInt8Array[newIndex] = vUint8Array[oldIndex];
142
+ }
143
+ }
144
+ return Object.assign(Object.assign({}, imageData), { width: newWidth, height, yUint8Array: newYUint8Array, uUint8Array: newUInt8Array, vUint8Array: newVInt8Array });
145
+ }
146
+ return imageData;
147
+ }
112
148
  drawFrame(imageData) {
113
149
  if (!this.ready) {
114
150
  this.ready = true;
115
151
  this.event.emit('ready');
116
152
  }
153
+ imageData = this._adjustImageData(imageData);
117
154
  const mirror = 0;
118
155
  const contentWidth = imageData.width;
119
156
  const contentHeight = imageData.height;
package/liteav/trtc.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { EventEmitter } from 'events';
3
- import { AudioMusicParam, Rect, TRTCAppScene, TRTCAudioEffectParam, TRTCAudioQuality, TRTCBeautyStyle, TRTCDeviceState, TRTCDeviceType, TRTCLogLevel, TRTCRenderParams, TRTCRoleType, TRTCSwitchRoomParam, TRTCVideoBufferType, TRTCVideoFillMode, TRTCVideoFrame, TRTCVideoPixelFormat, TRTCVideoRotation, TRTCVideoStreamType, TRTCWaterMarkSrcType, PluginInfo } from './trtc_define';
3
+ import { AudioMusicParam, Rect, TRTCAppScene, TRTCAudioEffectParam, TRTCAudioQuality, TRTCBeautyStyle, TRTCDeviceState, TRTCDeviceType, TRTCLogLevel, TRTCRenderParams, TRTCRoleType, TRTCSwitchRoomParam, TRTCVideoBufferType, TRTCVideoFillMode, TRTCVideoFrame, TRTCVideoPixelFormat, TRTCVideoRotation, TRTCVideoStreamType, TRTCWaterMarkSrcType, PluginInfo, TRTCCameraCaptureMode } from './trtc_define';
4
4
  export * from './trtc_define';
5
5
  export * from './trtc_code';
6
6
  /**
@@ -39,7 +39,6 @@ declare class TRTCCloud extends EventEmitter {
39
39
  private audioQuality;
40
40
  private bgmId;
41
41
  private playAudioEffectIdList;
42
- private enableRenderFrame;
43
42
  constructor();
44
43
  /**
45
44
  * 创建 TRTCCloud 对象单例
@@ -794,6 +793,8 @@ declare class TRTCCloud extends EventEmitter {
794
793
  *
795
794
  * 参考文档:[云端混流转码](https://cloud.tencent.com/document/product/647/16827)。
796
795
  *
796
+ * 注意:混流转码为收费功能,调用接口将产生云端混流转码费用,详见 [云端混流转码计费说明](https://cloud.tencent.com/document/product/647/49446)。
797
+ *
797
798
  * @note 关于云端混流的注意事项:
798
799
  * - 云端转码会引入一定的 CDN 观看延时,大概会增加1 - 2秒。
799
800
  * - 调用该函数的用户,会将连麦中的多路画面混合到自己当前这路画面中。
@@ -1061,6 +1062,19 @@ declare class TRTCCloud extends EventEmitter {
1061
1062
  * - TRTCVideoStreamTypeSmall: 小画面视频流
1062
1063
  */
1063
1064
  setPriorRemoteVideoStreamType(type: TRTCVideoStreamType): void;
1065
+ /**
1066
+ * 3.24 设置摄像头采集偏好
1067
+ *
1068
+ * @param options {Object} - 参数
1069
+ * @param options.mode {TRTCCameraCaptureMode} - 采集偏好模式
1070
+ * @param options.width {number}- 宽度
1071
+ * @param options.height {number} - 高度
1072
+ */
1073
+ setCameraCapturerParam(options: {
1074
+ mode: TRTCCameraCaptureMode;
1075
+ width: number;
1076
+ height: number;
1077
+ }): void;
1064
1078
  /**
1065
1079
  * 4.1 开启本地音频的采集和上行
1066
1080
  *
@@ -1445,7 +1459,7 @@ declare class TRTCCloud extends EventEmitter {
1445
1459
  */
1446
1460
  selectScreenCaptureTarget(type: number, sourceId: string, sourcename: string, captureRect: Rect, captureMouse: boolean, highlightWindow: boolean): any;
1447
1461
  /**
1448
- * 8.7 启动屏幕分享,支持选择使用主路或辅路进行屏幕分享。(暂不支持 mac 平台预览界面)
1462
+ * 8.7 启动屏幕分享,支持选择使用主路或辅路进行屏幕分享。
1449
1463
  *
1450
1464
  * 注意:
1451
1465
  * 一个用户同时最多只能上传一条主路(TRTCVideoStreamTypeBig)画面和一条辅路(TRTCVideoStreamTypeSub)画面,
@@ -1517,6 +1531,28 @@ declare class TRTCCloud extends EventEmitter {
1517
1531
  * @note 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeScreen 时生效,即分享屏幕时生效
1518
1532
  */
1519
1533
  removeAllExcludedShareWindow(): void;
1534
+ /**
1535
+ * 8.16 将指定窗口加入屏幕分享的包含列表中(该接口仅支持桌面系统)
1536
+ *
1537
+ * @param {String} win - 希望被分享出去的窗口(Windows 平台下为窗口句柄: HWND)
1538
+ * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
1539
+ * - 您在 startScreenCapture 之前和之后调用均可。
1540
+ * - 通过该方法添加到包含列表中的窗口,会在退出房间后被 SDK 自动清除。
1541
+ */
1542
+ addIncludedShareWindow(win: string): void;
1543
+ /**
1544
+ * 8.17 将指定窗口从屏幕分享的包含列表中移除(该接口仅支持桌面系统)
1545
+ *
1546
+ * @param {String} win - 希望被分享出去的窗口(Mac 平台: 窗口 ID;Windows 平台: HWND)
1547
+ * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
1548
+ */
1549
+ removeIncludedShareWindow(win: string): void;
1550
+ /**
1551
+ * 8.18 将全部窗口从屏幕分享的包含列表中移除(该接口仅支持桌面系统)
1552
+ *
1553
+ * @note 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
1554
+ */
1555
+ removeAllIncludedShareWindow(): void;
1520
1556
  /**
1521
1557
  * @private
1522
1558
  * 9.5 设置本地视频自定义渲染(Electron 平台下不可用)
@@ -1840,7 +1876,7 @@ declare class TRTCCloud extends EventEmitter {
1840
1876
  * 测速结果将会用于优化 SDK 接下来的服务器选择策略,因此推荐您在用户首次通话前先进行一次测速,这将有助于我们选择最佳的服务器。
1841
1877
  * 同时,如果测试结果非常不理想,您可以通过醒目的 UI 提示用户选择更好的网络。
1842
1878
  *
1843
- * 注意:测速本身会消耗一定的流量,所以也会产生少量额外的流量费用。
1879
+ * 注意:测速过程将产生少量的基础服务费用,详见 [计费概述 > 基础服务](https://cloud.tencent.com/document/product/647/17157#.E5.9F.BA.E7.A1.80.E6.9C.8D.E5.8A.A1) 文档说明。
1844
1880
  *
1845
1881
  * @param {Number} sdkAppId - 应用标识
1846
1882
  * @param {String} userId - 用户标识
@@ -1976,9 +2012,7 @@ declare class TRTCCloud extends EventEmitter {
1976
2012
  removePlugin(id: string): void;
1977
2013
  getPluginList(): PluginInfo[];
1978
2014
  createPlugin(pluginId: string): PluginInfo;
1979
- setPluginCallback(pluginCb: (pluginId: string, errorCode: number, msg: string) => void): void;
1980
2015
  getKey(uid: string, type: TRTCVideoStreamType): string;
1981
- setEnableRenderFrame(enable: boolean): void;
1982
2016
  /**
1983
2017
  * 判断是否支持webGL
1984
2018
  * @returns {boolean}
package/liteav/trtc.js CHANGED
@@ -120,7 +120,6 @@ class TRTCCloud extends events_1.EventEmitter {
120
120
  // 生成一个足够大, 不会与用户输入重复的 id
121
121
  this.bgmId = 1 << 29;
122
122
  this.playAudioEffectIdList = [];
123
- this.enableRenderFrame = true;
124
123
  this.initEventHandler();
125
124
  console.log('constructor render:' + this.renderMode + '|sdk version:' + pkg.version +
126
125
  '|native sdk version:' + this.rtcCloud.getSDKVersion());
@@ -1340,6 +1339,8 @@ class TRTCCloud extends events_1.EventEmitter {
1340
1339
  *
1341
1340
  * 参考文档:[云端混流转码](https://cloud.tencent.com/document/product/647/16827)。
1342
1341
  *
1342
+ * 注意:混流转码为收费功能,调用接口将产生云端混流转码费用,详见 [云端混流转码计费说明](https://cloud.tencent.com/document/product/647/49446)。
1343
+ *
1343
1344
  * @note 关于云端混流的注意事项:
1344
1345
  * - 云端转码会引入一定的 CDN 观看延时,大概会增加1 - 2秒。
1345
1346
  * - 调用该函数的用户,会将连麦中的多路画面混合到自己当前这路画面中。
@@ -1802,6 +1803,22 @@ class TRTCCloud extends events_1.EventEmitter {
1802
1803
  setPriorRemoteVideoStreamType(type) {
1803
1804
  this.priorRemoteVideoStreamType = type;
1804
1805
  }
1806
+ /**
1807
+ * 3.24 设置摄像头采集偏好
1808
+ *
1809
+ * @param options {Object} - 参数
1810
+ * @param options.mode {TRTCCameraCaptureMode} - 采集偏好模式
1811
+ * @param options.width {number}- 宽度
1812
+ * @param options.height {number} - 高度
1813
+ */
1814
+ setCameraCapturerParam(options) {
1815
+ if (options.mode !== undefined && options.width !== undefined && options.height !== undefined) {
1816
+ this.rtcCloud.setCameraCapturerParam(options);
1817
+ }
1818
+ else {
1819
+ console.error('call setCameraCapturerParam() with wrong parameter.');
1820
+ }
1821
+ }
1805
1822
  /////////////////////////////////////////////////////////////////////////////////
1806
1823
  //
1807
1824
  // (四)音频相关接口函数
@@ -2313,7 +2330,7 @@ class TRTCCloud extends events_1.EventEmitter {
2313
2330
  }
2314
2331
  }
2315
2332
  /**
2316
- * 8.7 启动屏幕分享,支持选择使用主路或辅路进行屏幕分享。(暂不支持 mac 平台预览界面)
2333
+ * 8.7 启动屏幕分享,支持选择使用主路或辅路进行屏幕分享。
2317
2334
  *
2318
2335
  * 注意:
2319
2336
  * 一个用户同时最多只能上传一条主路(TRTCVideoStreamTypeBig)画面和一条辅路(TRTCVideoStreamTypeSub)画面,
@@ -2429,6 +2446,34 @@ class TRTCCloud extends events_1.EventEmitter {
2429
2446
  removeAllExcludedShareWindow() {
2430
2447
  this.rtcCloud.removeAllExcludedShareWindow();
2431
2448
  }
2449
+ /**
2450
+ * 8.16 将指定窗口加入屏幕分享的包含列表中(该接口仅支持桌面系统)
2451
+ *
2452
+ * @param {String} win - 希望被分享出去的窗口(Windows 平台下为窗口句柄: HWND)
2453
+ * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
2454
+ * - 您在 startScreenCapture 之前和之后调用均可。
2455
+ * - 通过该方法添加到包含列表中的窗口,会在退出房间后被 SDK 自动清除。
2456
+ */
2457
+ addIncludedShareWindow(win) {
2458
+ this.rtcCloud.addIncludedShareWindow(win);
2459
+ }
2460
+ /**
2461
+ * 8.17 将指定窗口从屏幕分享的包含列表中移除(该接口仅支持桌面系统)
2462
+ *
2463
+ * @param {String} win - 希望被分享出去的窗口(Mac 平台: 窗口 ID;Windows 平台: HWND)
2464
+ * - 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
2465
+ */
2466
+ removeIncludedShareWindow(win) {
2467
+ this.rtcCloud.removeIncludedShareWindow(win);
2468
+ }
2469
+ /**
2470
+ * 8.18 将全部窗口从屏幕分享的包含列表中移除(该接口仅支持桌面系统)
2471
+ *
2472
+ * @note 该方法只有在 TRTCScreenCaptureSourceInfo 中的 type 指定为 TRTCScreenCaptureSourceTypeWindow 时生效,即分享窗口内容时,额外包含指定窗口的功能才生效。
2473
+ */
2474
+ removeAllIncludedShareWindow() {
2475
+ this.rtcCloud.removeAllIncludedShareWindow();
2476
+ }
2432
2477
  /////////////////////////////////////////////////////////////////////////////////
2433
2478
  //
2434
2479
  // (九)自定义采集和渲染
@@ -2914,7 +2959,7 @@ class TRTCCloud extends events_1.EventEmitter {
2914
2959
  * 测速结果将会用于优化 SDK 接下来的服务器选择策略,因此推荐您在用户首次通话前先进行一次测速,这将有助于我们选择最佳的服务器。
2915
2960
  * 同时,如果测试结果非常不理想,您可以通过醒目的 UI 提示用户选择更好的网络。
2916
2961
  *
2917
- * 注意:测速本身会消耗一定的流量,所以也会产生少量额外的流量费用。
2962
+ * 注意:测速过程将产生少量的基础服务费用,详见 [计费概述 > 基础服务](https://cloud.tencent.com/document/product/647/17157#.E5.9F.BA.E7.A1.80.E6.9C.8D.E5.8A.A1) 文档说明。
2918
2963
  *
2919
2964
  * @param {Number} sdkAppId - 应用标识
2920
2965
  * @param {String} userId - 用户标识
@@ -3103,9 +3148,7 @@ class TRTCCloud extends events_1.EventEmitter {
3103
3148
  this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
3104
3149
  }
3105
3150
  this.rtcCloud.addLocalVideoRenderCallback((id, type, width, height, timestamp, rotation, data) => {
3106
- if (this.enableRenderFrame) {
3107
- this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
3108
- }
3151
+ this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
3109
3152
  }, this.pixelformate);
3110
3153
  }
3111
3154
  addRemoteVideoRenderCallback(userid) {
@@ -3116,9 +3159,7 @@ class TRTCCloud extends events_1.EventEmitter {
3116
3159
  this.pixelformate = trtc_define_1.TRTCVideoPixelFormat.TRTCVideoPixelFormat_I420;
3117
3160
  }
3118
3161
  this.rtcCloud.addRemoteVideoRenderCallback(userid, (id, type, width, height, timestamp, rotation, data) => {
3119
- if (this.enableRenderFrame) {
3120
- this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
3121
- }
3162
+ this._onRenderFrame(id, type, width, height, timestamp, rotation, data);
3122
3163
  }, this.pixelformate);
3123
3164
  }
3124
3165
  //----------------------------------//
@@ -3177,22 +3218,12 @@ class TRTCCloud extends events_1.EventEmitter {
3177
3218
  },
3178
3219
  setParameter: (param) => {
3179
3220
  return this.rtcCloud.setPluginParameter(pluginId, param);
3180
- },
3181
- getParameter: () => {
3182
- return this.rtcCloud.getPluginParameter(pluginId);
3183
3221
  }
3184
3222
  };
3185
3223
  }
3186
- setPluginCallback(pluginCb) {
3187
- this.rtcCloud.setPluginCallback(pluginCb);
3188
- }
3189
3224
  getKey(uid, type) {
3190
3225
  return String(uid) + '_' + String(type);
3191
3226
  }
3192
- setEnableRenderFrame(enable) {
3193
- console.log('setEnableRenderFrame:' + enable);
3194
- this.enableRenderFrame = enable;
3195
- }
3196
3227
  /**
3197
3228
  * 判断是否支持webGL
3198
3229
  * @returns {boolean}
@@ -3322,7 +3353,7 @@ class TRTCCloud extends events_1.EventEmitter {
3322
3353
  let ulen = width * height / 4;
3323
3354
  let ydata = new Uint8Array(data, 0, ylen);
3324
3355
  let udata = new Uint8Array(data, ylen, ulen);
3325
- let vdata = new Uint8Array(data, ylen + ulen, data.le);
3356
+ let vdata = new Uint8Array(data, ylen + ulen, ulen);
3326
3357
  renderer.drawFrame({
3327
3358
  width: width,
3328
3359
  height: height,
@@ -616,6 +616,9 @@ export declare class TRTCRemoteStatistics {
616
616
  * @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好。
617
617
  * 一般低于50ms的 rtt 是比较理想的情况,而高于100ms的 rtt 会引入较大的通话延时。
618
618
  * 由于数据上下行共享一条网络连接,所以 local 和 remote 的 rtt 相同。
619
+ * @param {Number} gatewayRtt - 延迟(毫秒),指 SDK 到本地路由器网关一次网络往返时间,该值越小越好。
620
+ * 一般低于 50ms 的 gatewayRtt 相对理想,而高于 200ms 的 gatewayRtt 会引入较大的通话延时。
621
+ * 当网络为蜂窝网非 WiFi 类型时,该值无效。
619
622
  * @param {Number} receivedBytes - 总接收字节数(包含信令和音视频)
620
623
  * @param {Number} sentBytes - 总发送字节总数(包含信令和音视频)
621
624
  * @param {TRTCLocalStatistics[]} localStatisticsArray - 自己本地的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
@@ -630,13 +633,14 @@ export declare class TRTCStatistics {
630
633
  appCpu: number;
631
634
  systemCpu: number;
632
635
  rtt: number;
636
+ gatewayRtt: number;
633
637
  receivedBytes: number;
634
638
  sentBytes: number;
635
639
  localStatisticsArray: TRTCLocalStatistics[];
636
640
  localStatisticsArraySize: number;
637
641
  remoteStatisticsArray: TRTCRemoteStatistics[];
638
642
  remoteStatisticsArraySize: number;
639
- constructor(upLoss?: number, downLoss?: number, appCpu?: number, systemCpu?: number, rtt?: number, receivedBytes?: number, sentBytes?: number, localStatisticsArray?: TRTCLocalStatistics[], localStatisticsArraySize?: number, remoteStatisticsArray?: TRTCRemoteStatistics[], remoteStatisticsArraySize?: number);
643
+ constructor(upLoss?: number, downLoss?: number, appCpu?: number, systemCpu?: number, rtt?: number, gatewayRtt?: number, receivedBytes?: number, sentBytes?: number, localStatisticsArray?: TRTCLocalStatistics[], localStatisticsArraySize?: number, remoteStatisticsArray?: TRTCRemoteStatistics[], remoteStatisticsArraySize?: number);
640
644
  }
641
645
  /**
642
646
  * 音乐参数
@@ -693,5 +697,10 @@ export interface PluginInfo {
693
697
  enable: () => number;
694
698
  disable: () => number;
695
699
  setParameter: (param: string) => number;
696
- getParameter: (paramKey: string) => string;
700
+ }
701
+ export declare enum TRTCCameraCaptureMode {
702
+ TRTCCameraResolutionStrategyAuto = 0,
703
+ TRTCCameraResolutionStrategyPerformance = 1,
704
+ TRTCCameraResolutionStrategyHighQuality = 2,
705
+ TRTCCameraCaptureManual = 3
697
706
  }
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.TRTCSwitchRoomParam = exports.AudioMusicParam = exports.TRTCStatistics = exports.TRTCRemoteStatistics = exports.TRTCLocalStatistics = exports.TRTCAudioEffectParam = exports.TRTCAudioRecordingParams = exports.TRTCPublishCDNParam = exports.TRTCTranscodingConfig = exports.TRTCTranscodingConfigMode = exports.TRTCMixUser = exports.Rect = exports.TRTCSpeedTestResult = exports.TRTCVolumeInfo = exports.TRTCQualityInfo = exports.TRTCNetworkQosParam = exports.TRTCRenderParams = exports.TRTCVideoEncParam = exports.TRTCParams = exports.TRTCWaterMarkSrcType = exports.TRTCDeviceType = exports.TRTCDeviceState = exports.TRTCLogLevel = exports.TRTCVideoFrame = exports.TRTCDeviceInfo = exports.TRTCScreenCaptureSourceInfo = exports.TRTCImageBuffer = exports.TRTCAudioQuality = exports.TRTCScreenCaptureSourceType = exports.TRTCAudioFrameFormat = exports.TRTCVideoQosPreference = exports.TRTCQosControlMode = exports.TRTCRoleType = exports.TRTCAppScene = exports.TRTCVideoMirrorType = exports.TRTCVideoBufferType = exports.TRTCVideoPixelFormat = exports.TRTCBeautyStyle = exports.TRTCVideoRotation = exports.TRTCVideoFillMode = exports.TRTCQuality = exports.TRTCVideoStreamType = exports.TRTCVideoResolutionMode = exports.TRTCVideoResolution = void 0;
9
+ exports.TRTCCameraCaptureMode = exports.TRTCSwitchRoomParam = exports.AudioMusicParam = exports.TRTCStatistics = exports.TRTCRemoteStatistics = exports.TRTCLocalStatistics = exports.TRTCAudioEffectParam = exports.TRTCAudioRecordingParams = exports.TRTCPublishCDNParam = exports.TRTCTranscodingConfig = exports.TRTCTranscodingConfigMode = exports.TRTCMixUser = exports.Rect = exports.TRTCSpeedTestResult = exports.TRTCVolumeInfo = exports.TRTCQualityInfo = exports.TRTCNetworkQosParam = exports.TRTCRenderParams = exports.TRTCVideoEncParam = exports.TRTCParams = exports.TRTCWaterMarkSrcType = exports.TRTCDeviceType = exports.TRTCDeviceState = exports.TRTCLogLevel = exports.TRTCVideoFrame = exports.TRTCDeviceInfo = exports.TRTCScreenCaptureSourceInfo = exports.TRTCImageBuffer = exports.TRTCAudioQuality = exports.TRTCScreenCaptureSourceType = exports.TRTCAudioFrameFormat = exports.TRTCVideoQosPreference = exports.TRTCQosControlMode = exports.TRTCRoleType = exports.TRTCAppScene = exports.TRTCVideoMirrorType = exports.TRTCVideoBufferType = exports.TRTCVideoPixelFormat = exports.TRTCBeautyStyle = exports.TRTCVideoRotation = exports.TRTCVideoFillMode = exports.TRTCQuality = exports.TRTCVideoStreamType = exports.TRTCVideoResolutionMode = exports.TRTCVideoResolution = void 0;
10
10
  /////////////////////////////////////////////////////////////////////////////////
11
11
  //
12
12
  // 【(一)视频相关枚举值定义】
@@ -1194,6 +1194,9 @@ exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
1194
1194
  * @param {Number} rtt - 延迟(毫秒),代表 SDK 跟服务器一来一回之间所消耗的时间,这个值越小越好。
1195
1195
  * 一般低于50ms的 rtt 是比较理想的情况,而高于100ms的 rtt 会引入较大的通话延时。
1196
1196
  * 由于数据上下行共享一条网络连接,所以 local 和 remote 的 rtt 相同。
1197
+ * @param {Number} gatewayRtt - 延迟(毫秒),指 SDK 到本地路由器网关一次网络往返时间,该值越小越好。
1198
+ * 一般低于 50ms 的 gatewayRtt 相对理想,而高于 200ms 的 gatewayRtt 会引入较大的通话延时。
1199
+ * 当网络为蜂窝网非 WiFi 类型时,该值无效。
1197
1200
  * @param {Number} receivedBytes - 总接收字节数(包含信令和音视频)
1198
1201
  * @param {Number} sentBytes - 总发送字节总数(包含信令和音视频)
1199
1202
  * @param {TRTCLocalStatistics[]} localStatisticsArray - 自己本地的音视频统计信息,由于可能有大画面、小画面以及辅路画面等多路的情况,所以是一个数组
@@ -1203,12 +1206,13 @@ exports.TRTCRemoteStatistics = TRTCRemoteStatistics;
1203
1206
  *
1204
1207
  */
1205
1208
  class TRTCStatistics {
1206
- constructor(upLoss = 0, downLoss = 0, appCpu = 0, systemCpu = 0, rtt = 0, receivedBytes = 0, sentBytes = 0, localStatisticsArray = [], localStatisticsArraySize = 0, remoteStatisticsArray = [], remoteStatisticsArraySize = 0) {
1209
+ constructor(upLoss = 0, downLoss = 0, appCpu = 0, systemCpu = 0, rtt = 0, gatewayRtt = 0, receivedBytes = 0, sentBytes = 0, localStatisticsArray = [], localStatisticsArraySize = 0, remoteStatisticsArray = [], remoteStatisticsArraySize = 0) {
1207
1210
  this.upLoss = upLoss;
1208
1211
  this.downLoss = downLoss;
1209
1212
  this.appCpu = appCpu;
1210
1213
  this.systemCpu = systemCpu;
1211
1214
  this.rtt = rtt;
1215
+ this.gatewayRtt = gatewayRtt;
1212
1216
  this.receivedBytes = receivedBytes;
1213
1217
  this.sentBytes = sentBytes;
1214
1218
  this.localStatisticsArray = localStatisticsArray;
@@ -1262,3 +1266,26 @@ class TRTCSwitchRoomParam {
1262
1266
  }
1263
1267
  }
1264
1268
  exports.TRTCSwitchRoomParam = TRTCSwitchRoomParam;
1269
+ /**
1270
+ * 摄像头采集偏好
1271
+ *
1272
+ * @enum {Number}
1273
+ */
1274
+ const TRTCCameraCaptureMode_HACK_JSDOC = {
1275
+ /** 自动调整采集参数。SDK 根据实际的采集设备性能及网络情况,选择合适的摄像头输出参数,在设备性能及视频预览质量之间,维持平衡。 **/
1276
+ TRTCCameraResolutionStrategyAuto: 0,
1277
+ /** 优先保证设备性能。SDK 根据用户设置编码器的分辨率和帧率,选择最接近的摄像头输出参数,从而保证设备性能。 **/
1278
+ TRTCCameraResolutionStrategyPerformance: 1,
1279
+ /** 优先保证视频预览质量。SDK选择较高的摄像头输出参数,从而提高预览视频的质量。在这种情况下,会消耗更多的 CPU 及内存做视频前处理。 **/
1280
+ TRTCCameraResolutionStrategyHighQuality: 2,
1281
+ /** 允许用户设置本地摄像头采集的视频宽高。 **/
1282
+ TRTCCameraCaptureManual: 3,
1283
+ };
1284
+ var TRTCCameraCaptureMode;
1285
+ (function (TRTCCameraCaptureMode) {
1286
+ TRTCCameraCaptureMode[TRTCCameraCaptureMode["TRTCCameraResolutionStrategyAuto"] = 0] = "TRTCCameraResolutionStrategyAuto";
1287
+ TRTCCameraCaptureMode[TRTCCameraCaptureMode["TRTCCameraResolutionStrategyPerformance"] = 1] = "TRTCCameraResolutionStrategyPerformance";
1288
+ TRTCCameraCaptureMode[TRTCCameraCaptureMode["TRTCCameraResolutionStrategyHighQuality"] = 2] = "TRTCCameraResolutionStrategyHighQuality";
1289
+ TRTCCameraCaptureMode[TRTCCameraCaptureMode["TRTCCameraCaptureManual"] = 3] = "TRTCCameraCaptureManual";
1290
+ })(TRTCCameraCaptureMode = exports.TRTCCameraCaptureMode || (exports.TRTCCameraCaptureMode = {}));
1291
+ ;
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "trtc-electron-sdk",
3
- "version": "9.3.301",
3
+ "version": "9.4.105-beta.2",
4
4
  "description": "trtc electron sdk",
5
5
  "main": "./liteav/trtc.js",
6
6
  "types": "./liteav/trtc.d.ts",
7
7
  "dependencies": {
8
8
  "cos-nodejs-sdk-v5": "^2.8.2",
9
- "events": "^3.2.0",
10
- "lodash.isequal": "^4.5.0",
11
- "yuv-buffer": "^1.0.0",
12
- "yuv-canvas": "^1.2.6",
13
9
  "download": "^8.0.0",
14
- "fs-sync": "^1.0.6",
10
+ "events": "^3.2.0",
15
11
  "fs-extra": "^9.0.1",
16
- "signale": "^1.4.0",
12
+ "fs-sync": "^1.0.6",
13
+ "lodash.isequal": "^4.5.0",
17
14
  "rimraf": "^3.0.2",
18
- "semver": "^6.0.0"
15
+ "semver": "^6.0.0",
16
+ "signale": "^1.4.0",
17
+ "yuv-buffer": "^1.0.0",
18
+ "yuv-canvas": "^1.2.9"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@babel/cli": "^7.11.6",