agora-electron-sdk 4.3.2 → 4.4.0-dev.1

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.
Files changed (100) hide show
  1. package/gulpfile.js +3 -1
  2. package/js/AgoraSdk.js +4 -4
  3. package/js/Private/AgoraBase.js +367 -326
  4. package/js/Private/AgoraMediaBase.js +265 -76
  5. package/js/Private/AgoraMediaPlayerTypes.js +12 -30
  6. package/js/Private/IAgoraH265Transcoder.js +2 -5
  7. package/js/Private/IAgoraLog.js +2 -5
  8. package/js/Private/IAgoraMediaEngine.js +2 -5
  9. package/js/Private/IAgoraMediaPlayer.js +4 -10
  10. package/js/Private/IAgoraMediaRecorder.js +2 -5
  11. package/js/Private/IAgoraMediaStreamingSource.js +2 -5
  12. package/js/Private/IAgoraMusicContentCenter.js +21 -68
  13. package/js/Private/IAgoraRhythmPlayer.js +2 -5
  14. package/js/Private/IAgoraRtcEngine.js +76 -130
  15. package/js/Private/IAgoraRtcEngineEx.js +5 -28
  16. package/js/Private/IAgoraSpatialAudio.js +6 -15
  17. package/js/Private/IAudioDeviceManager.js +2 -5
  18. package/js/Private/impl/AgoraMediaBaseImpl.js +11 -14
  19. package/js/Private/impl/IAgoraH265TranscoderImpl.js +43 -46
  20. package/js/Private/impl/IAgoraMediaEngineImpl.js +155 -172
  21. package/js/Private/impl/IAgoraMediaPlayerImpl.js +534 -546
  22. package/js/Private/impl/IAgoraMediaRecorderImpl.js +26 -29
  23. package/js/Private/impl/IAgoraMusicContentCenterImpl.js +218 -251
  24. package/js/Private/impl/IAgoraRtcEngineExImpl.js +434 -436
  25. package/js/Private/impl/IAgoraRtcEngineImpl.js +2445 -2423
  26. package/js/Private/impl/IAgoraSpatialAudioImpl.js +167 -170
  27. package/js/Private/impl/IAudioDeviceManagerImpl.js +232 -235
  28. package/js/Private/internal/AgoraH265TranscoderInternal.js +33 -57
  29. package/js/Private/internal/AgoraMediaBaseInternal.js +9 -28
  30. package/js/Private/internal/AudioDeviceManagerInternal.js +24 -44
  31. package/js/Private/internal/IrisApiEngine.js +94 -145
  32. package/js/Private/internal/LocalSpatialAudioEngineInternal.js +3 -23
  33. package/js/Private/internal/MediaEngineInternal.js +69 -94
  34. package/js/Private/internal/MediaPlayerInternal.js +105 -125
  35. package/js/Private/internal/MediaRecorderInternal.js +37 -64
  36. package/js/Private/internal/MusicContentCenterInternal.js +92 -129
  37. package/js/Private/internal/RtcEngineExInternal.js +213 -243
  38. package/js/Private/ti/AgoraBase-ti.js +2 -2
  39. package/js/Private/ti/AgoraMediaBase-ti.js +2 -2
  40. package/js/Private/ti/AgoraMediaPlayerTypes-ti.js +1 -1
  41. package/js/Private/ti/IAgoraH265Transcoder-ti.js +2 -2
  42. package/js/Private/ti/IAgoraLog-ti.js +1 -1
  43. package/js/Private/ti/IAgoraMediaEngine-ti.js +1 -1
  44. package/js/Private/ti/IAgoraMediaPlayer-ti.js +2 -2
  45. package/js/Private/ti/IAgoraMediaPlayerSource-ti.js +2 -2
  46. package/js/Private/ti/IAgoraMediaRecorder-ti.js +1 -1
  47. package/js/Private/ti/IAgoraMediaStreamingSource-ti.js +1 -1
  48. package/js/Private/ti/IAgoraMusicContentCenter-ti.js +2 -2
  49. package/js/Private/ti/IAgoraRhythmPlayer-ti.js +1 -1
  50. package/js/Private/ti/IAgoraRtcEngine-ti.js +7 -7
  51. package/js/Private/ti/IAgoraRtcEngineEx-ti.js +1 -1
  52. package/js/Private/ti/IAgoraSpatialAudio-ti.js +1 -1
  53. package/js/Private/ti/IAudioDeviceManager-ti.js +1 -1
  54. package/js/Renderer/AgoraView.js +100 -145
  55. package/js/Renderer/IRenderer.js +43 -53
  56. package/js/Renderer/IRendererManager.js +106 -132
  57. package/js/Renderer/RendererCache.js +63 -96
  58. package/js/Renderer/RendererManager.js +35 -69
  59. package/js/Renderer/WebGLRenderer/index.js +77 -106
  60. package/js/Renderer/YUVCanvasRenderer/index.js +18 -40
  61. package/js/Utils.js +45 -64
  62. package/package.json +9 -7
  63. package/scripts/checkElectron.js +41 -0
  64. package/scripts/downloadPrebuild.js +56 -24
  65. package/scripts/synclib.js +6 -6
  66. package/ts/Private/AgoraBase.ts +269 -4
  67. package/ts/Private/AgoraMediaBase.ts +343 -1
  68. package/ts/Private/IAgoraMediaEngine.ts +3 -3
  69. package/ts/Private/IAgoraRtcEngine.ts +130 -119
  70. package/ts/Private/IAgoraRtcEngineEx.ts +14 -9
  71. package/ts/Private/impl/IAgoraRtcEngineExImpl.ts +30 -0
  72. package/ts/Private/impl/IAgoraRtcEngineImpl.ts +181 -61
  73. package/ts/Private/internal/IrisApiEngine.ts +3 -7
  74. package/ts/Private/internal/MediaEngineInternal.ts +0 -1
  75. package/ts/Private/internal/RtcEngineExInternal.ts +8 -4
  76. package/ts/Private/ti/IAgoraRtcEngine-ti.ts +5 -5
  77. package/ts/Renderer/IRenderer.ts +1 -2
  78. package/ts/Renderer/IRendererManager.ts +21 -12
  79. package/ts/Utils.ts +15 -0
  80. package/types/Private/AgoraBase.d.ts +264 -8
  81. package/types/Private/AgoraBase.d.ts.map +1 -1
  82. package/types/Private/AgoraMediaBase.d.ts +336 -1
  83. package/types/Private/AgoraMediaBase.d.ts.map +1 -1
  84. package/types/Private/IAgoraMediaEngine.d.ts +3 -3
  85. package/types/Private/IAgoraRtcEngine.d.ts +106 -116
  86. package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
  87. package/types/Private/IAgoraRtcEngineEx.d.ts +10 -10
  88. package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
  89. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +3 -1
  90. package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -1
  91. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +13 -5
  92. package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
  93. package/types/Private/internal/IrisApiEngine.d.ts.map +1 -1
  94. package/types/Private/internal/MediaEngineInternal.d.ts.map +1 -1
  95. package/types/Private/internal/RtcEngineExInternal.d.ts +1 -0
  96. package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
  97. package/types/Renderer/IRenderer.d.ts.map +1 -1
  98. package/types/Renderer/IRendererManager.d.ts.map +1 -1
  99. package/types/Utils.d.ts +4 -0
  100. package/types/Utils.d.ts.map +1 -1
