rewrite unmarshaling interface and tests of formats (#238)

This commit is contained in:
Alessandro Ros
2023-04-10 15:07:59 +02:00
committed by GitHub
parent c0c2dd68d3
commit 9ca5e130fe
53 changed files with 911 additions and 1383 deletions

View File

@@ -26,27 +26,3 @@ func TestGenericAttributes(t *testing.T) {
require.Equal(t, uint8(98), format.PayloadType())
require.Equal(t, true, format.PTSEqualsDTS(&rtp.Packet{}))
}
func TestGenericMediaDescription(t *testing.T) {
format := &Generic{
PayloadTyp: 98,
RTPMap: "H265/90000",
FMTP: map[string]string{
"profile-id": "1",
"sprop-vps": "QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ",
"sprop-sps": "QgEBAWAAAAMAAAMAAAMAAAMAlqADwIAQ5Za5JMmuWcBSSgAAB9AAAHUwgkA=",
"sprop-pps": "RAHgdrAwxmQ=",
},
}
err := format.Init()
require.NoError(t, err)
rtpmap, fmtp := format.Marshal()
require.Equal(t, "H265/90000", rtpmap)
require.Equal(t, map[string]string{
"profile-id": "1",
"sprop-vps": "QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ",
"sprop-sps": "QgEBAWAAAAMAAAMAAAMAAAMAlqADwIAQ5Za5JMmuWcBSSgAAB9AAAHUwgkA=",
"sprop-pps": "RAHgdrAwxmQ=",
}, fmtp)
}