@@ -258,7 +258,7 @@ void ViEChannel::UpdateHistograms() {
258
258
rtcp_received.fir_packets / elapsed_minutes);
259
259
RTC_HISTOGRAM_COUNTS_10000 (" WebRTC.Video.PliPacketsReceivedPerMinute" ,
260
260
rtcp_received.pli_packets / elapsed_minutes);
261
- } else if (vie_receiver_.GetRemoteSsrc () > 0 ) {
261
+ } else if (vie_receiver_.GetRemoteSsrc () > 0 ) {
262
262
// Get receive stats if we are receiving packets, i.e. there is a remote
263
263
// ssrc.
264
264
if (rtcp_sent.nack_requests > 0 ) {
@@ -281,6 +281,26 @@ void ViEChannel::UpdateHistograms() {
281
281
0 .5f ));
282
282
}
283
283
}
284
+ StreamDataCounters data;
285
+ StreamDataCounters rtx_data;
286
+ GetReceiveStreamDataCounters (&data, &rtx_data);
287
+ uint32_t media_bytes = data.bytes ;
288
+ uint32_t rtx_bytes =
289
+ rtx_data.bytes + rtx_data.header_bytes + rtx_data.padding_bytes ;
290
+ uint32_t total_bytes = data.bytes + data.header_bytes + data.padding_bytes ;
291
+ total_bytes += rtx_bytes;
292
+ uint32_t padding_bytes = data.padding_bytes + rtx_data.padding_bytes ;
293
+ RTC_HISTOGRAM_COUNTS_10000 (" WebRTC.Video.BitrateReceivedInKbps" ,
294
+ total_bytes * 8 / (elapsed_minutes * 60 ) / 1000 );
295
+ RTC_HISTOGRAM_COUNTS_10000 (" WebRTC.Video.MediaBitrateReceivedInKbps" ,
296
+ media_bytes * 8 / (elapsed_minutes * 60 ) / 1000 );
297
+ RTC_HISTOGRAM_COUNTS_10000 (" WebRTC.Video.PaddingBitrateReceivedInKbps" ,
298
+ padding_bytes * 8 / (elapsed_minutes * 60 ) / 1000 );
299
+ uint32_t ssrc = 0 ;
300
+ if (vie_receiver_.GetRtxSsrc (&ssrc)) {
301
+ RTC_HISTOGRAM_COUNTS_10000 (" WebRTC.Video.RtxBitrateReceivedInKbps" ,
302
+ rtx_bytes * 8 / (elapsed_minutes * 60 ) / 1000 );
303
+ }
284
304
}
285
305
}
286
306
@@ -1164,6 +1184,24 @@ int32_t ViEChannel::GetRtpStatistics(size_t* bytes_sent,
1164
1184
return 0 ;
1165
1185
}
1166
1186
1187
+ void ViEChannel::GetReceiveStreamDataCounters (
1188
+ StreamDataCounters* data,
1189
+ StreamDataCounters* rtx_data) const {
1190
+ StreamStatistician* statistician = vie_receiver_.GetReceiveStatistics ()->
1191
+ GetStatistician (vie_receiver_.GetRemoteSsrc ());
1192
+ if (statistician) {
1193
+ statistician->GetReceiveStreamDataCounters (data);
1194
+ }
1195
+ uint32_t rtx_ssrc = 0 ;
1196
+ if (vie_receiver_.GetRtxSsrc (&rtx_ssrc)) {
1197
+ StreamStatistician* statistician =
1198
+ vie_receiver_.GetReceiveStatistics ()->GetStatistician (rtx_ssrc);
1199
+ if (statistician) {
1200
+ statistician->GetReceiveStreamDataCounters (rtx_data);
1201
+ }
1202
+ }
1203
+ }
1204
+
1167
1205
void ViEChannel::RegisterSendChannelRtpStatisticsCallback (
1168
1206
StreamDataCountersCallback* callback) {
1169
1207
rtp_rtcp_->RegisterSendChannelRtpStatisticsCallback (callback);
0 commit comments