mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
new track system
This commit is contained in:
@@ -13,7 +13,6 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
psdp "github.com/pion/sdp/v3"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/aler9/gortsplib/pkg/base"
|
||||
@@ -690,9 +689,7 @@ func TestServerErrorInvalidMethod(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServerErrorTCPTwoConnOneSession(t *testing.T) {
|
||||
track, err := NewTrackH264(96, &TrackConfigH264{
|
||||
[]byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04},
|
||||
})
|
||||
track, err := NewTrackH264(96, []byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04})
|
||||
require.NoError(t, err)
|
||||
|
||||
stream := NewServerStream(Tracks{track})
|
||||
@@ -794,9 +791,7 @@ func TestServerErrorTCPTwoConnOneSession(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestServerErrorTCPOneConnTwoSessions(t *testing.T) {
|
||||
track, err := NewTrackH264(96, &TrackConfigH264{
|
||||
[]byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04},
|
||||
})
|
||||
track, err := NewTrackH264(96, []byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04})
|
||||
require.NoError(t, err)
|
||||
|
||||
stream := NewServerStream(Tracks{track})
|
||||
@@ -1064,9 +1059,7 @@ func TestServerSessionClose(t *testing.T) {
|
||||
func TestServerSessionAutoClose(t *testing.T) {
|
||||
sessionClosed := make(chan struct{})
|
||||
|
||||
track, err := NewTrackH264(96, &TrackConfigH264{
|
||||
[]byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04},
|
||||
})
|
||||
track, err := NewTrackH264(96, []byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04})
|
||||
require.NoError(t, err)
|
||||
|
||||
stream := NewServerStream(Tracks{track})
|
||||
@@ -1133,9 +1126,7 @@ func TestServerErrorInvalidPath(t *testing.T) {
|
||||
t.Run(string(method), func(t *testing.T) {
|
||||
connClosed := make(chan struct{})
|
||||
|
||||
track, err := NewTrackH264(96, &TrackConfigH264{
|
||||
[]byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04},
|
||||
})
|
||||
track, err := NewTrackH264(96, []byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04})
|
||||
require.NoError(t, err)
|
||||
|
||||
stream := NewServerStream(Tracks{track})
|
||||
@@ -1177,18 +1168,11 @@ func TestServerErrorInvalidPath(t *testing.T) {
|
||||
sxID := ""
|
||||
|
||||
if method == base.Record {
|
||||
track, err := NewTrackH264(96, &TrackConfigH264{
|
||||
[]byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04},
|
||||
})
|
||||
track, err := NewTrackH264(96, []byte{0x01, 0x02, 0x03, 0x04}, []byte{0x01, 0x02, 0x03, 0x04})
|
||||
require.NoError(t, err)
|
||||
|
||||
tracks := Tracks{track}
|
||||
for i, t := range tracks {
|
||||
t.Media.Attributes = append(t.Media.Attributes, psdp.Attribute{
|
||||
Key: "control",
|
||||
Value: "trackID=" + strconv.FormatInt(int64(i), 10),
|
||||
})
|
||||
}
|
||||
tracks.setControls()
|
||||
|
||||
res, err := writeReqReadRes(conn, br, base.Request{
|
||||
Method: base.Announce,
|
||||
|
Reference in New Issue
Block a user