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,9 +7,9 @@ import (
"net/http"
"testing"
"github.com/bluenviron/gortsplib/v3"
"github.com/bluenviron/gortsplib/v3/pkg/formats"
"github.com/bluenviron/gortsplib/v3/pkg/url"
"github.com/bluenviron/gortsplib/v4"
"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"
@@ -105,7 +105,7 @@ func TestWebRTCSource(t *testing.T) {
Timestamp: 45343,
SSRC: 563423,
},
Payload: []byte{1},
Payload: []byte{5, 1},
})
require.NoError(t, err)
@@ -118,7 +118,7 @@ func TestWebRTCSource(t *testing.T) {
Timestamp: 45343,
SSRC: 563423,
},
Payload: []byte{2},
Payload: []byte{5, 2},
})
require.NoError(t, err)
}()
@@ -152,19 +152,19 @@ func TestWebRTCSource(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{})
c.OnPacketRTP(medi, forma, func(pkt *rtp.Packet) {
require.Equal(t, []byte{3}, pkt.Payload)
require.Equal(t, []byte{5, 3}, pkt.Payload)
close(received)
})
@@ -180,7 +180,7 @@ func TestWebRTCSource(t *testing.T) {
Timestamp: 45343,
SSRC: 563423,
},
Payload: []byte{3},
Payload: []byte{5, 3},
})
require.NoError(t, err)