trtc-electron-sdk 12.2.115-beta.11 → 12.2.115-beta.12

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.
@@ -224,7 +224,7 @@ export declare class TRTCMediaMixingManager implements ITRTCMediaMixingManager {
224
224
  /**
225
225
  * 添加本地混流媒体源
226
226
  * @param mediaSource {TRTCMediaSource} - 媒体源信息
227
- * @returns {Promise<Rect>}
227
+ * @returns {Promise<void>}
228
228
  */
229
229
  addMediaSource(mediaSource: TRTCMediaSource): Promise<void>;
230
230
  /**
@@ -248,7 +248,7 @@ export declare class TRTCMediaMixingManager implements ITRTCMediaMixingManager {
248
248
  /**
249
249
  * 设置手机投屏参数
250
250
  * @param phoneMirrorSourceId {string} - 手机投屏媒体源 ID
251
- * @param param {TRTCPhoneMirrorParam} - 手机投屏参数,目前只支持优先投屏
251
+ * @param param {TRTCPhoneMirrorParam} - 手机投屏参数
252
252
  */
253
253
  setPhoneMirrorParam(phoneMirrorSourceId: string, param: TRTCPhoneMirrorParam): void;
254
254
  /**
@@ -411,6 +411,7 @@ export declare class TRTCMediaMixingManager implements ITRTCMediaMixingManager {
411
411
  private onPhoneMirrorSourceChanged;
412
412
  private onMediaServerState;
413
413
  private onMediaMixingServerLost;
414
+ private onCallExperimentalAPIFinish;
414
415
  private recoverMediaMixingServer;
415
416
  startCameraDeviceTest(windowID: number | Uint8Array, rect?: Rect): Promise<number>;
416
417
  stopCameraDeviceTest(): Promise<number>;
@@ -462,7 +462,7 @@ class TRTCMediaMixingManager {
462
462
  /**
463
463
  * 添加本地混流媒体源
464
464
  * @param mediaSource {TRTCMediaSource} - 媒体源信息
465
- * @returns {Promise<Rect>}
465
+ * @returns {Promise<void>}
466
466
  */
467
467
  addMediaSource(mediaSource) {
468
468
  logger_1.default.log(`${this.logPrefix}addMediaSource:`, mediaSource);
@@ -553,11 +553,21 @@ class TRTCMediaMixingManager {
553
553
  */
554
554
  setCameraCaptureParam(cameraID, params) {
555
555
  this.nodeMediaMixingPlugin.setCameraCaptureParam(cameraID, params);
556
+ if (params.colorRange !== undefined || params.colorSpace !== undefined) {
557
+ this.nodeMediaMixingPlugin.callExperimentalAPI(JSON.stringify({
558
+ "api": "setCameraCaptureParamEx",
559
+ "params": {
560
+ "cameraId": cameraID,
561
+ "colorRange": params.colorRange || trtc_define_1.TRTCVideoColorRange.TRTCVideoColorRange_Auto,
562
+ "colorSpace": params.colorSpace || trtc_define_1.TRTCVideoColorSpace.TRTCVideoColorSpace_Auto,
563
+ }
564
+ }));
565
+ }
556
566
  }
557
567
  /**
558
568
  * 设置手机投屏参数
559
569
  * @param phoneMirrorSourceId {string} - 手机投屏媒体源 ID
560
- * @param param {TRTCPhoneMirrorParam} - 手机投屏参数,目前只支持优先投屏
570
+ * @param param {TRTCPhoneMirrorParam} - 手机投屏参数
561
571
  */
562
572
  setPhoneMirrorParam(phoneMirrorSourceId, param) {
563
573
  this.nodeMediaMixingPlugin.setPhoneMirrorParam(phoneMirrorSourceId, param);
@@ -605,7 +615,20 @@ class TRTCMediaMixingManager {
605
615
  width: this.mixingVideoWidth,
606
616
  height: this.mixingVideoHeight
607
617
  });
608
- return yield this.nodeMediaMixingPlugin.updatePublishParams(params);
618
+ const result = yield this.nodeMediaMixingPlugin.updatePublishParams(params);
619
+ if (params.videoEncoderParams.colorRange !== undefined
620
+ || params.videoEncoderParams.colorSpace !== undefined
621
+ || params.videoEncoderParams.complexity !== undefined) {
622
+ this.nodeMediaMixingPlugin.callExperimentalAPI(JSON.stringify({
623
+ "api": "setVideoEncodeParamEx",
624
+ "params": {
625
+ "colorRange": params.videoEncoderParams.colorRange || trtc_define_1.TRTCVideoColorRange.TRTCVideoColorRange_Auto,
626
+ "colorSpace": params.videoEncoderParams.colorSpace || trtc_define_1.TRTCVideoColorSpace.TRTCVideoColorSpace_Auto,
627
+ "complexity": params.videoEncoderParams.complexity || trtc_define_1.TRTCVideoEncodeComplexity.TRTCVideoEncodeComplexity_Fastest,
628
+ }
629
+ }));
630
+ }
631
+ return result;
609
632
  });
610
633
  }
