mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
add TrackMpegAudio
This commit is contained in:
39
track_mpegaudio_test.go
Normal file
39
track_mpegaudio_test.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package gortsplib
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
psdp "github.com/pion/sdp/v3"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestTrackMpegAudioNew(t *testing.T) {
|
||||
track := NewTrackMpegAudio()
|
||||
require.Equal(t, "", track.GetControl())
|
||||
}
|
||||
|
||||
func TestTrackMpegAudioClone(t *testing.T) {
|
||||
track := NewTrackMpegAudio()
|
||||
|
||||
clone := track.clone()
|
||||
require.NotSame(t, track, clone)
|
||||
require.Equal(t, track, clone)
|
||||
}
|
||||
|
||||
func TestTrackMpegAudioMediaDescription(t *testing.T) {
|
||||
track := NewTrackMpegAudio()
|
||||
|
||||
require.Equal(t, &psdp.MediaDescription{
|
||||
MediaName: psdp.MediaName{
|
||||
Media: "audio",
|
||||
Protos: []string{"RTP", "AVP"},
|
||||
Formats: []string{"14"},
|
||||
},
|
||||
Attributes: []psdp.Attribute{
|
||||
{
|
||||
Key: "control",
|
||||
Value: "",
|
||||
},
|
||||
},
|
||||
}, track.MediaDescription())
|
||||
}
|
Reference in New Issue
Block a user