mirror of
https://github.com/aler9/gortsplib
synced 2025-10-04 06:46:42 +08:00
add MP4A-LATM decoder and encoder (#299)
This commit is contained in:
@@ -23,12 +23,16 @@ func TestG711Attributes(t *testing.T) {
|
||||
func TestG711DecEncoder(t *testing.T) {
|
||||
format := &G711{}
|
||||
|
||||
enc := format.CreateEncoder()
|
||||
enc, err := format.CreateEncoder2()
|
||||
require.NoError(t, err)
|
||||
|
||||
pkt, err := enc.Encode([]byte{0x01, 0x02, 0x03, 0x04}, 0)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, format.PayloadType(), pkt.PayloadType)
|
||||
|
||||
dec := format.CreateDecoder()
|
||||
dec, err := format.CreateDecoder2()
|
||||
require.NoError(t, err)
|
||||
|
||||
byts, _, err := dec.Decode(pkt)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, []byte{0x01, 0x02, 0x03, 0x04}, byts)
|
||||
|
Reference in New Issue
Block a user