BIG rewrite stream info

This commit is contained in:
Alex X
2024-06-15 16:46:03 +03:00
parent ecfe802065
commit 96504e2fb0
88 changed files with 1043 additions and 854 deletions
+5 -15
View File
@@ -18,6 +18,7 @@ import (
)
type Conn struct {
core.Connection
core.Listener
// public
@@ -30,9 +31,7 @@ type Conn struct {
Timeout int
Transport string // custom transport support, ex. RTSP over WebSocket
Medias []*core.Media
UserAgent string
URL *url.URL
URL *url.URL
// internal
@@ -44,19 +43,10 @@ type Conn struct {
reader *bufio.Reader
sequence int
session string
sdp string
uri string
state State
stateMu sync.Mutex
receivers []*core.Receiver
senders []*core.Sender
// stats
recv int
send int
}
const (
@@ -114,7 +104,7 @@ func (c *Conn) Handle() (err error) {
// polling frames from remote RTSP Server (ex Camera)
timeout = time.Second * 5
if len(c.receivers) == 0 {
if len(c.Receivers) == 0 {
// if we only send audio to camera
// https://github.com/AlexxIT/go2rtc/issues/659
timeout += keepaliveDT
@@ -239,7 +229,7 @@ func (c *Conn) Handle() (err error) {
return
}
c.recv += int(size)
c.Recv += int(size)
if channelID&1 == 0 {
packet := &rtp.Packet{}
@@ -247,7 +237,7 @@ func (c *Conn) Handle() (err error) {
return
}
for _, receiver := range c.receivers {
for _, receiver := range c.Receivers {
if receiver.ID == channelID {
receiver.WriteRTP(packet)
break