mirror of
https://github.com/aler9/gortsplib
synced 2025-11-03 11:11:01 +08:00
move tests
This commit is contained in:
@@ -60,69 +60,3 @@ func TestTrackAACMediaDescription(t *testing.T) {
|
||||
},
|
||||
}, track.MediaDescription())
|
||||
}
|
||||
|
||||
func TestNewTrackAACFromMediaDescription(t *testing.T) {
|
||||
track, err := newTrackAACFromMediaDescription("", 2, &psdp.MediaDescription{
|
||||
MediaName: psdp.MediaName{
|
||||
Media: "audio",
|
||||
Protos: []string{"RTP", "AVP"},
|
||||
Formats: []string{"96"},
|
||||
},
|
||||
Attributes: []psdp.Attribute{
|
||||
{
|
||||
Key: "rtpmap",
|
||||
Value: "96 mpeg4-generic/48000/2",
|
||||
},
|
||||
{
|
||||
Key: "fmtp",
|
||||
Value: "96 profile-level-id=1; mode=AAC-hbr; sizelength=13; indexlength=3; indexdeltalength=3; config=11900810",
|
||||
},
|
||||
{
|
||||
Key: "control",
|
||||
Value: "",
|
||||
},
|
||||
},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "", track.GetControl())
|
||||
require.Equal(t, 2, track.Type())
|
||||
require.Equal(t, 48000, track.ClockRate())
|
||||
require.Equal(t, 2, track.ChannelCount())
|
||||
require.Equal(t, []byte{0x01, 0x02}, track.AOTSpecificConfig())
|
||||
require.Equal(t, 13, track.SizeLength())
|
||||
require.Equal(t, 3, track.IndexLength())
|
||||
require.Equal(t, 3, track.IndexDeltaLength())
|
||||
}
|
||||
|
||||
func TestNewTrackAACFromMediaDescriptionWithoutIndex(t *testing.T) {
|
||||
track, err := newTrackAACFromMediaDescription("", 2, &psdp.MediaDescription{
|
||||
MediaName: psdp.MediaName{
|
||||
Media: "audio",
|
||||
Protos: []string{"RTP", "AVP"},
|
||||
Formats: []string{"96"},
|
||||
},
|
||||
Attributes: []psdp.Attribute{
|
||||
{
|
||||
Key: "rtpmap",
|
||||
Value: "96 mpeg4-generic/48000/2",
|
||||
},
|
||||
{
|
||||
Key: "fmtp",
|
||||
Value: "96 streamtype=3;profile-level-id=14;mode=AAC-hbr;config=1190;sizeLength=13",
|
||||
},
|
||||
{
|
||||
Key: "control",
|
||||
Value: "",
|
||||
},
|
||||
},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "", track.GetControl())
|
||||
require.Equal(t, 2, track.Type())
|
||||
require.Equal(t, 48000, track.ClockRate())
|
||||
require.Equal(t, 2, track.ChannelCount())
|
||||
require.Equal(t, []byte(nil), track.AOTSpecificConfig())
|
||||
require.Equal(t, 13, track.SizeLength())
|
||||
require.Equal(t, 0, track.IndexLength())
|
||||
require.Equal(t, 0, track.IndexDeltaLength())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user