浏览代码

send video type to rtcstats (#11426)

master
George Politis 3 年前
父节点
当前提交
e4b50ba419
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 43 次插入0 次删除
  1. 10
    0
      react/features/rtcstats/RTCStats.js
  2. 33
    0
      react/features/rtcstats/middleware.js

+ 10
- 0
react/features/rtcstats/RTCStats.js 查看文件

@@ -105,6 +105,16 @@ class RTCStats {
105 105
         this.trace && this.trace.statsEntry('e2eRtt', null, e2eRttData);
106 106
     }
107 107
 
108
+    /**
109
+     * Send videoType data, the data will be processed by rtcstats-server and saved in the dump file.
110
+     *
111
+     * @param {Object} videoTypeData - The object that holds the videoType data.
112
+     * @returns {void}
113
+     */
114
+    sendVideoTypeData(videoTypeData) {
115
+        this.trace && this.trace.statsEntry('setVideoType', null, videoTypeData);
116
+    }
117
+
108 118
     /**
109 119
      * Send face expression data, the data will be processed by rtcstats-server and saved in the dump file.
110 120
      *

+ 33
- 0
react/features/rtcstats/middleware.js 查看文件

@@ -7,6 +7,7 @@ import { CONFERENCE_UNIQUE_ID_SET, E2E_RTT_CHANGED, getConferenceOptions, getRoo
7 7
 import { LIB_WILL_INIT } from '../base/lib-jitsi-meet/actionTypes';
8 8
 import { DOMINANT_SPEAKER_CHANGED, getLocalParticipant } from '../base/participants';
9 9
 import { MiddlewareRegistry } from '../base/redux';
10
+import { TRACK_ADDED, TRACK_UPDATED } from '../base/tracks';
10 11
 import { ADD_FACE_EXPRESSION } from '../face-landmarks/actionTypes';
11 12
 
12 13
 import RTCStats from './RTCStats';
@@ -52,6 +53,38 @@ MiddlewareRegistry.register(store => next => action => {
52 53
         }
53 54
         break;
54 55
     }
56
+    case TRACK_ADDED: {
57
+        if (canSendRtcstatsData(state)) {
58
+            const jitsiTrack = action?.track?.jitsiTrack;
59
+            const { ssrc, videoType } = jitsiTrack || { };
60
+
61
+            // Remote tracks store their ssrc in the jitsiTrack object. Local tracks don't. See getSsrcByTrack.
62
+            if (videoType && ssrc && !jitsiTrack.isLocal()) {
63
+                RTCStats.sendVideoTypeData({
64
+                    ssrc,
65
+                    videoType
66
+                });
67
+            }
68
+        }
69
+        break;
70
+    }
71
+    case TRACK_UPDATED: {
72
+        if (canSendRtcstatsData(state)) {
73
+            const { videoType, jitsiTrack } = action?.track || { };
74
+            const { ssrc } = jitsiTrack || { };
75
+
76
+            // if the videoType of the remote track has changed we expect to find it in track.videoType. grep for
77
+            // trackVideoTypeChanged.
78
+            if (videoType && ssrc && !jitsiTrack.isLocal()) {
79
+
80
+                RTCStats.sendVideoTypeData({
81
+                    ssrc,
82
+                    videoType
83
+                });
84
+            }
85
+        }
86
+        break;
87
+    }
55 88
     case CONFERENCE_UNIQUE_ID_SET: {
56 89
         if (canSendRtcstatsData(state)) {
57 90
 

正在加载...
取消
保存