mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
move each goroutine in a dedicated struct (#285)
This commit is contained in:
@@ -7,6 +7,14 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func uint16Ptr(v uint16) *uint16 {
|
||||
return &v
|
||||
}
|
||||
|
||||
func uint32Ptr(v uint32) *uint32 {
|
||||
return &v
|
||||
}
|
||||
|
||||
var cases = []struct {
|
||||
name string
|
||||
frame []byte
|
||||
@@ -33,20 +41,11 @@ func TestEncode(t *testing.T) {
|
||||
for _, ca := range cases {
|
||||
t.Run(ca.name, func(t *testing.T) {
|
||||
e := &Encoder{
|
||||
PayloadType: 0,
|
||||
SampleRate: 8000,
|
||||
SSRC: func() *uint32 {
|
||||
v := uint32(0x9dbb7812)
|
||||
return &v
|
||||
}(),
|
||||
InitialSequenceNumber: func() *uint16 {
|
||||
v := uint16(0x44ed)
|
||||
return &v
|
||||
}(),
|
||||
InitialTimestamp: func() *uint32 {
|
||||
v := uint32(0x88776655)
|
||||
return &v
|
||||
}(),
|
||||
PayloadType: 0,
|
||||
SampleRate: 8000,
|
||||
SSRC: uint32Ptr(0x9dbb7812),
|
||||
InitialSequenceNumber: uint16Ptr(0x44ed),
|
||||
InitialTimestamp: uint32Ptr(0x88776655),
|
||||
}
|
||||
e.Init()
|
||||
|
||||
|
Reference in New Issue
Block a user