remove suffix from new functions

This commit is contained in:
aler9
2023-08-14 11:14:07 +02:00
parent 1a3e6ad092
commit ca87733ded
53 changed files with 142 additions and 142 deletions

View File

@@ -1294,7 +1294,7 @@ func TestClientPlayAutomaticProtocol(t *testing.T) {
require.NoError(t, err)
require.Equal(t, base.Describe, req.Method)
nonce, err := auth.GenerateNonce2()
nonce, err := auth.GenerateNonce()
require.NoError(t, err)
err = conn.WriteResponse(&base.Response{
@@ -1408,7 +1408,7 @@ func TestClientPlayAutomaticProtocol(t *testing.T) {
require.NoError(t, err)
require.Equal(t, base.Setup, req.Method)
nonce, err := auth.GenerateNonce2()
nonce, err := auth.GenerateNonce()
require.NoError(t, err)
err = conn.WriteResponse(&base.Response{

View File

@@ -194,7 +194,7 @@ func TestClientAuth(t *testing.T) {
require.NoError(t, err)
require.Equal(t, base.Describe, req.Method)
nonce, err := auth.GenerateNonce2()
nonce, err := auth.GenerateNonce()
require.NoError(t, err)
err = conn.WriteResponse(&base.Response{

View File

@@ -44,7 +44,7 @@ func main() {
}
// create decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}

View File

@@ -44,7 +44,7 @@ func main() {
}
// create decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}

View File

@@ -71,7 +71,7 @@ func main() {
}
// setup RTP/H264 -> H264 decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}
@@ -101,7 +101,7 @@ func main() {
saveCount := 0
c.OnPacketRTP(medi, forma, func(pkt *rtp.Packet) {
// extract access units from RTP packets
au, _, err := rtpDec.DecodeUntilMarker(pkt)
au, _, err := rtpDec.Decode(pkt)
if err != nil {
if err != rtph264.ErrNonStartingPacketAndNoPrevious && err != rtph264.ErrMorePacketsNeeded {
log.Printf("ERR: %v", err)

View File

@@ -45,7 +45,7 @@ func main() {
}
// setup RTP/H264 -> H264 decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}
@@ -65,7 +65,7 @@ func main() {
// called when a RTP packet arrives
c.OnPacketRTP(medi, forma, func(pkt *rtp.Packet) {
// extract access unit from RTP packets
au, pts, err := rtpDec.DecodeUntilMarker(pkt)
au, pts, err := rtpDec.Decode(pkt)
if err != nil {
if err != rtph264.ErrNonStartingPacketAndNoPrevious && err != rtph264.ErrMorePacketsNeeded {
log.Printf("ERR: %v", err)

View File

@@ -48,7 +48,7 @@ func main() {
}
// setup RTP/H264 -> H264 decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}
@@ -77,7 +77,7 @@ func main() {
// called when a RTP packet arrives
c.OnPacketRTP(medi, forma, func(pkt *rtp.Packet) {
// extract access units from RTP packets
au, pts, err := rtpDec.DecodeUntilMarker(pkt)
au, pts, err := rtpDec.Decode(pkt)
if err != nil {
if err != rtph264.ErrNonStartingPacketAndNoPrevious && err != rtph264.ErrMorePacketsNeeded {
log.Printf("ERR: %v", err)

View File

@@ -45,7 +45,7 @@ func main() {
}
// setup RTP/H265 -> H265 decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}
@@ -59,7 +59,7 @@ func main() {
// called when a RTP packet arrives
c.OnPacketRTP(medi, forma, func(pkt *rtp.Packet) {
// extract access units from RTP packets
au, pts, err := rtpDec.DecodeUntilMarker(pkt)
au, pts, err := rtpDec.Decode(pkt)
if err != nil {
if err != rtph265.ErrNonStartingPacketAndNoPrevious && err != rtph265.ErrMorePacketsNeeded {
log.Printf("ERR: %v", err)

View File

@@ -44,7 +44,7 @@ func main() {
}
// create decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}

View File

@@ -48,7 +48,7 @@ func main() {
}
// create decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}

View File

@@ -44,7 +44,7 @@ func main() {
}
// setup RTP/MPEG4-audio -> MPEG4-audio decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}

View File

@@ -44,7 +44,7 @@ func main() {
}
// create decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}

View File

@@ -44,7 +44,7 @@ func main() {
}
// create decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}

View File

@@ -45,7 +45,7 @@ func main() {
}
// create decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}

View File

@@ -45,7 +45,7 @@ func main() {
}
// create decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}

View File

@@ -76,7 +76,7 @@ func (sh *serverHandler) OnAnnounce(ctx *gortsplib.ServerHandlerOnAnnounceCtx) (
}
// setup RTP/H264 -> H264 decoder
rtpDec, err := forma.CreateDecoder2()
rtpDec, err := forma.CreateDecoder()
if err != nil {
panic(err)
}

View File

@@ -47,7 +47,7 @@ func TestAuth(t *testing.T) {
}
t.Run(c1.name+"_"+conf, func(t *testing.T) {
nonce, err := GenerateNonce2()
nonce, err := GenerateNonce()
require.NoError(t, err)
se, err := NewSender(
@@ -105,7 +105,7 @@ func TestAuthVLC(t *testing.T) {
"rtsp://myhost/mypath/test?testing/trackID=0",
},
} {
nonce, err := GenerateNonce2()
nonce, err := GenerateNonce()
require.NoError(t, err)
se, err := NewSender(

View File

@@ -17,8 +17,8 @@ func md5Hex(in string) string {
return hex.EncodeToString(h.Sum(nil))
}
// GenerateNonce2 generates a nonce that can be used in Validate().
func GenerateNonce2() (string, error) {
// GenerateNonce generates a nonce that can be used in Validate().
func GenerateNonce() (string, error) {
byts := make([]byte, 16)
_, err := rand.Read(byts)
if err != nil {

View File

@@ -97,8 +97,8 @@ func (f *AV1) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *AV1) CreateDecoder2() (*rtpav1.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *AV1) CreateDecoder() (*rtpav1.Decoder, error) {
d := &rtpav1.Decoder{}
err := d.Init()
@@ -109,8 +109,8 @@ func (f *AV1) CreateDecoder2() (*rtpav1.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *AV1) CreateEncoder2() (*rtpav1.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *AV1) CreateEncoder() (*rtpav1.Encoder, error) {
e := &rtpav1.Encoder{
PayloadType: f.PayloadTyp,
}

View File

@@ -19,17 +19,17 @@ func TestAV1Attributes(t *testing.T) {
func TestAV1DecEncoder(t *testing.T) {
format := &AV1{}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkts, err := enc.Encode([][]byte{{0x01, 0x02, 0x03, 0x04}}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.DecodeUntilMarker(pkts[0])
byts, _, err := dec.Decode(pkts[0])
require.NoError(t, err)
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
}

View File

@@ -54,8 +54,8 @@ func (f *G711) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *G711) CreateDecoder2() (*rtpsimpleaudio.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *G711) CreateDecoder() (*rtpsimpleaudio.Decoder, error) {
d := &rtpsimpleaudio.Decoder{
SampleRate: 8000,
}
@@ -68,8 +68,8 @@ func (f *G711) CreateDecoder2() (*rtpsimpleaudio.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *G711) CreateEncoder2() (*rtpsimpleaudio.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *G711) CreateEncoder() (*rtpsimpleaudio.Encoder, error) {
e := &rtpsimpleaudio.Encoder{
PayloadType: f.PayloadType(),
SampleRate: 8000,

View File

@@ -23,14 +23,14 @@ func TestG711Attributes(t *testing.T) {
func TestG711DecEncoder(t *testing.T) {
format := &G711{}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkt, err := enc.Encode([]byte{0x01, 0x02, 0x03, 0x04}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkt.PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.Decode(pkt)

View File

@@ -44,8 +44,8 @@ func (f *G722) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *G722) CreateDecoder2() (*rtpsimpleaudio.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *G722) CreateDecoder() (*rtpsimpleaudio.Decoder, error) {
d := &rtpsimpleaudio.Decoder{
SampleRate: 8000,
}
@@ -58,8 +58,8 @@ func (f *G722) CreateDecoder2() (*rtpsimpleaudio.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *G722) CreateEncoder2() (*rtpsimpleaudio.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *G722) CreateEncoder() (*rtpsimpleaudio.Encoder, error) {
e := &rtpsimpleaudio.Encoder{
PayloadType: 9,
SampleRate: 8000,

View File

@@ -17,14 +17,14 @@ func TestG722Attributes(t *testing.T) {
func TestG722DecEncoder(t *testing.T) {
format := &G722{}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkt, err := enc.Encode([]byte{0x01, 0x02, 0x03, 0x04}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkt.PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.Decode(pkt)

View File

@@ -165,8 +165,8 @@ func (f *H264) PTSEqualsDTS(pkt *rtp.Packet) bool {
return false
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *H264) CreateDecoder2() (*rtph264.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *H264) CreateDecoder() (*rtph264.Decoder, error) {
d := &rtph264.Decoder{
PacketizationMode: f.PacketizationMode,
}
@@ -179,8 +179,8 @@ func (f *H264) CreateDecoder2() (*rtph264.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *H264) CreateEncoder2() (*rtph264.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *H264) CreateEncoder() (*rtph264.Encoder, error) {
e := &rtph264.Encoder{
PayloadType: f.PayloadTyp,
PacketizationMode: f.PacketizationMode,

View File

@@ -47,17 +47,17 @@ func TestH264PTSEqualsDTS(t *testing.T) {
func TestH264DecEncoder(t *testing.T) {
format := &H264{}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkts, err := enc.Encode([][]byte{{0x01, 0x02, 0x03, 0x04}}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.DecodeUntilMarker(pkts[0])
byts, _, err := dec.Decode(pkts[0])
require.NoError(t, err)
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
}

View File

@@ -164,8 +164,8 @@ func (f *H265) PTSEqualsDTS(pkt *rtp.Packet) bool {
return false
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *H265) CreateDecoder2() (*rtph265.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *H265) CreateDecoder() (*rtph265.Decoder, error) {
d := &rtph265.Decoder{
MaxDONDiff: f.MaxDONDiff,
}
@@ -178,8 +178,8 @@ func (f *H265) CreateDecoder2() (*rtph265.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *H265) CreateEncoder2() (*rtph265.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *H265) CreateEncoder() (*rtph265.Encoder, error) {
e := &rtph265.Encoder{
PayloadType: f.PayloadTyp,
MaxDONDiff: f.MaxDONDiff,

View File

@@ -50,17 +50,17 @@ func TestH265PTSEqualsDTS(t *testing.T) {
func TestH265DecEncoder(t *testing.T) {
format := &H265{}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkts, err := enc.Encode([][]byte{{0x01, 0x02, 0x03, 0x04}}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.DecodeUntilMarker(pkts[0])
byts, _, err := dec.Decode(pkts[0])
require.NoError(t, err)
require.Equal(t, [][]byte{{0x01, 0x02, 0x03, 0x04}}, byts)
}

View File

@@ -96,8 +96,8 @@ func (f *LPCM) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *LPCM) CreateDecoder2() (*rtplpcm.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *LPCM) CreateDecoder() (*rtplpcm.Decoder, error) {
d := &rtplpcm.Decoder{
BitDepth: f.BitDepth,
SampleRate: f.SampleRate,
@@ -112,8 +112,8 @@ func (f *LPCM) CreateDecoder2() (*rtplpcm.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *LPCM) CreateEncoder2() (*rtplpcm.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *LPCM) CreateEncoder() (*rtplpcm.Encoder, error) {
e := &rtplpcm.Encoder{
PayloadType: f.PayloadTyp,
BitDepth: f.BitDepth,

View File

@@ -27,14 +27,14 @@ func TestLPCMDecEncoder(t *testing.T) {
ChannelCount: 2,
}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkts, err := enc.Encode([]byte{0x01, 0x02, 0x03, 0x04}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.Decode(pkts[0])

View File

@@ -44,8 +44,8 @@ func (f *MJPEG) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *MJPEG) CreateDecoder2() (*rtpmjpeg.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *MJPEG) CreateDecoder() (*rtpmjpeg.Decoder, error) {
d := &rtpmjpeg.Decoder{}
err := d.Init()
@@ -56,8 +56,8 @@ func (f *MJPEG) CreateDecoder2() (*rtpmjpeg.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *MJPEG) CreateEncoder2() (*rtpmjpeg.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *MJPEG) CreateEncoder() (*rtpmjpeg.Encoder, error) {
e := &rtpmjpeg.Encoder{}
err := e.Init()

View File

@@ -278,14 +278,14 @@ func TestMJPEGDecEncoder(t *testing.T) {
0xe7, 0x7f, 0xaa, 0xff, 0xff, 0xd9,
}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkts, err := enc.Encode(b, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
var byts []byte

View File

@@ -44,8 +44,8 @@ func (f *MPEG1Audio) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *MPEG1Audio) CreateDecoder2() (*rtpmpeg1audio.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *MPEG1Audio) CreateDecoder() (*rtpmpeg1audio.Decoder, error) {
d := &rtpmpeg1audio.Decoder{}
err := d.Init()
@@ -56,8 +56,8 @@ func (f *MPEG1Audio) CreateDecoder2() (*rtpmpeg1audio.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *MPEG1Audio) CreateEncoder2() (*rtpmpeg1audio.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *MPEG1Audio) CreateEncoder() (*rtpmpeg1audio.Encoder, error) {
e := &rtpmpeg1audio.Encoder{}
err := e.Init()

View File

@@ -17,7 +17,7 @@ func TestMPEG1AudioAttributes(t *testing.T) {
func TestMPEG1AudioDecEncoder(t *testing.T) {
format := &MPEG1Audio{}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkts, err := enc.Encode([][]byte{{
@@ -37,7 +37,7 @@ func TestMPEG1AudioDecEncoder(t *testing.T) {
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.Decode(pkts[0])

View File

@@ -169,8 +169,8 @@ func (f *MPEG4AudioGeneric) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *MPEG4AudioGeneric) CreateDecoder2() (*rtpmpeg4audio.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *MPEG4AudioGeneric) CreateDecoder() (*rtpmpeg4audio.Decoder, error) {
d := &rtpmpeg4audio.Decoder{
SampleRate: f.Config.SampleRate,
SizeLength: f.SizeLength,
@@ -186,8 +186,8 @@ func (f *MPEG4AudioGeneric) CreateDecoder2() (*rtpmpeg4audio.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *MPEG4AudioGeneric) CreateEncoder2() (*rtpmpeg4audio.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *MPEG4AudioGeneric) CreateEncoder() (*rtpmpeg4audio.Encoder, error) {
e := &rtpmpeg4audio.Encoder{
PayloadType: f.PayloadTyp,
SampleRate: f.Config.SampleRate,

View File

@@ -39,14 +39,14 @@ func TestMPEG4AudioGenericDecEncoder(t *testing.T) {
IndexDeltaLength: 3,
}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkts, err := enc.Encode([][]byte{{0x01, 0x02, 0x03, 0x04}}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.Decode(pkts[0])

View File

@@ -157,8 +157,8 @@ func (f *MPEG4AudioLATM) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *MPEG4AudioLATM) CreateDecoder2() (*rtpmpeg4audiolatm.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *MPEG4AudioLATM) CreateDecoder() (*rtpmpeg4audiolatm.Decoder, error) {
d := &rtpmpeg4audiolatm.Decoder{
Config: f.Config,
}
@@ -171,8 +171,8 @@ func (f *MPEG4AudioLATM) CreateDecoder2() (*rtpmpeg4audiolatm.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *MPEG4AudioLATM) CreateEncoder2() (*rtpmpeg4audiolatm.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *MPEG4AudioLATM) CreateEncoder() (*rtpmpeg4audiolatm.Encoder, error) {
e := &rtpmpeg4audiolatm.Encoder{
PayloadType: f.PayloadTyp,
Config: f.Config,

View File

@@ -48,14 +48,14 @@ func TestMPEG4AudioLATMDecEncoder(t *testing.T) {
},
}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkts, err := enc.Encode([]byte{0x01, 0x02, 0x03, 0x04}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.Decode(pkts[0])

View File

@@ -86,8 +86,8 @@ func (f *MPEG4VideoES) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *MPEG4VideoES) CreateDecoder2() (*rtpmpeg4video.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *MPEG4VideoES) CreateDecoder() (*rtpmpeg4video.Decoder, error) {
d := &rtpmpeg4video.Decoder{}
err := d.Init()
@@ -98,8 +98,8 @@ func (f *MPEG4VideoES) CreateDecoder2() (*rtpmpeg4video.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *MPEG4VideoES) CreateEncoder2() (*rtpmpeg4video.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *MPEG4VideoES) CreateEncoder() (*rtpmpeg4video.Encoder, error) {
e := &rtpmpeg4video.Encoder{
PayloadType: f.PayloadTyp,
}

View File

@@ -23,14 +23,14 @@ func TestMPEG4VideoESDecEncoder(t *testing.T) {
PayloadTyp: 96,
}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkts, err := enc.Encode([]byte{0x01, 0x02, 0x03, 0x04}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.Decode(pkts[0])

View File

@@ -86,8 +86,8 @@ func (f *Opus) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *Opus) CreateDecoder2() (*rtpsimpleaudio.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *Opus) CreateDecoder() (*rtpsimpleaudio.Decoder, error) {
d := &rtpsimpleaudio.Decoder{
SampleRate: 48000,
}
@@ -100,8 +100,8 @@ func (f *Opus) CreateDecoder2() (*rtpsimpleaudio.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *Opus) CreateEncoder2() (*rtpsimpleaudio.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *Opus) CreateEncoder() (*rtpsimpleaudio.Encoder, error) {
e := &rtpsimpleaudio.Encoder{
PayloadType: f.PayloadTyp,
SampleRate: 48000,

View File

@@ -20,14 +20,14 @@ func TestOpusAttributes(t *testing.T) {
func TestOpusDecEncoder(t *testing.T) {
format := &Opus{}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkt, err := enc.Encode([]byte{0x01, 0x02, 0x03, 0x04}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkt.PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.Decode(pkt)

View File

@@ -39,7 +39,7 @@ type Decoder struct {
fragmentsSize int
fragments [][]byte
// for DecodeUntilMarker()
// for Decode()
frameBuffer [][]byte
frameBufferLen int
frameBufferSize int
@@ -125,8 +125,8 @@ func (d *Decoder) decodeOBUs(pkt *rtp.Packet) ([][]byte, time.Duration, error) {
return obus, d.timeDecoder.Decode(pkt.Timestamp), nil
}
// DecodeUntilMarker decodes a temporal unit from a RTP packet.
func (d *Decoder) DecodeUntilMarker(pkt *rtp.Packet) ([][]byte, time.Duration, error) {
// Decode decodes a temporal unit from a RTP packet.
func (d *Decoder) Decode(pkt *rtp.Packet) ([][]byte, time.Duration, error) {
obus, pts, err := d.decodeOBUs(pkt)
if err != nil {
return nil, 0, err

View File

@@ -18,7 +18,7 @@ func TestDecode(t *testing.T) {
var obus [][]byte
for _, pkt := range ca.pkts {
addOBUs, _, err := d.DecodeUntilMarker(pkt)
addOBUs, _, err := d.Decode(pkt)
if err == ErrMorePacketsNeeded {
continue
}
@@ -38,7 +38,7 @@ func TestDecoderErrorLimit(t *testing.T) {
require.NoError(t, err)
for i := 0; i <= av1.MaxOBUsPerTemporalUnit; i++ {
_, _, err = d.DecodeUntilMarker(&rtp.Packet{
_, _, err = d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: false,
@@ -59,7 +59,7 @@ func FuzzDecoder(f *testing.F) {
d := &Decoder{}
d.Init() //nolint:errcheck
d.DecodeUntilMarker(&rtp.Packet{ //nolint:errcheck
d.Decode(&rtp.Packet{ //nolint:errcheck
Header: rtp.Header{
Version: 2,
Marker: am,
@@ -71,7 +71,7 @@ func FuzzDecoder(f *testing.F) {
Payload: a,
})
d.DecodeUntilMarker(&rtp.Packet{ //nolint:errcheck
d.Decode(&rtp.Packet{ //nolint:errcheck
Header: rtp.Header{
Version: 2,
Marker: bm,

View File

@@ -43,7 +43,7 @@ type Decoder struct {
fragments [][]byte
annexBMode bool
// for DecodeUntilMarker()
// for Decode()
frameBuffer [][]byte
frameBufferLen int
frameBufferSize int
@@ -169,8 +169,8 @@ func (d *Decoder) decodeNALUs(pkt *rtp.Packet) ([][]byte, time.Duration, error)
return nalus, d.timeDecoder.Decode(pkt.Timestamp), nil
}
// DecodeUntilMarker decodes an access unit from a RTP packet.
func (d *Decoder) DecodeUntilMarker(pkt *rtp.Packet) ([][]byte, time.Duration, error) {
// Decode decodes an access unit from a RTP packet.
func (d *Decoder) Decode(pkt *rtp.Packet) ([][]byte, time.Duration, error) {
nalus, pts, err := d.decodeNALUs(pkt)
if err != nil {
return nil, 0, err

View File

@@ -21,7 +21,7 @@ func TestDecode(t *testing.T) {
for _, pkt := range ca.pkts {
clone := pkt.Clone()
addNALUs, _, err := d.DecodeUntilMarker(pkt)
addNALUs, _, err := d.Decode(pkt)
// test input integrity
require.Equal(t, clone, pkt)
@@ -44,7 +44,7 @@ func TestDecodeCorruptedFragment(t *testing.T) {
err := d.Init()
require.NoError(t, err)
_, _, err = d.DecodeUntilMarker(&rtp.Packet{
_, _, err = d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: true,
@@ -63,7 +63,7 @@ func TestDecodeCorruptedFragment(t *testing.T) {
})
require.Equal(t, ErrMorePacketsNeeded, err)
nalus, _, err := d.DecodeUntilMarker(&rtp.Packet{
nalus, _, err := d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: true,
@@ -100,7 +100,7 @@ func TestDecodeSTAPAWithPadding(t *testing.T) {
},
}
nalus, _, err := d.DecodeUntilMarker(&pkt)
nalus, _, err := d.Decode(&pkt)
require.NoError(t, err)
require.Equal(t, [][]byte{
{0xaa, 0xbb},
@@ -113,7 +113,7 @@ func TestDecodeAnnexB(t *testing.T) {
err := d.Init()
require.NoError(t, err)
nalus, _, err := d.DecodeUntilMarker(&rtp.Packet{
nalus, _, err := d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: true,
@@ -132,7 +132,7 @@ func TestDecodeAnnexB(t *testing.T) {
}, nalus)
for i := 0; i < 2; i++ {
nalus, _, err := d.DecodeUntilMarker(&rtp.Packet{
nalus, _, err := d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: true,
@@ -156,12 +156,12 @@ func TestDecodeAnnexB(t *testing.T) {
}
}
func TestDecodeUntilMarker(t *testing.T) {
func TestDecodeAccessUnit(t *testing.T) {
d := &Decoder{}
err := d.Init()
require.NoError(t, err)
nalus, _, err := d.DecodeUntilMarker(&rtp.Packet{
nalus, _, err := d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: false,
@@ -175,7 +175,7 @@ func TestDecodeUntilMarker(t *testing.T) {
require.Equal(t, ErrMorePacketsNeeded, err)
require.Equal(t, [][]byte(nil), nalus)
nalus, _, err = d.DecodeUntilMarker(&rtp.Packet{
nalus, _, err = d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: true,
@@ -196,7 +196,7 @@ func TestDecoderErrorLimit(t *testing.T) {
require.NoError(t, err)
for i := 0; i <= h264.MaxNALUsPerAccessUnit; i++ {
_, _, err = d.DecodeUntilMarker(&rtp.Packet{
_, _, err = d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: false,
@@ -217,7 +217,7 @@ func FuzzDecoder(f *testing.F) {
d := &Decoder{}
d.Init() //nolint:errcheck
d.DecodeUntilMarker(&rtp.Packet{ //nolint:errcheck
d.Decode(&rtp.Packet{ //nolint:errcheck
Header: rtp.Header{
Version: 2,
Marker: false,
@@ -229,7 +229,7 @@ func FuzzDecoder(f *testing.F) {
Payload: a,
})
d.DecodeUntilMarker(&rtp.Packet{ //nolint:errcheck
d.Decode(&rtp.Packet{ //nolint:errcheck
Header: rtp.Header{
Version: 2,
Marker: false,

View File

@@ -41,7 +41,7 @@ type Decoder struct {
fragmentsSize int
fragments [][]byte
// for DecodeUntilMarker()
// for Decode()
frameBuffer [][]byte
frameBufferLen int
frameBufferSize int
@@ -160,8 +160,8 @@ func (d *Decoder) decodeNALUs(pkt *rtp.Packet) ([][]byte, time.Duration, error)
return nalus, d.timeDecoder.Decode(pkt.Timestamp), nil
}
// DecodeUntilMarker decodes an access unit from a RTP packet.
func (d *Decoder) DecodeUntilMarker(pkt *rtp.Packet) ([][]byte, time.Duration, error) {
// Decode decodes an access unit from a RTP packet.
func (d *Decoder) Decode(pkt *rtp.Packet) ([][]byte, time.Duration, error) {
nalus, pts, err := d.decodeNALUs(pkt)
if err != nil {
return nil, 0, err

View File

@@ -20,7 +20,7 @@ func TestDecode(t *testing.T) {
for _, pkt := range ca.pkts {
clone := pkt.Clone()
addNALUs, _, err := d.DecodeUntilMarker(pkt)
addNALUs, _, err := d.Decode(pkt)
// test input integrity
require.Equal(t, clone, pkt)
@@ -44,7 +44,7 @@ func TestDecoderErrorLimit(t *testing.T) {
require.NoError(t, err)
for i := 0; i <= h265.MaxNALUsPerAccessUnit; i++ {
_, _, err = d.DecodeUntilMarker(&rtp.Packet{
_, _, err = d.Decode(&rtp.Packet{
Header: rtp.Header{
Version: 2,
Marker: false,
@@ -65,7 +65,7 @@ func FuzzDecoder(f *testing.F) {
d := &Decoder{}
d.Init() //nolint:errcheck
d.DecodeUntilMarker(&rtp.Packet{ //nolint:errcheck
d.Decode(&rtp.Packet{ //nolint:errcheck
Header: rtp.Header{
Version: 2,
Marker: false,
@@ -77,7 +77,7 @@ func FuzzDecoder(f *testing.F) {
Payload: a,
})
d.DecodeUntilMarker(&rtp.Packet{ //nolint:errcheck
d.Decode(&rtp.Packet{ //nolint:errcheck
Header: rtp.Header{
Version: 2,
Marker: false,

View File

@@ -85,8 +85,8 @@ func (f *VP8) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *VP8) CreateDecoder2() (*rtpvp8.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *VP8) CreateDecoder() (*rtpvp8.Decoder, error) {
d := &rtpvp8.Decoder{}
err := d.Init()
@@ -97,8 +97,8 @@ func (f *VP8) CreateDecoder2() (*rtpvp8.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *VP8) CreateEncoder2() (*rtpvp8.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *VP8) CreateEncoder() (*rtpvp8.Encoder, error) {
e := &rtpvp8.Encoder{
PayloadType: f.PayloadTyp,
}

View File

@@ -19,14 +19,14 @@ func TestVP8ttributes(t *testing.T) {
func TestVP8DecEncoder(t *testing.T) {
format := &VP8{}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkts, err := enc.Encode([]byte{0x01, 0x02, 0x03, 0x04}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.Decode(pkts[0])

View File

@@ -97,8 +97,8 @@ func (f *VP9) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder2 creates a decoder able to decode the content of the format.
func (f *VP9) CreateDecoder2() (*rtpvp9.Decoder, error) {
// CreateDecoder creates a decoder able to decode the content of the format.
func (f *VP9) CreateDecoder() (*rtpvp9.Decoder, error) {
d := &rtpvp9.Decoder{}
err := d.Init()
@@ -109,8 +109,8 @@ func (f *VP9) CreateDecoder2() (*rtpvp9.Decoder, error) {
return d, nil
}
// CreateEncoder2 creates an encoder able to encode the content of the format.
func (f *VP9) CreateEncoder2() (*rtpvp9.Encoder, error) {
// CreateEncoder creates an encoder able to encode the content of the format.
func (f *VP9) CreateEncoder() (*rtpvp9.Encoder, error) {
e := &rtpvp9.Encoder{
PayloadType: f.PayloadTyp,
}

View File

@@ -19,14 +19,14 @@ func TestVP9Attributes(t *testing.T) {
func TestVP9DecEncoder(t *testing.T) {
format := &VP9{}
enc, err := format.CreateEncoder2()
enc, err := format.CreateEncoder()
require.NoError(t, err)
pkts, err := enc.Encode([]byte{0x01, 0x02, 0x03, 0x04}, 0)
require.NoError(t, err)
require.Equal(t, format.PayloadType(), pkts[0].PayloadType)
dec, err := format.CreateDecoder2()
dec, err := format.CreateDecoder()
require.NoError(t, err)
byts, _, err := dec.Decode(pkts[0])

View File

@@ -1056,7 +1056,7 @@ func TestServerSessionTeardown(t *testing.T) {
}
func TestServerAuth(t *testing.T) {
nonce, err := auth.GenerateNonce2()
nonce, err := auth.GenerateNonce()
require.NoError(t, err)
s := &Server{