611
634
  /**
@@ -997,6 +1020,9 @@ class TRTCMediaMixingManager {
997
1020
  case "onMediaServerState":
998
1021
  this.onMediaServerState(data);
999
1022
  break;
1023
+ case "onCallExperimentalAPIFinish":
1024
+ this.onCallExperimentalAPIFinish(data);
1025
+ break;
1000
1026
  default:
1001
1027
  logger_1.default.warn(`${this.logPrefix} event not supported:`, key, data);
1002
1028
  break;
@@ -1102,6 +1128,9 @@ class TRTCMediaMixingManager {
1102
1128
  }
1103
1129
  });
1104
1130
  }
1131
+ onCallExperimentalAPIFinish(data) {
1132
+ logger_1.default.log(`${this.logPrefix}onCallExperimentalAPIFinish:`, data);
1133
+ }
1105
1134
  recoverMediaMixingServer() {
1106
1135
  var _a, _b, _c;
1107
1136
  return __awaiter(this, void 0, void 0, function* () {
@@ -291,7 +291,6 @@ export declare enum TRTCVideoColorSpace {
291
291
  TRTCVideoColorSpace_BT709 = 2
292
292
  }
293
293
  export declare enum TRTCVideoEncodeComplexity {
294
- TRTCVideoEncodeComplexity_Auto = -1,
295
294
  TRTCVideoEncodeComplexity_Fastest = 0,
296
295
  TRTCVideoEncodeComplexity_Fast = 1,
297
296
  TRTCVideoEncodeComplexity_Medium = 2,
@@ -305,8 +304,8 @@ export declare type TRTCCameraCaptureParams = {
305
304
  width: number;
306
305
  /** 采集图像高度 */
307
306
  height: number;
308
- colorRange?: TRTCVideoColorRange;
309
307
  colorSpace?: TRTCVideoColorSpace;
308
+ colorRange?: TRTCVideoColorRange;
310
309
  };
