Skip to content

Commit

Permalink
Add media type unassigned specific 35 to be evaluated (bluenviron#630)
Browse files Browse the repository at this point in the history
Add some test to make sure the unassigned 35 media type is being considered
  • Loading branch information
JTejedor committed Oct 14, 2024
1 parent 1ca217a commit 3259ab8
Show file tree
Hide file tree
Showing 2 changed files with 35 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 >= 96 && payloadType <= 127:
switch {
// video

Expand Down
33 changes: 33 additions & 0 deletions pkg/format/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,39 @@ var casesFormat = []struct {
"TP-LINK/90000",
nil,
},
{
"bosch video h264",
"v=0\n" +
"o=- 0 0 IN IP4 10.100.14.102\n" +
"s=LIVE VIEW\n" +
"c=IN IP4 0.0.0.0\n" +
"t=0 0\n" +
"a=control:rtsp://10.100.14.102:554/?inst=2&h26x=4\n" +
"m=video 0 RTP/AVP 35\n" +
"a=rtpmap:35 H264/90000\n" +
"a=control:rtsp://10.100.14.102:554/?inst=2&h26x=4&stream=video\n" +
"a=recvonly\n" +
"a=fmtp:35 packetization-mode=1;profile-level-id=4d4029;sprop-parameter-sets=Z01AKY2NYDwBE/LgLcBDQECA,aO44gA==\n",
&H264{
PayloadTyp: 35,
SPS: []byte{
0x67, 0x4d, 0x40, 0x29, 0x8d, 0x8d, 0x60, 0x3c,
0x01, 0x13, 0xf2, 0xe0, 0x2d, 0xc0, 0x43, 0x40,
0x40, 0x80,
},
PPS: []byte{
0x68, 0xee, 0x38, 0x80,
},
PacketizationMode: 1,
},
35,
"H264/90000",
map[string]string{
"packetization-mode": "1",
"profile-level-id": "4D4029",
"sprop-parameter-sets": "Z01AKY2NYDwBE/LgLcBDQECA,aO44gA==",
},
},
}

func TestUnmarshal(t *testing.T) {
Expand Down

0 comments on commit 3259ab8

Please sign in to comment.