mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
infer object, sample rate, clock of MPEG4AudioLATM from config (#255)
This commit is contained in:
@@ -3,6 +3,7 @@ package formats
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/bluenviron/mediacommon/pkg/codecs/mpeg4audio"
|
||||
"github.com/pion/rtp"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
@@ -10,13 +11,21 @@ import (
|
||||
func TestMPEG4AudioLATMAttributes(t *testing.T) {
|
||||
format := &MPEG4AudioLATM{
|
||||
PayloadTyp: 96,
|
||||
SampleRate: 48000,
|
||||
Channels: 2,
|
||||
Object: 2,
|
||||
ProfileLevelID: 1,
|
||||
Config: []byte{0x01, 0x02, 0x03},
|
||||
Config: &mpeg4audio.StreamMuxConfig{
|
||||
Programs: []*mpeg4audio.StreamMuxConfigProgram{{
|
||||
Layers: []*mpeg4audio.StreamMuxConfigLayer{{
|
||||
AudioSpecificConfig: &mpeg4audio.Config{
|
||||
Type: 2,
|
||||
SampleRate: 44100,
|
||||
ChannelCount: 2,
|
||||
},
|
||||
LatmBufferFullness: 255,
|
||||
}},
|
||||
}},
|
||||
},
|
||||
}
|
||||
require.Equal(t, "MPEG4-audio-latm", format.String())
|
||||
require.Equal(t, 48000, format.ClockRate())
|
||||
require.Equal(t, 44100, format.ClockRate())
|
||||
require.Equal(t, true, format.PTSEqualsDTS(&rtp.Packet{}))
|
||||
}
|
||||
|
Reference in New Issue
Block a user