Skip to content

Commit

Permalink
Merge branch 'aler9:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-ld authored Dec 29, 2022
2 parents c9d5175 + fbf8e82 commit 0040f2b
Show file tree
Hide file tree
Showing 29 changed files with 59 additions and 59 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
code.cloudfoundry.org/bytefmt v0.0.0-20211005130812-5bb3c17173e5
github.com/abema/go-mp4 v0.8.0
github.com/aler9/gortsplib/v2 v2.0.0-20221227124323-91f18ab6d93f
github.com/aler9/gortsplib/v2 v2.0.0-20221228192116-da21f946e562
github.com/asticode/go-astits v1.10.1-0.20220319093903-4abe66a9b757
github.com/fsnotify/fsnotify v1.4.9
github.com/gin-gonic/gin v1.8.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafo
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2cI+DC1Mbh0TJxzA3RcLoMsFw+aXw7E=
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
github.com/aler9/gortsplib/v2 v2.0.0-20221227124323-91f18ab6d93f h1:a3Hlki1+w0czcwKHOTAm9RBdIzGuQr2DF0CklloGwXU=
github.com/aler9/gortsplib/v2 v2.0.0-20221227124323-91f18ab6d93f/go.mod h1:lMdAxc6daduSzVwh75yQkvH9UHCYHpng/vJ8uXKFzdA=
github.com/aler9/gortsplib/v2 v2.0.0-20221228192116-da21f946e562 h1://BJIsHw2vYKdPL6sKbxZEnlGPpj2PTznNzRpou87ds=
github.com/aler9/gortsplib/v2 v2.0.0-20221228192116-da21f946e562/go.mod h1:lMdAxc6daduSzVwh75yQkvH9UHCYHpng/vJ8uXKFzdA=
github.com/aler9/writerseeker v0.0.0-20220601075008-6f0e685b9c82 h1:9WgSzBLo3a9ToSVV7sRTBYZ1GGOZUpq4+5H3SN0UZq4=
github.com/aler9/writerseeker v0.0.0-20220601075008-6f0e685b9c82/go.mod h1:qsMrZCbeBf/mCLOeF16KDkPu4gktn/pOWyaq1aYQE7U=
github.com/asticode/go-astikit v0.20.0 h1:+7N+J4E4lWx2QOkRdOf6DafWJMv6O4RRfgClwQokrH8=
Expand Down
2 changes: 1 addition & 1 deletion internal/core/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"time"

"github.com/aler9/gortsplib/v2"
"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/media"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
"github.com/pion/rtp"
"github.com/stretchr/testify/require"

Expand Down
2 changes: 1 addition & 1 deletion internal/core/formatprocessor_h264.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"bytes"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtph264"
"github.com/aler9/gortsplib/v2/pkg/h264"
"github.com/pion/rtp"
)

Expand Down
16 changes: 8 additions & 8 deletions internal/core/formatprocessor_h265.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"bytes"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h265"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtph265"
"github.com/aler9/gortsplib/v2/pkg/h265"
"github.com/pion/rtp"
)

