Skip to content

Commit

Permalink
Add media type unassigned interval 35 to 71 to be evaluated as dynami…
Browse files Browse the repository at this point in the history
…c range (96-127)

Add some test to make sure the unassigned interval is being considered
  • Loading branch information
JTejedor committed Oct 9, 2024
1 parent 1ca217a commit a5d0939
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/format/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@ func Unmarshal(md *psdp.MediaDescription, payloadTypeStr string) (Format, error)

/*
* dynamic payload types
* non assigned payload types
**/

case payloadType >= 96 && payloadType <= 127:
case payloadType >= 35 && payloadType <= 71, payloadType >= 96 && payloadType <= 127:
switch {
// video

Expand Down
69 changes: 69 additions & 0 deletions pkg/format/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,36 @@ var casesFormat = []struct {
"sprop-parameter-sets": "Z2QAH6zZQFAFuwFsgAAAAwCAAAAeB4wYyw==,aOvjyyLA",
},
},
{
"video h264 vlc rtsp server",
"video",
35,

Check failure on line 825 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use 35 (constant of type int) as Format value in struct literal: int does not implement Format (missing method ClockRate)

Check failure on line 825 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.20)

cannot use 35 (constant of type int) as Format value in struct literal: int does not implement Format (missing method ClockRate)

Check failure on line 825 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.21)

cannot use 35 (constant of type int) as Format value in struct literal: int does not implement Format (missing method ClockRate)

Check failure on line 825 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.22)

cannot use 35 (constant of type int) as Format value in struct literal: int does not implement Format (missing method ClockRate)
"H264/90000",

Check failure on line 826 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use "H264/90000" (untyped string constant) as uint8 value in struct literal

Check failure on line 826 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.20)

cannot use "H264/90000" (untyped string constant) as uint8 value in struct literal

Check failure on line 826 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.21)

cannot use "H264/90000" (untyped string constant) as uint8 value in struct literal

Check failure on line 826 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.22)

cannot use "H264/90000" (untyped string constant) as uint8 value in struct literal
map[string]string{

Check failure on line 827 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use map[string]string{…} (value of type map[string]string) as string value in struct literal

Check failure on line 827 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.20)

cannot use map[string]string{…} (value of type map[string]string) as string value in struct literal

Check failure on line 827 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.21)

cannot use map[string]string{…} (value of type map[string]string) as string value in struct literal

Check failure on line 827 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.22)

cannot use map[string]string{…} (value of type map[string]string) as string value in struct literal
"packetization-mode": "1",
"profile-level-id": "64001f",
"sprop-parameter-sets": "Z2QAH6zZQFAFuwFsgAAAAwCAAAAeB4wYyw==,aOvjyyLA",
},
&H264{

Check failure on line 832 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use &H264{…} (value of type *H264) as map[string]string value in struct literal

Check failure on line 832 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.20)

cannot use &H264{…} (value of type *H264) as map[string]string value in struct literal

Check failure on line 832 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.21)

cannot use &H264{…} (value of type *H264) as map[string]string value in struct literal

Check failure on line 832 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.22)

cannot use &H264{…} (value of type *H264) as map[string]string value in struct literal
PayloadTyp: 35,
SPS: []byte{
0x67, 0x64, 0x00, 0x1f, 0xac, 0xd9, 0x40, 0x50,
0x05, 0xbb, 0x01, 0x6c, 0x80, 0x00, 0x00, 0x03,
0x00, 0x80, 0x00, 0x00, 0x1e, 0x07, 0x8c, 0x18,
0xcb,
},
PPS: []byte{
0x68, 0xeb, 0xe3, 0xcb, 0x22, 0xc0,
},
PacketizationMode: 1,
},
"H264/90000",

Check failure on line 845 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

too many values in struct literal of type struct{name string; in string; dec Format; encPayloadType uint8; encRtpMap string; encFmtp map[string]string}

Check failure on line 845 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.20)

too many values in struct literal of type struct{name string; in string; dec Format; encPayloadType uint8; encRtpMap string; encFmtp map[string]string}

Check failure on line 845 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.21)

too many values in struct literal of type struct{name string; in string; dec Format; encPayloadType uint8; encRtpMap string; encFmtp map[string]string}

Check failure on line 845 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.22)

too many values in struct literal of type struct{name string; in string; dec Format; encPayloadType uint8; encRtpMap string; encFmtp map[string]string}
map[string]string{
"packetization-mode": "1",
"profile-level-id": "64001F",
"sprop-parameter-sets": "Z2QAH6zZQFAFuwFsgAAAAwCAAAAeB4wYyw==,aOvjyyLA",
},
},
{
"video h264 sprop-parameter-sets with extra data",
"v=0\n" +
Expand Down Expand Up @@ -964,6 +994,45 @@ var casesFormat = []struct {
"sprop-max-don-diff": "2",
},
},
{
"video h265",
"video",
35,

Check failure on line 1000 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use 35 (constant of type int) as Format value in struct literal: int does not implement Format (missing method ClockRate)

Check failure on line 1000 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.20)