311
310
  export declare enum TRTCWaterMarkSrcType {
312
311
  TRTCWaterMarkSrcTypeFile = 0,
@@ -388,6 +387,9 @@ export declare class TRTCParams {
388
387
  * @param {Boolean} enableAdjustRes - 【字段含义】是否允许动态调整分辨率(开启后会对云端录制产生影响)<br>
389
388
  * 【推荐取值】该功能适用于不需要云端录制的场景,开启后 SDK 会根据当前网络情况,智能选择出一个合适的分辨率,避免出现“大分辨率+小码率”的低效编码模式。<br>
390
389
  * 【特别说明】默认值:关闭。如有云端录制的需求,请不要开启此功能,因为如果视频分辨率发生变化后,云端录制出的 MP4 在普通的播放器上无法正常播放。<br>
390
+ * @param {TRTCVideoColorSpace} [colorSpace] - 编码色彩空间
391
+ * @param {TRTCVideoColorRange} [colorRange] - 编码色彩范围
392
+ * @param {TRTCVideoEncodeComplexity} [complexity] - 编码复杂度
391
393
  */
392
394
  export declare class TRTCVideoEncParam {
393
395
  videoResolution: TRTCVideoResolution;
@@ -779,21 +779,63 @@ var TRTCCameraCaptureMode;
779
779
  TRTCCameraCaptureMode[TRTCCameraCaptureMode["TRTCCameraResolutionStrategyHighQuality"] = 2] = "TRTCCameraResolutionStrategyHighQuality";
780
780
  TRTCCameraCaptureMode[TRTCCameraCaptureMode["TRTCCameraCaptureManual"] = 3] = "TRTCCameraCaptureManual";
781
781
  })(TRTCCameraCaptureMode = exports.TRTCCameraCaptureMode || (exports.TRTCCameraCaptureMode = {}));
782
+ /**
783
+ * 视频颜色范围
784
+ *
785
+ * @enum {Number}
786
+ */
787
+ const TRTCVideoColorRange_HACK_JSDOC = {
788
+ /** SDK 内部自动渲染合适范围 */
789
+ TRTCVideoColorRange_Auto: 0,
790
+ /** 限制范围 16-235 */
791
+ TRTCVideoColorRange_Limited: 1,
792
+ /** 完整范围 0-255 */
793
+ TRTCVideoColorRange_Full: 2
794
+ };
782
795
  var TRTCVideoColorRange;
783
796
  (function (TRTCVideoColorRange) {
784
797
  TRTCVideoColorRange[TRTCVideoColorRange["TRTCVideoColorRange_Auto"] = 0] = "TRTCVideoColorRange_Auto";
785
798
  TRTCVideoColorRange[TRTCVideoColorRange["TRTCVideoColorRange_Limited"] = 1] = "TRTCVideoColorRange_Limited";
786
799
  TRTCVideoColorRange[TRTCVideoColorRange["TRTCVideoColorRange_Full"] = 2] = "TRTCVideoColorRange_Full";
787
800
  })(TRTCVideoColorRange = exports.TRTCVideoColorRange || (exports.TRTCVideoColorRange = {}));
801
+ /**
802
+ * 视频颜色空间
803
+ *
804
+ * @enum {Number}
805
+ */
806
+ const TRTCVideoColorSpace_HACK_JSDOC = {
807
+ /** SDK 内部自动渲染合适颜色空间 */
808
+ TRTCVideoColorSpace_Auto: 0,
809
+ /** BT.601 */
810
+ TRTCVideoColorSpace_BT601: 1,
811
+ /** BT.709 */
812
+ TRTCVideoColorSpace_BT709: 2,
813
+ };
788
814
  var TRTCVideoColorSpace;
789
815
  (function (TRTCVideoColorSpace) {
790
816
  TRTCVideoColorSpace[TRTCVideoColorSpace["TRTCVideoColorSpace_Auto"] = 0] = "TRTCVideoColorSpace_Auto";
791
817
  TRTCVideoColorSpace[TRTCVideoColorSpace["TRTCVideoColorSpace_BT601"] = 1] = "TRTCVideoColorSpace_BT601";
792
818
  TRTCVideoColorSpace[TRTCVideoColorSpace["TRTCVideoColorSpace_BT709"] = 2] = "TRTCVideoColorSpace_BT709";
793
819
  })(TRTCVideoColorSpace = exports.TRTCVideoColorSpace || (exports.TRTCVideoColorSpace = {}));
820
+ /**
821
+ * 视频编码复杂度
822
+ *
823
+ * @enum {Number}
824
+ */
825
+ const TRTCVideoEncodeComplexity_Hack_JSDOC = {
826
+ /** 最快 */
827
+ TRTCVideoEncodeComplexity_Fastest: 0,
828
+ /** 快 */
829
+ TRTCVideoEncodeComplexity_Fast: 1,
830
+ /** 中 */
831
+ TRTCVideoEncodeComplexity_Medium: 2,
832
+ /** 慢 */
833
+ TRTCVideoEncodeComplexity_Slow: 3,
834
+ /** 最慢 */
835
+ TRTCVideoEncodeComplexity_Slowest: 4,
836
+ };
794
837
  var TRTCVideoEncodeComplexity;
795
838
  (function (TRTCVideoEncodeComplexity) {
796
- TRTCVideoEncodeComplexity[TRTCVideoEncodeComplexity["TRTCVideoEncodeComplexity_Auto"] = -1] = "TRTCVideoEncodeComplexity_Auto";
797
839
  TRTCVideoEncodeComplexity[TRTCVideoEncodeComplexity["TRTCVideoEncodeComplexity_Fastest"] = 0] = "TRTCVideoEncodeComplexity_Fastest";
798
840
  TRTCVideoEncodeComplexity[TRTCVideoEncodeComplexity["TRTCVideoEncodeComplexity_Fast"] = 1] = "TRTCVideoEncodeComplexity_Fast";
799
841
  TRTCVideoEncodeComplexity[TRTCVideoEncodeComplexity["TRTCVideoEncodeComplexity_Medium"] = 2] = "TRTCVideoEncodeComplexity_Medium";
@@ -809,6 +851,8 @@ var TRTCVideoEncodeComplexity;
809
851
  * @property {TRTCCameraCaptureMode} mode - 摄像头采集偏好
810
852
  * @property {Number} width - 采集图像宽度
811
853
  * @property {Number} height - 采集图像高度
854
+ * @property {TRTCVideoColorSpace} [colorSpace] - 可选,颜色空间
855
+ * @property {TRTCVideoColorRange} [colorRange] - 可选,颜色范围
812
856
  */
813
857
  const TRTCCameraCaptureParams_HACK_JSDOC = null;
814
858
  /**
@@ -913,6 +957,9 @@ exports.TRTCParams = TRTCParams;
913
957
  * @param {Boolean} enableAdjustRes - 【字段含义】是否允许动态调整分辨率(开启后会对云端录制产生影响)<br>
914
958
  * 【推荐取值】该功能适用于不需要云端录制的场景,开启后 SDK 会根据当前网络情况,智能选择出一个合适的分辨率,避免出现“大分辨率+小码率”的低效编码模式。<br>
915
959
  * 【特别说明】默认值:关闭。如有云端录制的需求,请不要开启此功能,因为如果视频分辨率发生变化后,云端录制出的 MP4 在普通的播放器上无法正常播放。<br>
960
+ * @param {TRTCVideoColorSpace} [colorSpace] - 编码色彩空间
961
+ * @param {TRTCVideoColorRange} [colorRange] - 编码色彩范围
962
+ * @param {TRTCVideoEncodeComplexity} [complexity] - 编码复杂度
916
963
  */
917
964
  class TRTCVideoEncParam {
918
965
  constructor(videoResolution = TRTCVideoResolution.TRTCVideoResolution_640_360, resMode = TRTCVideoResolutionMode.TRTCVideoResolutionModeLandscape, videoFps = 15, videoBitrate = 550, minVideoBitrate = 0, enableAdjustRes = false) {
@@ -924,7 +971,7 @@ class TRTCVideoEncParam {
924
971
  this.enableAdjustRes = enableAdjustRes;
925
972
  this.colorRange = TRTCVideoColorRange.TRTCVideoColorRange_Auto;
926
973
  this.colorSpace = TRTCVideoColorSpace.TRTCVideoColorSpace_Auto;
927
- this.complexity = TRTCVideoEncodeComplexity.TRTCVideoEncodeComplexity_Auto;
974
+ this.complexity = TRTCVideoEncodeComplexity.TRTCVideoEncodeComplexity_Fastest;
928
975
  }
929
976
  }
930
977
  exports.TRTCVideoEncParam = TRTCVideoEncParam;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trtc-electron-sdk",
3
- "version": "12.2.115-beta.11",
3
+ "version": "12.2.115-beta.12",
4
4
  "description": "trtc electron sdk",
5
5
  "main": "./liteav/index.js",
6
6
  "types": "./liteav/index.d.ts",