add statistics to Client, ServerSession, ServerConn, ServerStream (#556) (#656)

This commit is contained in:
Alessandro Ros
2024-12-25 13:30:08 +01:00
committed by GitHub
parent 8c4a3ca018
commit 87c6d81053
34 changed files with 1246 additions and 404 deletions

36
server_stream_stats.go Normal file
View File

@@ -0,0 +1,36 @@
package gortsplib
import (
"github.com/bluenviron/gortsplib/v4/pkg/description"
"github.com/bluenviron/gortsplib/v4/pkg/format"
)
// ServerStreamStatsFormat are stream format statistics.
type ServerStreamStatsFormat struct {
// number of sent RTP packets
RTPPacketsSent uint64
}
// ServerStreamStatsMedia are stream media statistics.
type ServerStreamStatsMedia struct {
// sent bytes
BytesSent uint64
// number of sent RTCP packets
RTCPPacketsSent uint64
// format statistics
Formats map[format.Format]ServerStreamStatsFormat
}
// ServerStreamStats are stream statistics.
type ServerStreamStats struct {
// sent bytes
BytesSent uint64
// number of sent RTP packets
RTPPacketsSent uint64
// number of sent RTCP packets
RTCPPacketsSent uint64
// media statistics
Medias map[*description.Media]ServerStreamStatsMedia
}