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
+1
View File
@@ -23,6 +23,7 @@ import (
"github.com/AlexxIT/go2rtc/pkg/tcp"
)
// Deprecated: should be rewritten to core.Connection
type Client struct {
core.Listener
+12 -6
View File
@@ -2,6 +2,7 @@ package tapo
import (
"encoding/json"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/mpegts"
)
@@ -74,15 +75,20 @@ func (c *Client) Stop() error {
}
func (c *Client) MarshalJSON() ([]byte, error) {
info := &core.Info{
Type: "Tapo active producer",
Medias: c.medias,
Recv: c.recv,
Receivers: c.receivers,
Send: c.send,
info := &core.Connection{
ID: core.ID(c),
FormatName: "tapo",
Protocol: "http",
Medias: c.medias,
Recv: c.recv,
Receivers: c.receivers,
Send: c.send,
}
if c.sender != nil {
info.Senders = []*core.Sender{c.sender}
}
if c.conn1 != nil {
info.RemoteAddr = c.conn1.RemoteAddr().String()
}
return json.Marshal(info)
}