Expand All @@ -19,16 +19,16 @@ func rtpH265ExtractVPSSPSPPS(pkt *rtp.Packet) ([]byte, []byte, []byte) {
typ := h265.NALUType((pkt.Payload[0] >> 1) & 0b111111)

switch typ {
case h265.NALUTypeVPS:
case h265.NALUType_VPS_NUT:
return pkt.Payload, nil, nil

case h265.NALUTypeSPS:
case h265.NALUType_SPS_NUT:
return nil, pkt.Payload, nil

case h265.NALUTypePPS:
case h265.NALUType_PPS_NUT:
return nil, nil, pkt.Payload

case h265.NALUTypeAggregationUnit:
case h265.NALUType_AggregationUnit:
payload := pkt.Payload[2:]
var vps []byte
var sps []byte
Expand Down Expand Up @@ -56,13 +56,13 @@ func rtpH265ExtractVPSSPSPPS(pkt *rtp.Packet) ([]byte, []byte, []byte) {
typ = h265.NALUType((pkt.Payload[0] >> 1) & 0b111111)

switch typ {
case h265.NALUTypeVPS:
case h265.NALUType_VPS_NUT:
vps = nalu

case h265.NALUTypeSPS:
case h265.NALUType_SPS_NUT:
sps = nalu

case h265.NALUTypePPS:
case h265.NALUType_PPS_NUT:
pps = nalu
}
}
Expand Down
2 changes: 1 addition & 1 deletion internal/core/hls_muxer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"sync/atomic"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/media"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/ringbuffer"
"github.com/gin-gonic/gin"

Expand Down
2 changes: 1 addition & 1 deletion internal/core/hls_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

"github.com/aler9/gortsplib/v2"
"github.com/aler9/gortsplib/v2/pkg/h264"
"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/url"
"github.com/asticode/go-astits"
"github.com/gin-gonic/gin"
Expand Down
4 changes: 2 additions & 2 deletions internal/core/rtmp_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"sync"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/h264"
"github.com/aler9/gortsplib/v2/pkg/media"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/ringbuffer"
"github.com/google/uuid"
"github.com/notedit/rtmp/format/flv/flvio"
Expand Down
2 changes: 1 addition & 1 deletion internal/core/rtmp_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
"testing"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
"github.com/notedit/rtmp/format/flv/flvio"
"github.com/stretchr/testify/require"

Expand Down
2 changes: 1 addition & 1 deletion internal/core/rtmp_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"strings"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/h264"
"github.com/aler9/gortsplib/v2/pkg/media"
"github.com/notedit/rtmp/format/flv/flvio"

Expand Down
2 changes: 1 addition & 1 deletion internal/core/rtmp_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"testing"

"github.com/aler9/gortsplib/v2"
"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/url"
"github.com/notedit/rtmp/format/flv/flvio"
"github.com/pion/rtp"
Expand Down
26 changes: 13 additions & 13 deletions internal/core/rtsp_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"github.com/aler9/gortsplib/v2"
"github.com/aler9/gortsplib/v2/pkg/auth"
"github.com/aler9/gortsplib/v2/pkg/base"
"github.com/aler9/gortsplib/v2/pkg/codecs/h265"
"github.com/aler9/gortsplib/v2/pkg/conn"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/h265"
"github.com/aler9/gortsplib/v2/pkg/headers"
"github.com/aler9/gortsplib/v2/pkg/media"
"github.com/aler9/gortsplib/v2/pkg/url"
Expand Down Expand Up @@ -385,42 +385,42 @@ func TestRTSPSourceDynamicH264Params(t *testing.T) {

enc := forma.CreateEncoder()

pkts, err := enc.Encode([][]byte{{byte(h265.NALUTypeVPS) << 1, 1, 2, 3}}, 0)
pkts, err := enc.Encode([][]byte{{byte(h265.NALUType_VPS_NUT) << 1, 1, 2, 3}}, 0)
require.NoError(t, err)
stream.WritePacketRTP(medi, pkts[0])

pkts, err = enc.Encode([][]byte{{byte(h265.NALUTypeSPS) << 1, 4, 5, 6}}, 0)
pkts, err = enc.Encode([][]byte{{byte(h265.NALUType_SPS_NUT) << 1, 4, 5, 6}}, 0)
require.NoError(t, err)
stream.WritePacketRTP(medi, pkts[0])

pkts, err = enc.Encode([][]byte{{byte(h265.NALUTypePPS) << 1, 7, 8, 9}}, 0)
pkts, err = enc.Encode([][]byte{{byte(h265.NALUType_PPS_NUT) << 1, 7, 8, 9}}, 0)
require.NoError(t, err)
stream.WritePacketRTP(medi, pkts[0])

checkTrack(t, &format.H265{
PayloadTyp: 96,
VPS: []byte{byte(h265.NALUTypeVPS) << 1, 1, 2, 3},
SPS: []byte{byte(h265.NALUTypeSPS) << 1, 4, 5, 6},
PPS: []byte{byte(h265.NALUTypePPS) << 1, 7, 8, 9},
VPS: []byte{byte(h265.NALUType_VPS_NUT) << 1, 1, 2, 3},
SPS: []byte{byte(h265.NALUType_SPS_NUT) << 1, 4, 5, 6},
PPS: []byte{byte(h265.NALUType_PPS_NUT) << 1, 7, 8, 9},
})

pkts, err = enc.Encode([][]byte{{byte(h265.NALUTypeVPS) << 1, 10, 11, 12}}, 0)
pkts, err = enc.Encode([][]byte{{byte(h265.NALUType_VPS_NUT) << 1, 10, 11, 12}}, 0)
require.NoError(t, err)
stream.WritePacketRTP(medi, pkts[0])

pkts, err = enc.Encode([][]byte{{byte(h265.NALUTypeSPS) << 1, 13, 14, 15}}, 0)
pkts, err = enc.Encode([][]byte{{byte(h265.NALUType_SPS_NUT) << 1, 13, 14, 15}}, 0)
require.NoError(t, err)
stream.WritePacketRTP(medi, pkts[0])

pkts, err = enc.Encode([][]byte{{byte(h265.NALUTypePPS) << 1, 16, 17, 18}}, 0)
pkts, err = enc.Encode([][]byte{{byte(h265.NALUType_PPS_NUT) << 1, 16, 17, 18}}, 0)
require.NoError(t, err)
stream.WritePacketRTP(medi, pkts[0])

checkTrack(t, &format.H265{
PayloadTyp: 96,
VPS: []byte{byte(h265.NALUTypeVPS) << 1, 10, 11, 12},
SPS: []byte{byte(h265.NALUTypeSPS) << 1, 13, 14, 15},
PPS: []byte{byte(h265.NALUTypePPS) << 1, 16, 17, 18},
VPS: []byte{byte(h265.NALUType_VPS_NUT) << 1, 10, 11, 12},
SPS: []byte{byte(h265.NALUType_SPS_NUT) << 1, 13, 14, 15},
PPS: []byte{byte(h265.NALUType_PPS_NUT) << 1, 16, 17, 18},
})
})
}
Expand Down
2 changes: 1 addition & 1 deletion internal/core/webrtc_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ import (
"sync"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtph264"
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpvp8"
"github.com/aler9/gortsplib/v2/pkg/formatdecenc/rtpvp9"
"github.com/aler9/gortsplib/v2/pkg/h264"
"github.com/aler9/gortsplib/v2/pkg/media"
"github.com/aler9/gortsplib/v2/pkg/ringbuffer"
"github.com/google/uuid"
Expand Down
2 changes: 1 addition & 1 deletion internal/hls/client_processor_fmp4.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/h264"

"github.com/aler9/rtsp-simple-server/internal/hls/fmp4"
)
Expand Down
4 changes: 2 additions & 2 deletions internal/hls/client_processor_mpegts.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strings"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/h264"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
"github.com/asticode/go-astits"

