Add RTSP SDP to stream info JSON

This commit is contained in:
Alexey Khit
2023-07-23 17:26:26 +03:00
parent 3defbd60db
commit e6a87fbd69
5 changed files with 20 additions and 7 deletions
+7 -2
View File
@@ -4,12 +4,13 @@ import (
"bufio"
"errors"
"fmt"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/tcp"
"net"
"net/url"
"strconv"
"strings"
"github.com/AlexxIT/go2rtc/pkg/core"
"github.com/AlexxIT/go2rtc/pkg/tcp"
)
func NewServer(conn net.Conn) *Conn {
@@ -69,6 +70,8 @@ func (c *Conn) Accept() error {
return errors.New("wrong content type")
}
c.sdp = string(req.Body) // for info
c.Medias, err = UnmarshalSDP(req.Body)
if err != nil {
return err
@@ -125,6 +128,8 @@ func (c *Conn) Accept() error {
return err
}
c.sdp = string(res.Body) // for info
if err = c.WriteResponse(res); err != nil {
return err
}