mirror of
https://github.com/aler9/gortsplib
synced 2025-10-04 14:52:46 +08:00

* split tracks from medias * move tracks into dedicated package * move media into dedicated package * edit Medias.Marshal() in order to return SDP * add medias.Find() and simplify examples * improve coverage * fix rebase errors * replace TrackIDs with MediaIDs * implement media-specific and track-specific callbacks for reading RTCP and RTP packets * rename publish into record, read into play * add v2 tag * rename tracks into formats
31 lines
601 B
Go
31 lines
601 B
Go
package format
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestG722Attributes(t *testing.T) {
|
|
format := &G722{}
|
|
require.Equal(t, "G722", format.String())
|
|
require.Equal(t, 8000, format.ClockRate())
|
|
require.Equal(t, uint8(9), format.PayloadType())
|
|
}
|
|
|
|
func TestG722Clone(t *testing.T) {
|
|
format := &G722{}
|
|
|
|
clone := format.Clone()
|
|
// require.NotSame(t, format, clone)
|
|
require.Equal(t, format, clone)
|
|
}
|
|
|
|
func TestG722MediaDescription(t *testing.T) {
|
|
format := &G722{}
|
|
|
|
rtpmap, fmtp := format.Marshal()
|
|
require.Equal(t, "G722/8000", rtpmap)
|
|
require.Equal(t, "", fmtp)
|
|
}
|