mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
rewrite unmarshaling interface and tests of formats (#238)
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user