mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 15:16:51 +08:00
support go 1.18
This commit is contained in:
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
|
||||
- uses: golangci/golangci-lint-action@v2
|
||||
with:
|
||||
version: v1.44.2
|
||||
version: v1.45.2
|
||||
|
||||
go-mod-tidy:
|
||||
runs-on: ubuntu-20.04
|
||||
@@ -24,6 +24,8 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: "1.17"
|
||||
|
||||
- run: |
|
||||
go mod download
|
||||
|
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
runs-on: ubuntu-20.04
|
||||
strategy:
|
||||
matrix:
|
||||
go: ["1.15", "1.16", "1.17"]
|
||||
go: ["1.16", "1.17", "1.18"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
@@ -24,5 +24,5 @@ jobs:
|
||||
|
||||
- run: make test-nodocker
|
||||
|
||||
- if: matrix.go == '1.16'
|
||||
- if: matrix.go == '1.18'
|
||||
run: bash <(curl -s https://codecov.io/bash)
|
||||
|
4
Makefile
4
Makefile
@@ -1,6 +1,6 @@
|
||||
|
||||
BASE_IMAGE = golang:1.17-alpine3.14
|
||||
LINT_IMAGE = golangci/golangci-lint:v1.44.2
|
||||
LINT_IMAGE = golangci/golangci-lint:v1.45.2
|
||||
|
||||
.PHONY: $(shell ls)
|
||||
|
||||
@@ -28,7 +28,7 @@ mod-tidy:
|
||||
|
||||
define DOCKERFILE_FORMAT
|
||||
FROM $(BASE_IMAGE)
|
||||
RUN go install mvdan.cc/gofumpt@v0.2.0
|
||||
RUN go install mvdan.cc/gofumpt@v0.3.1
|
||||
endef
|
||||
export DOCKERFILE_FORMAT
|
||||
|
||||
|
@@ -9,7 +9,7 @@
|
||||
|
||||
RTSP 1.0 client and server library for the Go programming language, written for [rtsp-simple-server](https://github.com/aler9/rtsp-simple-server).
|
||||
|
||||
Go ≥ 1.15 is required.
|
||||
Go ≥ 1.16 is required.
|
||||
|
||||
Features:
|
||||
|
||||
|
@@ -1263,7 +1263,8 @@ func (c *Client) doSetup(
|
||||
track Track,
|
||||
baseURL *base.URL,
|
||||
rtpPort int,
|
||||
rtcpPort int) (*base.Response, error) {
|
||||
rtcpPort int,
|
||||
) (*base.Response, error) {
|
||||
err := c.checkState(map[clientState]struct{}{
|
||||
clientStateInitial: {},
|
||||
clientStatePrePlay: {},
|
||||
@@ -1578,7 +1579,8 @@ func (c *Client) Setup(
|
||||
track Track,
|
||||
baseURL *base.URL,
|
||||
rtpPort int,
|
||||
rtcpPort int) (*base.Response, error) {
|
||||
rtcpPort int,
|
||||
) (*base.Response, error) {
|
||||
cres := make(chan clientRes)
|
||||
select {
|
||||
case c.setup <- setupReq{
|
||||
|
2
go.mod
2
go.mod
@@ -1,6 +1,6 @@
|
||||
module github.com/aler9/gortsplib
|
||||
|
||||
go 1.15
|
||||
go 1.16
|
||||
|
||||
require (
|
||||
github.com/asticode/go-astits v1.10.0
|
||||
|
@@ -48,7 +48,8 @@ type RTCPReceiver struct {
|
||||
|
||||
// New allocates a RTCPReceiver.
|
||||
func New(period time.Duration, receiverSSRC *uint32, clockRate int,
|
||||
writePacketRTCP func(rtcp.Packet)) *RTCPReceiver {
|
||||
writePacketRTCP func(rtcp.Packet),
|
||||
) *RTCPReceiver {
|
||||
rr := &RTCPReceiver{
|
||||
period: period,
|
||||
receiverSSRC: func() uint32 {
|
||||
|
@@ -32,7 +32,8 @@ type RTCPSender struct {
|
||||
|
||||
// New allocates a RTCPSender.
|
||||
func New(period time.Duration, clockRate int,
|
||||
writePacketRTCP func(rtcp.Packet)) *RTCPSender {
|
||||
writePacketRTCP func(rtcp.Packet),
|
||||
) *RTCPSender {
|
||||
rs := &RTCPSender{
|
||||
period: period,
|
||||
clockRate: float64(clockRate),
|
||||
|
@@ -22,7 +22,8 @@ import (
|
||||
|
||||
func writeReqReadRes(conn net.Conn,
|
||||
br *bufio.Reader,
|
||||
req base.Request) (*base.Response, error) {
|
||||
req base.Request,
|
||||
) (*base.Response, error) {
|
||||
var bb bytes.Buffer
|
||||
req.Write(&bb)
|
||||
_, err := conn.Write(bb.Bytes())
|
||||
|
@@ -51,7 +51,8 @@ type ServerConn struct {
|
||||
|
||||
func newServerConn(
|
||||
s *Server,
|
||||
nconn net.Conn) *ServerConn {
|
||||
nconn net.Conn,
|
||||
) *ServerConn {
|
||||
ctx, ctxCancel := context.WithCancel(s.ctx)
|
||||
|
||||
conn := func() net.Conn {
|
||||
|
@@ -81,7 +81,8 @@ func newServerUDPListener(
|
||||
s *Server,
|
||||
multicast bool,
|
||||
address string,
|
||||
isRTP bool) (*serverUDPListener, error) {
|
||||
isRTP bool,
|
||||
) (*serverUDPListener, error) {
|
||||
var pc *net.UDPConn
|
||||
var listenIP net.IP
|
||||
if multicast {
|
||||
|
@@ -24,7 +24,8 @@ type TrackAAC struct {
|
||||
|
||||
// NewTrackAAC allocates a TrackAAC.
|
||||
func NewTrackAAC(payloadType uint8, typ int, sampleRate int,
|
||||
channelCount int, aotSpecificConfig []byte) (*TrackAAC, error) {
|
||||
channelCount int, aotSpecificConfig []byte,
|
||||
) (*TrackAAC, error) {
|
||||
mpegConf, err := aac.MPEG4AudioConfig{
|
||||
Type: aac.MPEG4AudioType(typ),
|
||||
SampleRate: sampleRate,
|
||||
@@ -48,7 +49,8 @@ func NewTrackAAC(payloadType uint8, typ int, sampleRate int,
|
||||
func newTrackAACFromMediaDescription(
|
||||
control string,
|
||||
payloadType uint8,
|
||||
md *psdp.MediaDescription) (*TrackAAC, error) {
|
||||
md *psdp.MediaDescription,
|
||||
) (*TrackAAC, error) {
|
||||
v, ok := md.Attribute("fmtp")
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("fmtp attribute is missing")
|
||||
|
@@ -87,7 +87,8 @@ func NewTrackGeneric(media string, formats []string, rtpmap string, fmtp string)
|
||||
|
||||
func newTrackGenericFromMediaDescription(
|
||||
control string,
|
||||
md *psdp.MediaDescription) (*TrackGeneric, error) {
|
||||
md *psdp.MediaDescription,
|
||||
) (*TrackGeneric, error) {
|
||||
rtpmap := func() string {
|
||||
for _, attr := range md.Attributes {
|
||||
if attr.Key == "rtpmap" {
|
||||
|
@@ -80,7 +80,8 @@ func NewTrackH264(payloadType uint8, sps []byte, pps []byte, extradata []byte) (
|
||||
func newTrackH264FromMediaDescription(
|
||||
control string,
|
||||
payloadType uint8,
|
||||
md *psdp.MediaDescription) (*TrackH264, error) {
|
||||
md *psdp.MediaDescription,
|
||||
) (*TrackH264, error) {
|
||||
t := &TrackH264{
|
||||
trackBase: trackBase{
|
||||
control: control,
|
||||
|
@@ -29,7 +29,8 @@ func newTrackOpusFromMediaDescription(
|
||||
control string,
|
||||
payloadType uint8,
|
||||
rtpmapPart1 string,
|
||||
md *psdp.MediaDescription) (*TrackOpus, error) {
|
||||
md *psdp.MediaDescription,
|
||||
) (*TrackOpus, error) {
|
||||
tmp := strings.SplitN(rtpmapPart1, "/", 3)
|
||||
if len(tmp) != 3 {
|
||||
return nil, fmt.Errorf("invalid rtpmap (%v)", rtpmapPart1)
|
||||
|
Reference in New Issue
Block a user