mirror of
https://github.com/aler9/gortsplib
synced 2025-10-16 12:10:48 +08:00
add base class for tracks
This commit is contained in:
@@ -31,26 +31,13 @@ func TestTrackGenericNewErrors(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestTrackGenericClone(t *testing.T) {
|
||||
track, err := newTrackGenericFromMediaDescription(
|
||||
&psdp.MediaDescription{
|
||||
MediaName: psdp.MediaName{
|
||||
Media: "video",
|
||||
Port: psdp.RangedPort{Value: 0},
|
||||
Protos: []string{"RTP", "AVP"},
|
||||
Formats: []string{"98", "96"},
|
||||
},
|
||||
Attributes: []psdp.Attribute{
|
||||
{
|
||||
Key: "rtpmap",
|
||||
Value: "98 H265/90000",
|
||||
},
|
||||
{
|
||||
Key: "fmtp",
|
||||
Value: "98 profile-id=1; sprop-vps=QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ; " +
|
||||
"sprop-sps=QgEBAWAAAAMAAAMAAAMAAAMAlqADwIAQ5Za5JMmuWcBSSgAAB9AAAHUwgkA=; sprop-pps=RAHgdrAwxmQ=",
|
||||
},
|
||||
},
|
||||
})
|
||||
track, err := NewTrackGeneric(
|
||||
"video",
|
||||
[]string{"100", "101"},
|
||||
"98 H265/90000",
|
||||
"98 profile-id=1; sprop-vps=QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ; "+
|
||||
"sprop-sps=QgEBAWAAAAMAAAMAAAMAAAMAlqADwIAQ5Za5JMmuWcBSSgAAB9AAAHUwgkA=; sprop-pps=RAHgdrAwxmQ=",
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
clone := track.clone()
|
||||
|
Reference in New Issue
Block a user