forked from bluenviron/gortsplib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
track_vp9_test.go
64 lines (57 loc) · 1.17 KB
/
track_vp9_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package gortsplib
import (
"testing"
psdp "github.com/pion/sdp/v3"
"github.com/stretchr/testify/require"
)
func TestTrackVP9ttributes(t *testing.T) {
track := &TrackVP9{}
require.Equal(t, 90000, track.ClockRate())
require.Equal(t, "", track.GetControl())
}
func TestTrackVP9Clone(t *testing.T) {
maxFR := 123
maxFS := 456
profileID := 789
track := &TrackVP9{
PayloadType: 96,
MaxFR: &maxFR,
MaxFS: &maxFS,
ProfileID: &profileID,
}
clone := track.clone()
require.NotSame(t, track, clone)
require.Equal(t, track, clone)
}
func TestTrackVP9MediaDescription(t *testing.T) {
maxFR := 123
maxFS := 456
profileID := 789
track := &TrackVP9{
PayloadType: 96,
MaxFR: &maxFR,
MaxFS: &maxFS,
ProfileID: &profileID,
}
require.Equal(t, &psdp.MediaDescription{
MediaName: psdp.MediaName{
Media: "video",
Protos: []string{"RTP", "AVP"},
Formats: []string{"96"},
},
Attributes: []psdp.Attribute{
{
Key: "rtpmap",
Value: "96 VP9/90000",
},
{
Key: "fmtp",
Value: "96 max-fr=123;max-fs=456;profile-id=789",
},
{
Key: "control",
Value: "",
},
},
}, track.MediaDescription())
}