mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-10-05 16:26:50 +08:00
Adds stats to RTMP connection
This commit is contained in:
@@ -22,6 +22,8 @@ type Client struct {
|
||||
|
||||
conn *rtmp.Conn
|
||||
closed bool
|
||||
|
||||
receive int
|
||||
}
|
||||
|
||||
func NewClient(uri string) *Client {
|
||||
@@ -94,6 +96,8 @@ func (c *Client) Handle() (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
c.receive += len(pkt.Data)
|
||||
|
||||
track := c.tracks[int(pkt.Idx)]
|
||||
|
||||
timestamp := uint32(pkt.Time / time.Duration(track.Codec.ClockRate))
|
||||
|
Reference in New Issue
Block a user