mirror of
https://github.com/aler9/gortsplib
synced 2025-10-04 23:02:45 +08:00
39 lines
683 B
Go
39 lines
683 B
Go
package gortsplib
|
|
|
|
import (
|
|
"testing"
|
|
|
|
psdp "github.com/pion/sdp/v3"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestTrackJPEGClone(t *testing.T) {
|
|
track := &TrackJPEG{}
|
|
|
|
clone := track.clone()
|
|
require.NotSame(t, track, clone)
|
|
require.Equal(t, track, clone)
|
|
}
|
|
|
|
func TestTrackJPEGMediaDescription(t *testing.T) {
|
|
track := &TrackJPEG{}
|
|
|
|
require.Equal(t, &psdp.MediaDescription{
|
|
MediaName: psdp.MediaName{
|
|
Media: "video",
|
|
Protos: []string{"RTP", "AVP"},
|
|
Formats: []string{"26"},
|
|
},
|
|
Attributes: []psdp.Attribute{
|
|
{
|
|
Key: "rtpmap",
|
|
Value: "26 JPEG/90000",
|
|
},
|
|
{
|
|
Key: "control",
|
|
Value: "",
|
|
},
|
|
},
|
|
}, track.MediaDescription())
|
|
}
|