@@ -1,6 +1,28 @@
1
1
  import './extension/AgoraMediaBaseExtension';
2
2
  import { EncodedVideoFrameInfo } from './AgoraBase';
3
3
 
4
+ /**
5
+ * @ignore
6
+ */
7
+ export class ExtensionContext {
8
+ /**
9
+ * @ignore
10
+ */
11
+ isValid?: boolean;
12
+ /**
13
+ * @ignore
14
+ */
15
+ uid?: number;
16
+ /**
17
+ * @ignore
18
+ */
19
+ providerName?: string;
20
+ /**
21
+ * @ignore
22
+ */
23
+ extensionName?: string;
24
+ }
25
+
4
26
  /**
5
27
  * The type of the video source.
6
28
  */
@@ -449,6 +471,10 @@ export enum VideoPixelFormat {
449
471
  * @ignore
450
472
  */
451
473
  VideoCvpixelBgra = 14,
474
+ /**
475
+ * @ignore
476
+ */
477
+ VideoCvpixelP010 = 15,
452
478
  /**
453
479
  * 16: The format is I422.
454
480
  */
@@ -519,6 +545,294 @@ export abstract class IVideoFrameMetaInfo {
519
545
  abstract getMetaInfoStr(key: MetaInfoKey): string;
520
546
  }
521
547
 
548
+ /**
549
+ * @ignore
550
+ */
551
+ export enum PrimaryID {
552
+ /**
553
+ * @ignore
554
+ */
555
+ PrimaryidBt709 = 1,
556
+ /**
557
+ * @ignore
558
+ */
559
+ PrimaryidUnspecified = 2,
560
+ /**
561
+ * @ignore
562
+ */
563
+ PrimaryidBt470m = 4,
564
+ /**
565
+ * @ignore
566
+ */
567
+ PrimaryidBt470bg = 5,
568
+ /**
569
+ * @ignore
570
+ */
571
+ PrimaryidSmpte170m = 6,
572
+ /**
573
+ * @ignore
574
+ */
575
+ PrimaryidSmpte240m = 7,
576
+ /**
577
+ * @ignore
578
+ */
579
+ PrimaryidFilm = 8,
580
+ /**
581
+ * @ignore
582
+ */
583
+ PrimaryidBt2020 = 9,
584
+ /**
585
+ * @ignore
586
+ */
587
+ PrimaryidSmptest428 = 10,
588
+ /**
589
+ * @ignore
590
+ */
591
+ PrimaryidSmptest431 = 11,
592
+ /**
593
+ * @ignore
594
+ */
595
+ PrimaryidSmptest432 = 12,
596
+ /**
597
+ * @ignore
598
+ */
599
+ PrimaryidJedecp22 = 22,
600
+ }
601
+
602
+ /**
603
+ * @ignore
604
+ */
605
+ export enum RangeID {
606
+ /**
607
+ * @ignore
608
+ */
609
+ RangeidInvalid = 0,
610
+ /**
611
+ * @ignore
612
+ */
613
+ RangeidLimited = 1,
614
+ /**
615
+ * @ignore
616
+ */
617
+ RangeidFull = 2,
618
+ /**
619
+ * @ignore
620
+ */
621
+ RangeidDerived = 3,
622
+ }
623
+
624
+ /**
625
+ * @ignore
626
+ */
627
+ export enum MatrixID {
628
+ /**
629
+ * @ignore
630
+ */
631
+ MatrixidRgb = 0,
632
+ /**
633
+ * @ignore
634
+ */
635
+ MatrixidBt709 = 1,
636
+ /**
637
+ * @ignore
638
+ */
639
+ MatrixidUnspecified = 2,
640
+ /**
641
+ * @ignore
642
+ */
643
+ MatrixidFcc = 4,
644
+ /**
645
+ * @ignore
646
+ */
647
+ MatrixidBt470bg = 5,
648
+ /**
649
+ * @ignore
650
+ */
651
+ MatrixidSmpte170m = 6,
652
+ /**
653
+ * @ignore
654
+ */
655
+ MatrixidSmpte240m = 7,
656
+ /**
657
+ * @ignore
658
+ */
659
+ MatrixidYcocg = 8,
660
+ /**
661
+ * @ignore
662
+ */
663
+ MatrixidBt2020Ncl = 9,
664
+ /**
665
+ * @ignore
666
+ */
667
+ MatrixidBt2020Cl = 10,
668
+ /**
669
+ * @ignore
670
+ */
671
+ MatrixidSmpte2085 = 11,
672
+ /**
673
+ * @ignore
674
+ */
675
+ MatrixidCdncls = 12,
676
+ /**
677
+ * @ignore
678
+ */
679
+ MatrixidCdcls = 13,
680
+ /**
681
+ * @ignore
682
+ */
683
+ MatrixidBt2100Ictcp = 14,
684
+ }
685
+
686
+ /**
687
+ * @ignore
688
+ */
689
+ export enum TransferID {
690
+ /**
691
+ * @ignore
692
+ */
693
+ TransferidBt709 = 1,
694
+ /**
695
+ * @ignore
696
+ */
697
+ TransferidUnspecified = 2,
698
+ /**
699
+ * @ignore
700
+ */
701
+ TransferidGamma22 = 4,
702
+ /**
703
+ * @ignore
704
+ */
705
+ TransferidGamma28 = 5,
706
+ /**
707
+ * @ignore
708
+ */
709
+ TransferidSmpte170m = 6,
710
+ /**
711
+ * @ignore
712
+ */
713
+ TransferidSmpte240m = 7,
714
+ /**
715
+ * @ignore
716
+ */
717
+ TransferidLinear = 8,
718
+ /**
719
+ * @ignore
720
+ */
721
+ TransferidLog = 9,
722
+ /**
723
+ * @ignore
724
+ */
725
+ TransferidLogSqrt = 10,
726
+ /**
727
+ * @ignore
728
+ */
729
+ TransferidIec6196624 = 11,
730
+ /**
731
+ * @ignore
732
+ */
733
+ TransferidBt1361Ecg = 12,
734
+ /**
735
+ * @ignore
736
+ */
737
+ TransferidIec6196621 = 13,
738
+ /**
739
+ * @ignore
740
+ */
741
+ TransferidBt202010 = 14,
742
+ /**
743
+ * @ignore
744
+ */
745
+ TransferidBt202012 = 15,
746
+ /**
747
+ * @ignore
748
+ */
749
+ TransferidSmptest2084 = 16,
750
+ /**
751
+ * @ignore
752
+ */
753
+ TransferidSmptest428 = 17,
754
+ /**
755
+ * @ignore
756
+ */
757
+ TransferidAribStdB67 = 18,
758
+ }
759
+
760
+ /**
761
+ * @ignore
762
+ */
763
+ export class ColorSpace {
764
+ /**
765
+ * @ignore
766
+ */
767
+ primaries?: PrimaryID;
768
+ /**
769
+ * @ignore
770
+ */
771
+ transfer?: TransferID;
772
+ /**
773
+ * @ignore
774
+ */
775
+ matrix?: MatrixID;
776
+ /**
777
+ * @ignore
778
+ */
779
+ range?: RangeID;
780
+ }
781
+
782
+ /**
783
+ * @ignore
784
+ */
785
+ export class Hdr10MetadataInfo {
786
+ /**
787
+ * @ignore
788
+ */
789
+ redPrimaryX?: number;
790
+ /**
791
+ * @ignore
792
+ */
793
+ redPrimaryY?: number;
794
+ /**
795
+ * @ignore
796
+ */
797
+ greenPrimaryX?: number;
798
+ /**
799
+ * @ignore
800
+ */
801
+ greenPrimaryY?: number;
802
+ /**
803
+ * @ignore
804
+ */
805
+ bluePrimaryX?: number;
806
+ /**
807
+ * @ignore
808
+ */
809
+ bluePrimaryY?: number;
810
+ /**
811
+ * @ignore
812
+ */
813
+ whitePointX?: number;
814
+ /**
815
+ * @ignore
816
+ */
817
+ whitePointY?: number;
818
+ /**
819
+ * @ignore
820
+ */
821
+ maxMasteringLuminance?: number;
822
+ /**
823
+ * @ignore
824
+ */
825
+ minMasteringLuminance?: number;
826
+ /**
827
+ * @ignore
828
+ */
829
+ maxContentLightLevel?: number;
830
+ /**
831
+ * @ignore
832
+ */
833
+ maxFrameAverageLightLevel?: number;
834
+ }
835
+
522
836
  /**
523
837
  * @ignore
524
838
  */
@@ -607,6 +921,10 @@ export class ExternalVideoFrame {
607
921
  * This parameter only applies to video data in Texture format. Incoming 4 × 4 transformational matrix. The typical value is a unit matrix.
608
922
  */
609
923
  textureId?: number;
924
+ /**
925
+ * @ignore
926
+ */
927
+ fence_object?: number;
610
928
  /**
611
929
  * This parameter only applies to video data in Texture format. Incoming 4 × 4 transformational matrix. The typical value is a unit matrix.
612
930
  */
@@ -627,10 +945,22 @@ export class ExternalVideoFrame {
627
945
  * @ignore
628
946
  */
629
947
  fillAlphaBuffer?: boolean;
948
+ /**
949
+ * @ignore
950
+ */
951
+ alphaStitchMode?: number;
630
952
  /**
631
953
  * This parameter only applies to video data in Windows Texture format. It represents an index of an ID3D11Texture2D texture object used by the video frame in the ID3D11Texture2D array.
632
954
  */
633
955
  texture_slice_index?: number;
956
+ /**
957
+ * @ignore
958
+ */
959
+ hdr10MetadataInfo?: Hdr10MetadataInfo;
960
+ /**
961
+ * @ignore
962
+ */
963
+ colorSpace?: ColorSpace;
634
964
  }
635
965
 
636
966
  /**
@@ -707,6 +1037,10 @@ export class VideoFrame {
707
1037
  * @ignore
708
1038
  */
709
1039
  alphaBuffer?: Uint8Array;
1040
+ /**
1041
+ * @ignore
1042
+ */
1043
+ alphaStitchMode?: number;
710
1044
  /**
711
1045
  * @ignore
712
1046
  */
@@ -715,6 +1049,14 @@ export class VideoFrame {
715
1049
  * The meta information in the video frame. To use this parameter, please.
716
1050
  */
717
1051
  metaInfo?: IVideoFrameMetaInfo;
1052
+ /**
1053
+ * @ignore
1054
+ */
1055
+ hdr10MetadataInfo?: Hdr10MetadataInfo;
1056
+ /**
1057
+ * @ignore
1058
+ */
1059
+ colorSpace?: ColorSpace;
718
1060
  }
719
1061
 
720
1062
  /**
@@ -999,7 +1341,7 @@ export interface IAudioSpectrumObserver {
999
1341
  /**
1000
1342
  * Gets the statistics of a local audio spectrum.
1001
1343
  *
1002
- * 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.
1344
+ * After successfully calling registerAudioSpectrumObserver to implement the onLocalAudioSpectrum callback in IAudioSpectrumObserver and calling enableAudioSpectrumMonitor to enable audio spectrum monitoring, the SDK triggers this callback as the time interval you set to report the received remote audio data spectrum before encoding.
1003
1345
  *
1004
1346
  * @param data The audio spectrum data of the local user. See AudioSpectrumData.
1005
1347
  */
@@ -119,7 +119,7 @@ export abstract class IMediaEngine {
119
119
  *
120
120
  * Before calling this method to push external audio data, perform the following steps:
121
121
  * Call createCustomAudioTrack to create a custom audio track and get the audio track ID.
122
- * Call joinChannel to join the channel. In ChannelMediaOptions, set publishCustomAduioTrackId to the audio track ID that you want to publish, and set publishCustomAudioTrack to true.
122
+ * Call joinChannel to join the channel. In ChannelMediaOptions, set publishCustomAudioTrackId to the audio track ID that you want to publish, and set publishCustomAudioTrack to true.
123
123
  *
124
124
  * @param frame The external audio frame. See AudioFrame.
125
125
  * @param trackId The audio track ID. If you want to publish a custom external audio source, set this parameter to the ID of the corresponding custom audio track you want to publish.
@@ -195,7 +195,7 @@ export abstract class IMediaEngine {
195
195
  *
196
196
  * Ensure that you call this method before joining a channel. To publish a custom audio source, see the following steps:
197
197
  * Call this method to create a custom audio track and get the audio track ID.
198
- * Call joinChannel to join the channel. In ChannelMediaOptions, set publishCustomAduioTrackId to the audio track ID that you want to publish, and set publishCustomAudioTrack to true.
198
+ * Call joinChannel to join the channel. In ChannelMediaOptions, set publishCustomAudioTrackId to the audio track ID that you want to publish, and set publishCustomAudioTrack to true.
199
199
  * Call pushAudioFrame and specify trackId as the audio track ID set in step 2. You can then publish the corresponding custom audio source in the channel.
200
200
  *
201
201
  * @param trackType The type of the custom audio track. See AudioTrackType. If AudioTrackDirect is specified for this parameter, you must set publishMicrophoneTrack to false in ChannelMediaOptions when calling joinChannel to join the channel; otherwise, joining the channel fails and returns the error code -2.
@@ -203,7 +203,7 @@ export abstract class IMediaEngine {
203
203
  *
204
204
  * @returns
205
205
  * If the method call is successful, the audio track ID is returned as the unique identifier of the audio track.
206
- * If the method call fails, a negative value is returned.
206
+ * If the method call fails, 0xffffffff is returned.
207
207
  */
208
208
  abstract createCustomAudioTrack(
209
209
  trackType: AudioTrackType,