switch to gortsplib/v4 (#2244)

This commit is contained in:
Alessandro Ros
2023-08-26 18:54:28 +02:00
committed by GitHub
parent 055767fef0
commit cf86dbb303
79 changed files with 1241 additions and 1325 deletions

View File

@@ -7,10 +7,10 @@ import (
"testing"
"time"
"github.com/bluenviron/gortsplib/v3"
"github.com/bluenviron/gortsplib/v3/pkg/formats"
"github.com/bluenviron/gortsplib/v3/pkg/media"
"github.com/bluenviron/gortsplib/v3/pkg/url"
"github.com/bluenviron/gortsplib/v4"
"github.com/bluenviron/gortsplib/v4/pkg/description"
"github.com/bluenviron/gortsplib/v4/pkg/format"
"github.com/bluenviron/gortsplib/v4/pkg/url"
"github.com/pion/rtp"
"github.com/pion/webrtc/v3"
"github.com/stretchr/testify/require"
@@ -193,9 +193,9 @@ func TestWebRTCRead(t *testing.T) {
a = newTestHTTPAuthenticator(t, "rtsp", "publish")
}
medi := &media.Media{
Type: media.TypeVideo,
Formats: []formats.Format{&formats.H264{
medi := &description.Media{
Type: description.MediaTypeVideo,
Formats: []format.Format{&format.H264{
PayloadTyp: 96,
PacketizationMode: 1,
}},
@@ -206,7 +206,8 @@ func TestWebRTCRead(t *testing.T) {
Transport: &v,
}
err := source.StartRecording(
"rtsp://testpublisher:testpass@localhost:8554/teststream?param=value", media.Medias{medi})
"rtsp://testpublisher:testpass@localhost:8554/teststream?param=value",
&description.Session{Medias: []*description.Media{medi}})
require.NoError(t, err)
defer source.Close()
@@ -251,7 +252,7 @@ func TestWebRTCRead(t *testing.T) {
Timestamp: 45343,
SSRC: 563423,
},
Payload: []byte{3},
Payload: []byte{5, 3},
})
require.NoError(t, err)
@@ -269,7 +270,7 @@ func TestWebRTCRead(t *testing.T) {
SSRC: pkt.SSRC,
CSRC: []uint32{},
},
Payload: []byte{3},
Payload: []byte{5, 3},
}, pkt)
})
}
@@ -407,13 +408,13 @@ func TestWebRTCPublish(t *testing.T) {
require.NoError(t, err)
defer c.Close()
medias, baseURL, _, err := c.Describe(u)
desc, _, err := c.Describe(u)
require.NoError(t, err)
var forma *formats.VP8
medi := medias.FindFormat(&forma)
var forma *format.VP8
medi := desc.FindFormat(&forma)
_, err = c.Setup(medi, baseURL, 0, 0)
_, err = c.Setup(desc.BaseURL, medi, 0, 0)
require.NoError(t, err)
received := make(chan struct{})