mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
update golangci-lint
This commit is contained in:
@@ -9,6 +9,7 @@ linters:
|
||||
- gofumpt
|
||||
- golint
|
||||
- misspell
|
||||
- lll
|
||||
- prealloc
|
||||
- unconvert
|
||||
disable:
|
||||
|
@@ -1350,12 +1350,14 @@ func (cc *ClientConn) doSetup(
|
||||
return nil, liberrors.ErrClientTransportHeaderNoDestination{}
|
||||
}
|
||||
|
||||
rtpListener, err = newClientConnUDPListener(cc, true, thRes.Destination.String()+":"+strconv.FormatInt(int64(thRes.Ports[0]), 10))
|
||||
rtpListener, err = newClientConnUDPListener(cc, true,
|
||||
thRes.Destination.String()+":"+strconv.FormatInt(int64(thRes.Ports[0]), 10))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rtcpListener, err = newClientConnUDPListener(cc, true, thRes.Destination.String()+":"+strconv.FormatInt(int64(thRes.Ports[1]), 10))
|
||||
rtcpListener, err = newClientConnUDPListener(cc, true,
|
||||
thRes.Destination.String()+":"+strconv.FormatInt(int64(thRes.Ports[1]), 10))
|
||||
if err != nil {
|
||||
rtpListener.close()
|
||||
return nil, err
|
||||
|
@@ -29,10 +29,12 @@ var casesHeader = []struct {
|
||||
},
|
||||
{
|
||||
"multiple",
|
||||
[]byte("WWW-Authenticate: Digest realm=\"4419b63f5e51\", nonce=\"8b84a3b789283a8bea8da7fa7d41f08b\", stale=\"FALSE\"\r\n" +
|
||||
[]byte("WWW-Authenticate: Digest realm=\"4419b63f5e51\", " +
|
||||
"nonce=\"8b84a3b789283a8bea8da7fa7d41f08b\", stale=\"FALSE\"\r\n" +
|
||||
"WWW-Authenticate: Basic realm=\"4419b63f5e51\"\r\n" +
|
||||
"\r\n"),
|
||||
[]byte("WWW-Authenticate: Digest realm=\"4419b63f5e51\", nonce=\"8b84a3b789283a8bea8da7fa7d41f08b\", stale=\"FALSE\"\r\n" +
|
||||
[]byte("WWW-Authenticate: Digest realm=\"4419b63f5e51\", " +
|
||||
"nonce=\"8b84a3b789283a8bea8da7fa7d41f08b\", stale=\"FALSE\"\r\n" +
|
||||
"WWW-Authenticate: Basic realm=\"4419b63f5e51\"\r\n" +
|
||||
"\r\n"),
|
||||
Header{
|
||||
|
@@ -214,7 +214,9 @@ func (res Response) Write(bw *bufio.Writer) error {
|
||||
}
|
||||
}
|
||||
|
||||
_, err := bw.Write([]byte(rtspProtocol10 + " " + strconv.FormatInt(int64(res.StatusCode), 10) + " " + res.StatusMessage + "\r\n"))
|
||||
_, err := bw.Write([]byte(rtspProtocol10 + " " +
|
||||
strconv.FormatInt(int64(res.StatusCode), 10) + " " +
|
||||
res.StatusMessage + "\r\n"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@@ -116,8 +116,12 @@ var casesAuthenticate = []struct {
|
||||
},
|
||||
{
|
||||
"digest response with empty field",
|
||||
base.HeaderValue{`Digest username="", realm="IPCAM", nonce="5d17cd12b9fa8a85ac5ceef0926ea5a6", uri="rtsp://localhost:8554/mystream", response="c072ae90eb4a27f4cdcb90d62266b2a1"`},
|
||||
base.HeaderValue{`Digest username="", realm="IPCAM", nonce="5d17cd12b9fa8a85ac5ceef0926ea5a6", uri="rtsp://localhost:8554/mystream", response="c072ae90eb4a27f4cdcb90d62266b2a1"`},
|
||||
base.HeaderValue{`Digest username="", realm="IPCAM", ` +
|
||||
`nonce="5d17cd12b9fa8a85ac5ceef0926ea5a6", uri="rtsp://localhost:8554/mystream", ` +
|
||||
`response="c072ae90eb4a27f4cdcb90d62266b2a1"`},
|
||||
base.HeaderValue{`Digest username="", realm="IPCAM", ` +
|
||||
`nonce="5d17cd12b9fa8a85ac5ceef0926ea5a6", uri="rtsp://localhost:8554/mystream", ` +
|
||||
`response="c072ae90eb4a27f4cdcb90d62266b2a1"`},
|
||||
Authenticate{
|
||||
Method: AuthDigest,
|
||||
Username: func() *string {
|
||||
@@ -144,8 +148,10 @@ var casesAuthenticate = []struct {
|
||||
},
|
||||
{
|
||||
"digest response with no spaces and additional fields",
|
||||
base.HeaderValue{`Digest realm="Please log in with a valid username",nonce="752a62306daf32b401a41004555c7663",opaque="",stale=FALSE,algorithm=MD5`},
|
||||
base.HeaderValue{`Digest realm="Please log in with a valid username", nonce="752a62306daf32b401a41004555c7663", opaque="", stale="FALSE", algorithm="MD5"`},
|
||||
base.HeaderValue{`Digest realm="Please log in with a valid username",` +
|
||||
`nonce="752a62306daf32b401a41004555c7663",opaque="",stale=FALSE,algorithm=MD5`},
|
||||
base.HeaderValue{`Digest realm="Please log in with a valid username", ` +
|
||||
`nonce="752a62306daf32b401a41004555c7663", opaque="", stale="FALSE", algorithm="MD5"`},
|
||||
Authenticate{
|
||||
Method: AuthDigest,
|
||||
Realm: func() *string {
|
||||
|
@@ -34,8 +34,10 @@ var casesRTPInfo = []struct {
|
||||
},
|
||||
{
|
||||
"multiple value",
|
||||
base.HeaderValue{`url=rtsp://127.0.0.1/test.mkv/track1;seq=35243;rtptime=717574556,url=rtsp://127.0.0.1/test.mkv/track2;seq=13655;rtptime=2848846950`},
|
||||
base.HeaderValue{`url=rtsp://127.0.0.1/test.mkv/track1;seq=35243;rtptime=717574556,url=rtsp://127.0.0.1/test.mkv/track2;seq=13655;rtptime=2848846950`},
|
||||
base.HeaderValue{`url=rtsp://127.0.0.1/test.mkv/track1;seq=35243;rtptime=717574556,` +
|
||||
`url=rtsp://127.0.0.1/test.mkv/track2;seq=13655;rtptime=2848846950`},
|
||||
base.HeaderValue{`url=rtsp://127.0.0.1/test.mkv/track1;seq=35243;rtptime=717574556,` +
|
||||
`url=rtsp://127.0.0.1/test.mkv/track2;seq=13655;rtptime=2848846950`},
|
||||
RTPInfo{
|
||||
{
|
||||
URL: "rtsp://127.0.0.1/test.mkv/track1",
|
||||
@@ -109,8 +111,10 @@ var casesRTPInfo = []struct {
|
||||
},
|
||||
{
|
||||
"with space",
|
||||
base.HeaderValue{`url=rtsp://10.13.146.53/axis-media/media.amp/trackID=1;seq=58477;rtptime=1020884293, url=rtsp://10.13.146.53/axis-media/media.amp/trackID=2;seq=15727;rtptime=1171661503`},
|
||||
base.HeaderValue{`url=rtsp://10.13.146.53/axis-media/media.amp/trackID=1;seq=58477;rtptime=1020884293,url=rtsp://10.13.146.53/axis-media/media.amp/trackID=2;seq=15727;rtptime=1171661503`},
|
||||
base.HeaderValue{`url=rtsp://10.13.146.53/axis-media/media.amp/trackID=1;` +
|
||||
`seq=58477;rtptime=1020884293, url=rtsp://10.13.146.53/axis-media/media.amp/trackID=2;seq=15727;rtptime=1171661503`},
|
||||
base.HeaderValue{`url=rtsp://10.13.146.53/axis-media/media.amp/trackID=1;` +
|
||||
`seq=58477;rtptime=1020884293,url=rtsp://10.13.146.53/axis-media/media.amp/trackID=2;seq=15727;rtptime=1171661503`},
|
||||
RTPInfo{
|
||||
{
|
||||
URL: "rtsp://10.13.146.53/axis-media/media.amp/trackID=1",
|
||||
@@ -138,8 +142,10 @@ var casesRTPInfo = []struct {
|
||||
},
|
||||
{
|
||||
"with session",
|
||||
base.HeaderValue{`url=trackID=1;seq=55664;rtptime=254718369;ssrc=56597976,url=trackID=2;seq=43807;rtptime=1702259566;ssrc=ee839a80`},
|
||||
base.HeaderValue{`url=trackID=1;seq=55664;rtptime=254718369,url=trackID=2;seq=43807;rtptime=1702259566`},
|
||||
base.HeaderValue{`url=trackID=1;seq=55664;rtptime=254718369;ssrc=56597976,` +
|
||||
`url=trackID=2;seq=43807;rtptime=1702259566;ssrc=ee839a80`},
|
||||
base.HeaderValue{`url=trackID=1;seq=55664;rtptime=254718369,` +
|
||||
`url=trackID=2;seq=43807;rtptime=1702259566`},
|
||||
RTPInfo{
|
||||
{
|
||||
URL: "trackID=1",
|
||||
|
@@ -240,7 +240,8 @@ func (h Transport) Write() base.HeaderValue {
|
||||
}
|
||||
|
||||
if h.InterleavedIDs != nil {
|
||||
rets = append(rets, "interleaved="+strconv.FormatInt(int64(h.InterleavedIDs[0]), 10)+"-"+strconv.FormatInt(int64(h.InterleavedIDs[1]), 10))
|
||||
rets = append(rets, "interleaved="+strconv.FormatInt(int64(h.InterleavedIDs[0]), 10)+
|
||||
"-"+strconv.FormatInt(int64(h.InterleavedIDs[1]), 10))
|
||||
}
|
||||
|
||||
if h.Ports != nil {
|
||||
|
@@ -18,7 +18,8 @@ var ErrMorePacketsNeeded = errors.New("need more packets")
|
||||
// packet of a fragmented NALU and we didn't received anything before.
|
||||
// It's normal to receive this when we are decoding a stream that has been already
|
||||
// running for some time.
|
||||
var ErrNonStartingPacketAndNoPrevious = errors.New("decoded a non-starting fragmented packet without any previous starting packet")
|
||||
var ErrNonStartingPacketAndNoPrevious = errors.New(
|
||||
"decoded a non-starting fragmented packet without any previous starting packet")
|
||||
|
||||
// PacketConnReader creates a io.Reader around a net.PacketConn.
|
||||
type PacketConnReader struct {
|
||||
|
@@ -367,7 +367,8 @@ var cases = []struct {
|
||||
"s=SDP Seminar\r\n" +
|
||||
"m=video 0 RTP/AVP/TCP 96\r\n" +
|
||||
"a=rtpmap:96 H265/90000\r\n" +
|
||||
"a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;\r\n" +
|
||||
"a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; " +
|
||||
"sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;\r\n" +
|
||||
"a=control:streamid=0\r\n" +
|
||||
"m=audio 0 RTP/AVP/TCP 97\r\n" +
|
||||
"a=rtpmap:97 mpeg4-generic/44100/2\r\n" +
|
||||
@@ -378,7 +379,8 @@ var cases = []struct {
|
||||
"s=SDP Seminar\r\n" +
|
||||
"m=video 0 RTP/AVP/TCP 96\r\n" +
|
||||
"a=rtpmap:96 H265/90000\r\n" +
|
||||
"a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;\r\n" +
|
||||
"a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; " +
|
||||
"sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;\r\n" +
|
||||
"a=control:streamid=0\r\n" +
|
||||
"m=audio 0 RTP/AVP/TCP 97\r\n" +
|
||||
"a=rtpmap:97 mpeg4-generic/44100/2\r\n" +
|
||||
@@ -404,7 +406,8 @@ var cases = []struct {
|
||||
},
|
||||
Attributes: []psdp.Attribute{
|
||||
{"rtpmap", "96 H265/90000"},
|
||||
{"fmtp", "96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;"},
|
||||
{"fmtp", "96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; " +
|
||||
"sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;"},
|
||||
{"control", "streamid=0"},
|
||||
},
|
||||
},
|
||||
@@ -430,7 +433,8 @@ var cases = []struct {
|
||||
"s=SDP Seminar\r\n" +
|
||||
"m=video 0 RTP/AVP/TCP 96\r\n" +
|
||||
"a=rtpmap:96 H265/90000\r\n" +
|
||||
"a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;\r\n" +
|
||||
"a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; " +
|
||||
"sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;\r\n" +
|
||||
"a=control:streamid=0\r\n" +
|
||||
"m=audio 0 RTP/AVP/TCP 97\r\n" +
|
||||
"a=rtpmap:97 mpeg4-generic/44100/2\r\n" +
|
||||
@@ -441,7 +445,8 @@ var cases = []struct {
|
||||
"s=SDP Seminar\r\n" +
|
||||
"m=video 0 RTP/AVP/TCP 96\r\n" +
|
||||
"a=rtpmap:96 H265/90000\r\n" +
|
||||
"a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;\r\n" +
|
||||
"a=fmtp:96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; " +
|
||||
"sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;\r\n" +
|
||||
"a=control:streamid=0\r\n" +
|
||||
"m=audio 0 RTP/AVP/TCP 97\r\n" +
|
||||
"a=rtpmap:97 mpeg4-generic/44100/2\r\n" +
|
||||
@@ -459,7 +464,8 @@ var cases = []struct {
|
||||
},
|
||||
Attributes: []psdp.Attribute{
|
||||
{"rtpmap", "96 H265/90000"},
|
||||
{"fmtp", "96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;"},
|
||||
{"fmtp", "96 sprop-vps=QAEMAf//AWAAAAMAsAAAAwAAAwB4FwJA; " +
|
||||
"sprop-sps=QgEBAWAAAAMAsAAAAwAAAwB4oAKggC8c1YgXuRZFL/y5/E/qbgQEBAE=; sprop-pps=RAHAcvBTJA==;"},
|
||||
{"control", "streamid=0"},
|
||||
},
|
||||
},
|
||||
@@ -587,7 +593,8 @@ var cases = []struct {
|
||||
"a=control:trackID=1\r\n" +
|
||||
"a=recvonly\r\n" +
|
||||
"a=framerate:25.0\r\n" +
|
||||
"a=fmtp:105 packetization-mode=1; profile-level-id=640028; sprop-parameter-sets=Z2QAKKwa0A8ARPy4CIAAAAMAgAAADLWgAtwAHJ173CPFCKg=,KO4ESSJAAAAAAAAAAA==\r\n"),
|
||||
"a=fmtp:105 packetization-mode=1; profile-level-id=640028; " +
|
||||
"sprop-parameter-sets=Z2QAKKwa0A8ARPy4CIAAAAMAgAAADLWgAtwAHJ173CPFCKg=,KO4ESSJAAAAAAAAAAA==\r\n"),
|
||||
[]byte("v=0\r\n" +
|
||||
"o=- 12345 1 IN IP4 10.21.61.139\r\n" +
|
||||
"s=Sony RTSP Server\r\n" +
|
||||
@@ -599,7 +606,8 @@ var cases = []struct {
|
||||
"a=control:trackID=1\r\n" +
|
||||
"a=recvonly\r\n" +
|
||||
"a=framerate:25.0\r\n" +
|
||||
"a=fmtp:105 packetization-mode=1; profile-level-id=640028; sprop-parameter-sets=Z2QAKKwa0A8ARPy4CIAAAAMAgAAADLWgAtwAHJ173CPFCKg=,KO4ESSJAAAAAAAAAAA==\r\n"),
|
||||
"a=fmtp:105 packetization-mode=1; profile-level-id=640028; " +
|
||||
"sprop-parameter-sets=Z2QAKKwa0A8ARPy4CIAAAAMAgAAADLWgAtwAHJ173CPFCKg=,KO4ESSJAAAAAAAAAAA==\r\n"),
|
||||
SessionDescription{
|
||||
Origin: psdp.Origin{
|
||||
Username: "-",
|
||||
@@ -632,7 +640,8 @@ var cases = []struct {
|
||||
{"control", "trackID=1"},
|
||||
{"recvonly", ""},
|
||||
{"framerate", "25.0"},
|
||||
{"fmtp", "105 packetization-mode=1; profile-level-id=640028; sprop-parameter-sets=Z2QAKKwa0A8ARPy4CIAAAAMAgAAADLWgAtwAHJ173CPFCKg=,KO4ESSJAAAAAAAAAAA=="},
|
||||
{"fmtp", "105 packetization-mode=1; profile-level-id=640028; " +
|
||||
"sprop-parameter-sets=Z2QAKKwa0A8ARPy4CIAAAAMAgAAADLWgAtwAHJ173CPFCKg=,KO4ESSJAAAAAAAAAAA=="},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -653,7 +662,8 @@ var cases = []struct {
|
||||
"m=audio 0 RTP/AVP 96\r\n" +
|
||||
"b=RR:0\r\n" +
|
||||
"a=rtpmap:96 mpeg4-generic/22050\r\n" +
|
||||
"a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1388; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;\r\n" +
|
||||
"a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; " +
|
||||
"config=1388; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;\r\n" +
|
||||
"m=video 0 RTP/AVP 96\r\n" +
|
||||
"b=RR:0\r\n" +
|
||||
"a=rtpmap:96 H264/90000\r\n" +
|
||||
@@ -671,7 +681,8 @@ var cases = []struct {
|
||||
"m=audio 0 RTP/AVP 96\r\n" +
|
||||
"b=RR:0\r\n" +
|
||||
"a=rtpmap:96 mpeg4-generic/22050\r\n" +
|
||||
"a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1388; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;\r\n" +
|
||||
"a=fmtp:96 streamtype=5; profile-level-id=15; mode=AAC-hbr; " +
|
||||
"config=1388; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;\r\n" +
|
||||
"m=video 0 RTP/AVP 96\r\n" +
|
||||
"b=RR:0\r\n" +
|
||||
"a=rtpmap:96 H264/90000\r\n" +
|
||||
@@ -717,7 +728,8 @@ var cases = []struct {
|
||||
},
|
||||
Attributes: []psdp.Attribute{
|
||||
{"rtpmap", "96 mpeg4-generic/22050"},
|
||||
{"fmtp", "96 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=1388; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;"},
|
||||
{"fmtp", "96 streamtype=5; profile-level-id=15; " +
|
||||
"mode=AAC-hbr; config=1388; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;"},
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -1086,7 +1098,8 @@ var cases = []struct {
|
||||
"m=video 0 RTP/AVP 96\r\n" +
|
||||
"i=Video Media\r\n" +
|
||||
"a=rtpmap:96 H264/90000\r\n" +
|
||||
"a=fmtp:96 profile-level-id=4D0014;packetization-mode=0;sprop-parameter-sets=Z01AHppmBYHv81BgYGQAAA+gAAF3ABA=,aO48gA==\r\n" +
|
||||
"a=fmtp:96 profile-level-id=4D0014;packetization-mode=0;" +
|
||||
"sprop-parameter-sets=Z01AHppmBYHv81BgYGQAAA+gAAF3ABA=,aO48gA==\r\n" +
|
||||
"a=control:trackID=video\r\n" +
|
||||
"a=Media_header:MEDIAINFO=494D4B48010100000400000100000000000000000000000000000000000000000000000000000000;\r\n" +
|
||||
"a=appversion:1.0\r\n"),
|
||||
@@ -1102,7 +1115,8 @@ var cases = []struct {
|
||||
"m=video 0 RTP/AVP 96\r\n" +
|
||||
"i=Video Media\r\n" +
|
||||
"a=rtpmap:96 H264/90000\r\n" +
|
||||
"a=fmtp:96 profile-level-id=4D0014;packetization-mode=0;sprop-parameter-sets=Z01AHppmBYHv81BgYGQAAA+gAAF3ABA=,aO48gA==\r\n" +
|
||||
"a=fmtp:96 profile-level-id=4D0014;packetization-mode=0;" +
|
||||
"sprop-parameter-sets=Z01AHppmBYHv81BgYGQAAA+gAAF3ABA=,aO48gA==\r\n" +
|
||||
"a=control:trackID=video\r\n" +
|
||||
"a=Media_header:MEDIAINFO=494D4B48010100000400000100000000000000000000000000000000000000000000000000000000;\r\n" +
|
||||
"a=appversion:1.0\r\n"),
|
||||
@@ -1160,16 +1174,18 @@ var cases = []struct {
|
||||
Value: "96 H264/90000",
|
||||
},
|
||||
{
|
||||
Key: "fmtp",
|
||||
Value: "96 profile-level-id=4D0014;packetization-mode=0;sprop-parameter-sets=Z01AHppmBYHv81BgYGQAAA+gAAF3ABA=,aO48gA==",
|
||||
Key: "fmtp",
|
||||
Value: "96 profile-level-id=4D0014;packetization-mode=0;" +
|
||||
"sprop-parameter-sets=Z01AHppmBYHv81BgYGQAAA+gAAF3ABA=,aO48gA==",
|
||||
},
|
||||
{
|
||||
Key: "control",
|
||||
Value: "trackID=video",
|
||||
},
|
||||
{
|
||||
Key: "Media_header",
|
||||
Value: "MEDIAINFO=494D4B48010100000400000100000000000000000000000000000000000000000000000000000000;",
|
||||
Key: "Media_header",
|
||||
Value: "MEDIAINFO=494D4B480101000004000001000000000000000000000000" +
|
||||
"00000000000000000000000000000000;",
|
||||
},
|
||||
{
|
||||
Key: "appversion",
|
||||
|
@@ -89,13 +89,16 @@ type Server struct {
|
||||
// If UDPRTPAddress and UDPRTCPAddress are filled, the server can read and write UDP streams.
|
||||
UDPRTCPAddress string
|
||||
// a range of multicast IPs to use.
|
||||
// If MulticastIPRange, MulticastRTPPort, MulticastRTCPPort are filled, the server can read and write UDP-multicast streams.
|
||||
// If MulticastIPRange, MulticastRTPPort, MulticastRTCPPort are filled, the server
|
||||
// can read and write UDP-multicast streams.
|
||||
MulticastIPRange string
|
||||
// a port to send RTP packets with UDP-multicast.
|
||||
// If MulticastIPRange, MulticastRTPPort, MulticastRTCPPort are filled, the server can read and write UDP-multicast streams.
|
||||
// If MulticastIPRange, MulticastRTPPort, MulticastRTCPPort are filled, the server
|
||||
// can read and write UDP-multicast streams.
|
||||
MulticastRTPPort int
|
||||
// a port to send RTCP packets with UDP-multicast.
|
||||
// If MulticastIPRange, MulticastRTPPort, MulticastRTCPPort are filled, the server can read and write UDP-multicast streams.
|
||||
// If MulticastIPRange, MulticastRTPPort, MulticastRTCPPort are filled, the server
|
||||
// can read and write UDP-multicast streams.
|
||||
MulticastRTCPPort int
|
||||
// read buffer count.
|
||||
// If greater than 1, allows to pass buffers to routines different than the one
|
||||
|
@@ -431,7 +431,8 @@ func TestServerHighLevelPublishRead(t *testing.T) {
|
||||
|
||||
cnt1, err := newContainer("gstreamer", "publish", []string{
|
||||
"filesrc location=emptyvideo.mkv ! matroskademux ! video/x-h264 ! rtspclientsink " +
|
||||
"location=" + proto + "://127.0.0.1:8554/teststream protocols=" + ts + " tls-validation-flags=0 latency=0 timeout=0 rtx-time=0",
|
||||
"location=" + proto + "://127.0.0.1:8554/teststream protocols=" + ts +
|
||||
" tls-validation-flags=0 latency=0 timeout=0 rtx-time=0",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
defer cnt1.close()
|
||||
@@ -476,7 +477,8 @@ func TestServerHighLevelPublishRead(t *testing.T) {
|
||||
}()
|
||||
|
||||
cnt2, err := newContainer("gstreamer", "read", []string{
|
||||
"rtspsrc location=" + proto + "://127.0.0.1:8554/teststream protocols=" + ts + " tls-validation-flags=0 latency=0 " +
|
||||
"rtspsrc location=" + proto + "://127.0.0.1:8554/teststream protocols=" + ts +
|
||||
" tls-validation-flags=0 latency=0 " +
|
||||
"! application/x-rtp,media=video ! decodebin ! exitafterframe ! fakesink",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
@@ -66,8 +66,10 @@ func TestTrackURL(t *testing.T) {
|
||||
"m=video 0 RTP/AVP 96\r\n" +
|
||||
"a=rtpmap:96 H264/90000\r\n" +
|
||||
"a=control:trackID=5"),
|
||||
mustParseURL("rtsp://myuser:mypass@192.168.1.99:554/test?user=tmp&password=BagRep1&channel=1&stream=0.sdp"),
|
||||
mustParseURL("rtsp://myuser:mypass@192.168.1.99:554/test?user=tmp&password=BagRep1&channel=1&stream=0.sdp/trackID=5"),
|
||||
mustParseURL("rtsp://myuser:mypass@192.168.1.99:554/" +
|
||||
"test?user=tmp&password=BagRep1&channel=1&stream=0.sdp"),
|
||||
mustParseURL("rtsp://myuser:mypass@192.168.1.99:554/" +
|
||||
"test?user=tmp&password=BagRep1&channel=1&stream=0.sdp/trackID=5"),
|
||||
},
|
||||
{
|
||||
"relative control, url with special chars and query",
|
||||
@@ -75,8 +77,10 @@ func TestTrackURL(t *testing.T) {
|
||||
"m=video 0 RTP/AVP 96\r\n" +
|
||||
"a=rtpmap:96 H264/90000\r\n" +
|
||||
"a=control:trackID=5"),
|
||||
mustParseURL("rtsp://myuser:mypass@192.168.1.99:554/te!st?user=tmp&password=BagRep1!&channel=1&stream=0.sdp"),
|
||||
mustParseURL("rtsp://myuser:mypass@192.168.1.99:554/te!st?user=tmp&password=BagRep1!&channel=1&stream=0.sdp/trackID=5"),
|
||||
mustParseURL("rtsp://myuser:mypass@192.168.1.99:554/" +
|
||||
"te!st?user=tmp&password=BagRep1!&channel=1&stream=0.sdp"),
|
||||
mustParseURL("rtsp://myuser:mypass@192.168.1.99:554/" +
|
||||
"te!st?user=tmp&password=BagRep1!&channel=1&stream=0.sdp/trackID=5"),
|
||||
},
|
||||
{
|
||||
"relative control, url with query without question mark",
|
||||
@@ -135,7 +139,8 @@ func TestTrackClockRate(t *testing.T) {
|
||||
"a=rtpmap:96 H264/90000 \r\n" +
|
||||
"a=range:npt=0-\r\n" +
|
||||
"a=framerate:0S\r\n" +
|
||||
"a=fmtp:96 profile-level-id=64000c; packetization-mode=1; sprop-parameter-sets=Z2QADKw7ULBLQgAAAwACAAADAD0I,aO48gA==\r\n" +
|
||||
"a=fmtp:96 profile-level-id=64000c; packetization-mode=1; " +
|
||||
"sprop-parameter-sets=Z2QADKw7ULBLQgAAAwACAAADAD0I,aO48gA==\r\n" +
|
||||
"a=framerate:25\r\n" +
|
||||
"a=control:trackID=3\r\n"),
|
||||
90000,
|
||||
@@ -195,7 +200,8 @@ func TestTrackClockRate(t *testing.T) {
|
||||
"a=control:trackID=1\r\n" +
|
||||
"b=AS:0\r\n" +
|
||||
"a=rtpmap:98 H265/90000\r\n" +
|
||||
"a=fmtp:98 profile-id=1; sprop-vps=QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ; sprop-sps=QgEBAWAAAAMAAAMAAAMAAAMAlqADwIAQ5Za5JMmuWcBSSgAAB9AAAHUwgkA=; sprop-pps=RAHgdrAwxmQ=\r\n" +
|
||||
"a=fmtp:98 profile-id=1; sprop-vps=QAEMAf//AWAAAAMAAAMAAAMAAAMAlqwJ; " +
|
||||
"sprop-sps=QgEBAWAAAAMAAAMAAAMAAAMAlqADwIAQ5Za5JMmuWcBSSgAAB9AAAHUwgkA=; sprop-pps=RAHgdrAwxmQ=\r\n" +
|
||||
"m=application 0 RTP/AVP 107\r\n" +
|
||||
"a=control:trackID=3\r\n" +
|
||||
"a=rtpmap:107 vnd.onvif.metadata/90000"),
|
||||
@@ -240,8 +246,9 @@ func TestTrackH264New(t *testing.T) {
|
||||
Value: "96 H264/90000",
|
||||
},
|
||||
{
|
||||
Key: "fmtp",
|
||||
Value: "96 packetization-mode=1; sprop-parameter-sets=Z2QADKw7ULBLQgAAAwACAAADAD0I,aO48gA==; profile-level-id=64000C",
|
||||
Key: "fmtp",
|
||||
Value: "96 packetization-mode=1; " +
|
||||
"sprop-parameter-sets=Z2QADKw7ULBLQgAAAwACAAADAD0I,aO48gA==; profile-level-id=64000C",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -268,8 +275,9 @@ func TestTrackIsH264(t *testing.T) {
|
||||
Value: "96 H264/90000",
|
||||
},
|
||||
{
|
||||
Key: "fmtp",
|
||||
Value: "96 packetization-mode=1; sprop-parameter-sets=Z2QADKw7ULBLQgAAAwACAAADAD0I,aO48gA==; profile-level-id=64000C",
|
||||
Key: "fmtp",
|
||||
Value: "96 packetization-mode=1; " +
|
||||
"sprop-parameter-sets=Z2QADKw7ULBLQgAAAwACAAADAD0I,aO48gA==; profile-level-id=64000C",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -303,8 +311,9 @@ func TestTrackExtractConfigH264(t *testing.T) {
|
||||
Value: "96 H264/90000",
|
||||
},
|
||||
{
|
||||
Key: "fmtp",
|
||||
Value: "96 packetization-mode=1; sprop-parameter-sets=Z2QADKw7ULBLQgAAAwACAAADAD0I,aO48gA==; profile-level-id=64000C",
|
||||
Key: "fmtp",
|
||||
Value: "96 packetization-mode=1; " +
|
||||
"sprop-parameter-sets=Z2QADKw7ULBLQgAAAwACAAADAD0I,aO48gA==; profile-level-id=64000C",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -335,8 +344,9 @@ func TestTrackExtractConfigH264(t *testing.T) {
|
||||
Value: "96 H264/90000",
|
||||
},
|
||||
{
|
||||
Key: "fmtp",
|
||||
Value: "96 packetization-mode=1;profile-level-id=64001f;sprop-parameter-sets=Z2QAH6zZQFAFuwFsgAAAAwCAAAAeB4wYyw==,aOvjyyLA;",
|
||||
Key: "fmtp",
|
||||
Value: "96 packetization-mode=1;profile-level-id=64001f;" +
|
||||
"sprop-parameter-sets=Z2QAH6zZQFAFuwFsgAAAAwCAAAAeB4wYyw==,aOvjyyLA;",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user