"github.com/aler9/rtsp-simple-server/internal/hls/mpegts"
Expand Down
2 changes: 1 addition & 1 deletion internal/hls/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"testing"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/h264"
"github.com/asticode/go-astits"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion internal/hls/fmp4/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"fmt"

gomp4 "github.com/abema/go-mp4"
"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
)

// Init is a FMP4 initialization file.
Expand Down
2 changes: 1 addition & 1 deletion internal/hls/fmp4/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ package fmp4
import (
"testing"

"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/hls/fmp4/init_track.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package fmp4

import (
gomp4 "github.com/abema/go-mp4"
"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/h264"
)

// InitTrack is a track of Init.
Expand Down
2 changes: 1 addition & 1 deletion internal/hls/mpegts/tracks.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"context"
"fmt"

"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
"github.com/asticode/go-astits"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/hls/mpegts/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"context"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/h264"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
"github.com/asticode/go-astits"
)

Expand Down
4 changes: 2 additions & 2 deletions internal/hls/mpegts/writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"testing"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/h264"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
"github.com/asticode/go-astits"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/hls/muxer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"testing"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"
"github.com/stretchr/testify/require"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/hls/muxer_variant_fmp4_part.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strconv"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/mpeg4audio"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/mpeg4audio"

"github.com/aler9/rtsp-simple-server/internal/hls/fmp4"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/hls/muxer_variant_fmp4_segmenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"bytes"
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/h264"

"github.com/aler9/rtsp-simple-server/internal/hls/fmp4"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/hls/muxer_variant_mpegts_segmenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package hls
import (
"time"

"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
"github.com/aler9/gortsplib/v2/pkg/format"
"github.com/aler9/gortsplib/v2/pkg/h264"

"github.com/aler9/rtsp-simple-server/internal/hls/mpegts"
)
Expand Down
2 changes: 1 addition & 1 deletion internal/rpicamera/rpicamera.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strings"
"time"

"github.com/aler9/gortsplib/v2/pkg/h264"
"github.com/aler9/gortsplib/v2/pkg/codecs/h264"
)

//go:embed exe/exe
Expand Down
Loading

0 comments on commit 0040f2b

Please sign in to comment.