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

@@ -1,8 +1,6 @@
package formats
import (
"fmt"
"strconv"
"testing"
"github.com/pion/rtp"
@@ -22,23 +20,6 @@ func TestLPCMAttributes(t *testing.T) {
require.Equal(t, true, format.PTSEqualsDTS(&rtp.Packet{}))
}
func TestLPCMMediaDescription(t *testing.T) {
for _, ca := range []int{8, 16, 24} {
t.Run(strconv.FormatInt(int64(ca), 10), func(t *testing.T) {
format := &LPCM{
PayloadTyp: 96,
BitDepth: ca,
SampleRate: 96000,
ChannelCount: 2,
}
rtpmap, fmtp := format.Marshal()
require.Equal(t, fmt.Sprintf("L%d/96000/2", ca), rtpmap)
require.Equal(t, map[string]string(nil), fmtp)
})
}
}
func TestLPCMDecEncoder(t *testing.T) {
format := &LPCM{
PayloadTyp: 96,