cannot use 35 (constant of type int) as Format value in struct literal: int does not implement Format (missing method ClockRate)

Check failure on line 1000 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.21)

cannot use 35 (constant of type int) as Format value in struct literal: int does not implement Format (missing method ClockRate)

Check failure on line 1000 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.22)

cannot use 35 (constant of type int) as Format value in struct literal: int does not implement Format (missing method ClockRate)
"H265/90000",

Check failure on line 1001 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use "H265/90000" (untyped string constant) as uint8 value in struct literal

Check failure on line 1001 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.20)

cannot use "H265/90000" (untyped string constant) as uint8 value in struct literal

Check failure on line 1001 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.21)

cannot use "H265/90000" (untyped string constant) as uint8 value in struct literal

Check failure on line 1001 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.22)

cannot use "H265/90000" (untyped string constant) as uint8 value in struct literal
map[string]string{

Check failure on line 1002 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use map[string]string{…} (value of type map[string]string) as string value in struct literal

Check failure on line 1002 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.20)

cannot use map[string]string{…} (value of type map[string]string) as string value in struct literal

Check failure on line 1002 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.21)

cannot use map[string]string{…} (value of type map[string]string) as string value in struct literal

Check failure on line 1002 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.22)

cannot use map[string]string{…} (value of type map[string]string) as string value in struct literal
"sprop-vps": "QAEMAf//AWAAAAMAkAAAAwAAAwB4mZgJ",
"sprop-sps": "QgEBAWAAAAMAkAAAAwAAAwB4oAPAgBDllmZpJMrgEAAAAwAQAAADAeCA",
"sprop-pps": "RAHBcrRiQA==",
"sprop-max-don-diff": "2",
},
&H265{

Check failure on line 1008 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

cannot use &H265{…} (value of type *H265) as map[string]string value in struct literal

Check failure on line 1008 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.20)

cannot use &H265{…} (value of type *H265) as map[string]string value in struct literal

Check failure on line 1008 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.21)

cannot use &H265{…} (value of type *H265) as map[string]string value in struct literal

Check failure on line 1008 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.22)

cannot use &H265{…} (value of type *H265) as map[string]string value in struct literal
PayloadTyp: 35,
VPS: []byte{
0x40, 0x1, 0xc, 0x1, 0xff, 0xff, 0x1, 0x60,
0x0, 0x0, 0x3, 0x0, 0x90, 0x0, 0x0, 0x3,
0x0, 0x0, 0x3, 0x0, 0x78, 0x99, 0x98, 0x9,
},
SPS: []byte{
0x42, 0x1, 0x1, 0x1, 0x60, 0x0, 0x0, 0x3,
0x0, 0x90, 0x0, 0x0, 0x3, 0x0, 0x0, 0x3,
0x0, 0x78, 0xa0, 0x3, 0xc0, 0x80, 0x10, 0xe5,
0x96, 0x66, 0x69, 0x24, 0xca, 0xe0, 0x10, 0x0,
0x0, 0x3, 0x0, 0x10, 0x0, 0x0, 0x3, 0x1,
0xe0, 0x80,
},
PPS: []byte{
0x44, 0x1, 0xc1, 0x72, 0xb4, 0x62, 0x40,
},
MaxDONDiff: 2,
},
"H265/90000",

Check failure on line 1028 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.20)

too many values in struct literal of type struct{name string; in string; dec Format; encPayloadType uint8; encRtpMap string; encFmtp map[string]string}

Check failure on line 1028 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.21)

too many values in struct literal of type struct{name string; in string; dec Format; encPayloadType uint8; encRtpMap string; encFmtp map[string]string}

Check failure on line 1028 in pkg/format/format_test.go

View workflow job for this annotation

GitHub Actions / test (1.22)

too many values in struct literal of type struct{name string; in string; dec Format; encPayloadType uint8; encRtpMap string; encFmtp map[string]string}
map[string]string{
"sprop-vps": "QAEMAf//AWAAAAMAkAAAAwAAAwB4mZgJ",
"sprop-sps": "QgEBAWAAAAMAkAAAAwAAAwB4oAPAgBDllmZpJMrgEAAAAwAQAAADAeCA",
"sprop-pps": "RAHBcrRiQA==",
"sprop-max-don-diff": "2",
},
},
{
"video h265 annexb",
"v=0\n" +
Expand Down

0 comments on commit a5d0939

Please sign in to comment.