Skip to content

Commit

Permalink
add frame counters metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
vpalmisano committed Mar 22, 2024
1 parent 54c9946 commit 4701966
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/rtcstats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ export enum RtcStatsMetricNames {
videoSentBytes = 'videoSentBytes',
/** The sent video packets. */
videoSentPackets = 'videoSentPackets',
/** The sent video frames. */
videoSentFrames = 'videoSentFrames',
/** The sent video framerate. */
videoSentFps = 'videoSentFps',
/** The sent video width. */
Expand Down Expand Up @@ -159,6 +161,8 @@ export enum RtcStatsMetricNames {
screenSentBytes = 'screenSentBytes',
/** The sent screen packets. */
screenSentPackets = 'screenSentPackets',
/** The sent screen frames. */
screenSentFrames = 'screenSentFrames',
/** The sent screen framerate. */
screenSentFps = 'screenSentFps',
/** The sent screen width. */
Expand Down Expand Up @@ -202,6 +206,7 @@ export enum RtcStatsMetricNames {
videoPliCountSent = 'videoPliCountSent',
videoDecodeLatency = 'videoDecodeLatency',
//'videoFramesDecoded',
videoRecvFrames = 'videoRecvFrames',
videoRecvFps = 'videoRecvFps',
videoRecvAvgJitterBufferDelay = 'videoRecvAvgJitterBufferDelay',
videoRecvBitrates = 'videoRecvBitrates',
Expand All @@ -224,6 +229,7 @@ export enum RtcStatsMetricNames {
screenPliCountSent = 'screenPliCountSent',
screenDecodeLatency = 'screenDecodeLatency',
//'screenFramesDecoded',
screenRecvFrames = 'screenRecvFrames',
screenRecvFps = 'screenRecvFps',
screenRecvAvgJitterBufferDelay = 'screenRecvAvgJitterBufferDelay',
screenRecvBitrates = 'screenRecvBitrates',
Expand Down Expand Up @@ -445,6 +451,12 @@ export function updateRtcStats(
inboundRtp.decoderImplementation !== 'unknown'
) {
//setStats(stats, prefix + 'FramesDecoded', key, inboundRtp.framesDecoded
setStats(
stats,
(prefix + 'RecvFrames') as RtcStatsMetricNames,
key,
inboundRtp.framesReceived,
)
setStats(
stats,
(prefix + 'RecvFps') as RtcStatsMetricNames,
Expand Down Expand Up @@ -591,6 +603,12 @@ export function updateRtcStats(
key,
outboundRtp.frameHeight,
)
setStats(
stats,
(prefix + 'SentFrames') as RtcStatsMetricNames,
key,
outboundRtp.framesSent,
)
setStats(
stats,
(prefix + 'SentFps') as RtcStatsMetricNames,
Expand Down

0 comments on commit 4701966

Please sign in to comment.