move tests

This commit is contained in:
aler9
2022-04-15 12:57:20 +02:00
parent cdd17453bd
commit 49e13c6c7b
4 changed files with 55 additions and 88 deletions

View File

@@ -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())
}