From e3b8af8933ddb65a607e3326803726c65eb50879 Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Tue, 16 Sep 2025 13:10:34 +0200 Subject: [PATCH] switch to gortsplib/v5 (#4978) --- .golangci.yml | 10 +-- go.mod | 6 +- go.sum | 12 +-- internal/codecprocessor/ac3.go | 4 +- internal/codecprocessor/av1.go | 4 +- internal/codecprocessor/av1_test.go | 2 +- internal/codecprocessor/g711.go | 4 +- internal/codecprocessor/g711_test.go | 2 +- internal/codecprocessor/generic.go | 2 +- internal/codecprocessor/generic_test.go | 2 +- internal/codecprocessor/h264.go | 4 +- internal/codecprocessor/h264_test.go | 2 +- internal/codecprocessor/h265.go | 4 +- internal/codecprocessor/h265_test.go | 2 +- internal/codecprocessor/klv.go | 4 +- internal/codecprocessor/klv_test.go | 2 +- internal/codecprocessor/lpcm.go | 4 +- internal/codecprocessor/lpcm_test.go | 2 +- internal/codecprocessor/mjpeg.go | 4 +- internal/codecprocessor/mpeg1_audio.go | 4 +- internal/codecprocessor/mpeg1_video.go | 4 +- internal/codecprocessor/mpeg4_audio.go | 4 +- internal/codecprocessor/mpeg4_audio_latm.go | 6 +- internal/codecprocessor/mpeg4_video.go | 4 +- internal/codecprocessor/mpeg4_video_test.go | 2 +- internal/codecprocessor/opus.go | 4 +- internal/codecprocessor/opus_test.go | 2 +- internal/codecprocessor/processor.go | 2 +- internal/codecprocessor/processor_test.go | 2 +- internal/codecprocessor/vp8.go | 4 +- internal/codecprocessor/vp9.go | 4 +- internal/conf/conf.go | 10 +-- internal/conf/conf_test.go | 4 +- internal/conf/path.go | 2 +- internal/conf/rtsp_auth_methods.go | 2 +- internal/conf/rtsp_transport.go | 26 +++--- internal/conf/rtsp_transports.go | 14 ++-- internal/core/api_test.go | 6 +- internal/core/core.go | 10 +-- internal/core/core_test.go | 4 +- internal/core/metrics_test.go | 6 +- internal/core/path.go | 2 +- internal/core/path_manager_test.go | 8 +- internal/core/path_test.go | 22 ++--- internal/core/test_on_demand/main.go | 6 +- internal/defs/path.go | 2 +- internal/defs/source.go | 4 +- internal/protocols/hls/from_stream.go | 4 +- internal/protocols/hls/from_stream_test.go | 4 +- internal/protocols/hls/to_stream.go | 4 +- internal/protocols/hls/to_stream_test.go | 4 +- internal/protocols/mpegts/from_stream.go | 4 +- internal/protocols/mpegts/from_stream_test.go | 4 +- internal/protocols/mpegts/to_stream.go | 4 +- internal/protocols/mpegts/to_stream_test.go | 4 +- internal/protocols/rtmp/from_stream.go | 2 +- internal/protocols/rtmp/from_stream_test.go | 4 +- internal/protocols/rtmp/to_stream.go | 4 +- internal/protocols/rtsp/credentials.go | 4 +- internal/protocols/rtsp/credentials_test.go | 2 +- internal/protocols/rtsp/to_stream.go | 10 +-- internal/protocols/udp/udp.go | 4 +- internal/protocols/webrtc/from_stream.go | 14 ++-- internal/protocols/webrtc/from_stream_test.go | 4 +- internal/protocols/webrtc/incoming_track.go | 8 +- internal/protocols/webrtc/outgoing_track.go | 6 +- internal/protocols/webrtc/to_stream.go | 8 +- internal/protocols/webrtc/to_stream_test.go | 2 +- internal/recorder/format_fmp4.go | 2 +- internal/recorder/format_mpegts.go | 2 +- internal/recorder/recorder_test.go | 4 +- internal/servers/hls/server_test.go | 2 +- internal/servers/rtmp/conn.go | 2 +- internal/servers/rtmp/server_test.go | 4 +- internal/servers/rtsp/conn.go | 10 +-- internal/servers/rtsp/server.go | 8 +- internal/servers/rtsp/server_test.go | 20 ++--- internal/servers/rtsp/session.go | 83 +++++++------------ internal/servers/srt/conn.go | 2 +- internal/servers/srt/server_test.go | 2 +- internal/servers/webrtc/server_test.go | 4 +- internal/servers/webrtc/session.go | 2 +- internal/staticsources/hls/source.go | 2 +- internal/staticsources/mpegts/source.go | 2 +- internal/staticsources/rpicamera/source.go | 8 +- internal/staticsources/rtmp/source.go | 2 +- internal/staticsources/rtmp/source_test.go | 2 +- internal/staticsources/rtp/source.go | 10 +-- internal/staticsources/rtp/source_test.go | 2 +- internal/staticsources/rtsp/source.go | 10 +-- internal/staticsources/rtsp/source_test.go | 8 +- internal/staticsources/srt/source.go | 2 +- internal/staticsources/webrtc/source.go | 2 +- internal/stream/stream.go | 6 +- internal/stream/stream_format.go | 4 +- internal/stream/stream_media.go | 4 +- internal/stream/stream_reader.go | 2 +- internal/test/formats.go | 2 +- internal/test/medias.go | 4 +- 99 files changed, 272 insertions(+), 297 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 1911cbfc..77c31197 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -56,11 +56,11 @@ linters: - (github.com/datarhei/gosrt.Conn).Close - (github.com/datarhei/gosrt.Conn).SetReadDeadline - (github.com/datarhei/gosrt.Conn).SetWriteDeadline - - (*github.com/bluenviron/gortsplib/v4.Client).Close - - (*github.com/bluenviron/gortsplib/v4.Server).Close - - (*github.com/bluenviron/gortsplib/v4.ServerSession).Close - - (*github.com/bluenviron/gortsplib/v4.ServerStream).Close - - (*github.com/bluenviron/gortsplib/v4.ServerConn).Close + - (*github.com/bluenviron/gortsplib/v5.Client).Close + - (*github.com/bluenviron/gortsplib/v5.Server).Close + - (*github.com/bluenviron/gortsplib/v5.ServerSession).Close + - (*github.com/bluenviron/gortsplib/v5.ServerStream).Close + - (*github.com/bluenviron/gortsplib/v5.ServerConn).Close govet: enable-all: true diff --git a/go.mod b/go.mod index 89af22a7..ebcad26f 100644 --- a/go.mod +++ b/go.mod @@ -10,8 +10,8 @@ require ( github.com/alecthomas/kong v1.12.1 github.com/asticode/go-astits v1.13.0 github.com/bluenviron/gohlslib/v2 v2.2.3 - github.com/bluenviron/gortmplib v0.0.0-20250913092258-91acda098766 - github.com/bluenviron/gortsplib/v4 v4.16.2 + github.com/bluenviron/gortmplib v0.0.0-20250916095243-72b6eaffb6a4 + github.com/bluenviron/gortsplib/v5 v5.0.0-20250916102828-1616c8c63415 github.com/bluenviron/mediacommon/v2 v2.4.2 github.com/datarhei/gosrt v0.9.0 github.com/fsnotify/fsnotify v1.9.0 @@ -88,7 +88,7 @@ require ( github.com/xanzy/ssh-agent v0.3.3 // indirect github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect golang.org/x/arch v0.16.0 // indirect - golang.org/x/net v0.43.0 // indirect + golang.org/x/net v0.44.0 // indirect golang.org/x/text v0.29.0 // indirect golang.org/x/time v0.9.0 // indirect google.golang.org/protobuf v1.36.6 // indirect diff --git a/go.sum b/go.sum index a5364ec9..3da3e94d 100644 --- a/go.sum +++ b/go.sum @@ -33,10 +33,10 @@ github.com/benburkert/openpgp v0.0.0-20160410205803-c2471f86866c h1:8XZeJrs4+ZYh github.com/benburkert/openpgp v0.0.0-20160410205803-c2471f86866c/go.mod h1:x1vxHcL/9AVzuk5HOloOEPrtJY0MaalYr78afXZ+pWI= github.com/bluenviron/gohlslib/v2 v2.2.3 h1:1R/Jnh1kNR9UB09KAX6xjS2GcdKFRLuPd9wM/IRVyKQ= github.com/bluenviron/gohlslib/v2 v2.2.3/go.mod h1:z4Viks+Mdgcl7OcOVJ1fgSmuUwCCJBxYJPLN49n7Vnw= -github.com/bluenviron/gortmplib v0.0.0-20250913092258-91acda098766 h1:i3Bu0Ou34hbxEyrmldAudvDm7T6qDCkaC0TrECVxXQM= -github.com/bluenviron/gortmplib v0.0.0-20250913092258-91acda098766/go.mod h1:FyreWlRZNHSzCG7TkVT66+9n31w1uUBFgWg0G86YCfk= -github.com/bluenviron/gortsplib/v4 v4.16.2 h1:10HaMsorjW13gscLp3R7Oj41ck2i1EHIUYCNWD2wpkI= -github.com/bluenviron/gortsplib/v4 v4.16.2/go.mod h1:Vm07yUMys9XKnuZJLfTT8zluAN2n9ZOtz40Xb8RKh+8= +github.com/bluenviron/gortmplib v0.0.0-20250916095243-72b6eaffb6a4 h1:ZDsCiFpmOoEy2eWcJBEhV8jb0sA9MxO/BzYmyrmm4hE= +github.com/bluenviron/gortmplib v0.0.0-20250916095243-72b6eaffb6a4/go.mod h1:73VbUEJLkaixSRPRI/imEkVRkBccvR1GKrd6SUOdkrQ= +github.com/bluenviron/gortsplib/v5 v5.0.0-20250916102828-1616c8c63415 h1:FErClZLSuXkZEPfIsAtD4DH6CKmQ6z7gtod1eHi4Efg= +github.com/bluenviron/gortsplib/v5 v5.0.0-20250916102828-1616c8c63415/go.mod h1:un/XrjuE+yaglJw4Fd75OUXowPxioaHHqNOUC28byFA= github.com/bluenviron/mediacommon/v2 v2.4.2 h1:rggs61nTaqPcR1+RhlIE8/nDqfF5PO57QxpxBzSFfrw= github.com/bluenviron/mediacommon/v2 v2.4.2/go.mod h1:zy1fODPuS/kBd93ftgJS1Jhvjq7LFWfAo32KP7By9AE= github.com/bytedance/sonic v1.13.2 h1:8/H1FempDZqC4VqjptGo14QQlJx8VdZJegxs6wwfqpQ= @@ -239,8 +239,8 @@ golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.43.0 h1:lat02VYK2j4aLzMzecihNvTlJNQUq316m2Mr9rnM6YE= -golang.org/x/net v0.43.0/go.mod h1:vhO1fvI4dGsIjh73sWfUVjj3N7CA9WkKJNQm2svM6Jg= +golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= +golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/internal/codecprocessor/ac3.go b/internal/codecprocessor/ac3.go index c99ab378..22eb53d1 100644 --- a/internal/codecprocessor/ac3.go +++ b/internal/codecprocessor/ac3.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpac3" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpac3" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/av1.go b/internal/codecprocessor/av1.go index 432186d0..8e0106f5 100644 --- a/internal/codecprocessor/av1.go +++ b/internal/codecprocessor/av1.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpav1" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpav1" mcav1 "github.com/bluenviron/mediacommon/v2/pkg/codecs/av1" "github.com/pion/rtp" diff --git a/internal/codecprocessor/av1_test.go b/internal/codecprocessor/av1_test.go index f93adc17..36074ebb 100644 --- a/internal/codecprocessor/av1_test.go +++ b/internal/codecprocessor/av1_test.go @@ -3,7 +3,7 @@ package codecprocessor import ( "testing" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" mcav1 "github.com/bluenviron/mediacommon/v2/pkg/codecs/av1" "github.com/bluenviron/mediamtx/internal/unit" "github.com/stretchr/testify/require" diff --git a/internal/codecprocessor/g711.go b/internal/codecprocessor/g711.go index a0f1dd15..3f8b89f1 100644 --- a/internal/codecprocessor/g711.go +++ b/internal/codecprocessor/g711.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtplpcm" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtplpcm" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/g711_test.go b/internal/codecprocessor/g711_test.go index 55df9829..214b05d1 100644 --- a/internal/codecprocessor/g711_test.go +++ b/internal/codecprocessor/g711_test.go @@ -3,7 +3,7 @@ package codecprocessor import ( "testing" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/unit" "github.com/pion/rtp" "github.com/stretchr/testify/require" diff --git a/internal/codecprocessor/generic.go b/internal/codecprocessor/generic.go index cbf5b25f..264cc8aa 100644 --- a/internal/codecprocessor/generic.go +++ b/internal/codecprocessor/generic.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/generic_test.go b/internal/codecprocessor/generic_test.go index cd9da583..66e9e3eb 100644 --- a/internal/codecprocessor/generic_test.go +++ b/internal/codecprocessor/generic_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/pion/rtp" "github.com/stretchr/testify/require" ) diff --git a/internal/codecprocessor/h264.go b/internal/codecprocessor/h264.go index 1ed91bf3..c3cc9e08 100644 --- a/internal/codecprocessor/h264.go +++ b/internal/codecprocessor/h264.go @@ -5,8 +5,8 @@ import ( "errors" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtph264" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtph264" mch264 "github.com/bluenviron/mediacommon/v2/pkg/codecs/h264" "github.com/pion/rtp" diff --git a/internal/codecprocessor/h264_test.go b/internal/codecprocessor/h264_test.go index 8ea2e719..fabec875 100644 --- a/internal/codecprocessor/h264_test.go +++ b/internal/codecprocessor/h264_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" mch264 "github.com/bluenviron/mediacommon/v2/pkg/codecs/h264" "github.com/pion/rtp" "github.com/stretchr/testify/require" diff --git a/internal/codecprocessor/h265.go b/internal/codecprocessor/h265.go index 916a9766..31d51865 100644 --- a/internal/codecprocessor/h265.go +++ b/internal/codecprocessor/h265.go @@ -5,8 +5,8 @@ import ( "errors" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtph265" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtph265" mch265 "github.com/bluenviron/mediacommon/v2/pkg/codecs/h265" "github.com/pion/rtp" diff --git a/internal/codecprocessor/h265_test.go b/internal/codecprocessor/h265_test.go index 7601d5e3..adffbad7 100644 --- a/internal/codecprocessor/h265_test.go +++ b/internal/codecprocessor/h265_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" mch265 "github.com/bluenviron/mediacommon/v2/pkg/codecs/h265" "github.com/pion/rtp" "github.com/stretchr/testify/require" diff --git a/internal/codecprocessor/klv.go b/internal/codecprocessor/klv.go index 3e958bba..32df8c78 100644 --- a/internal/codecprocessor/klv.go +++ b/internal/codecprocessor/klv.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpklv" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpklv" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/klv_test.go b/internal/codecprocessor/klv_test.go index ff35e48d..53678463 100644 --- a/internal/codecprocessor/klv_test.go +++ b/internal/codecprocessor/klv_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/unit" "github.com/pion/rtp" "github.com/stretchr/testify/require" diff --git a/internal/codecprocessor/lpcm.go b/internal/codecprocessor/lpcm.go index 04ecd6d6..7c11f2c4 100644 --- a/internal/codecprocessor/lpcm.go +++ b/internal/codecprocessor/lpcm.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtplpcm" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtplpcm" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/lpcm_test.go b/internal/codecprocessor/lpcm_test.go index 3d11ac90..dac478e9 100644 --- a/internal/codecprocessor/lpcm_test.go +++ b/internal/codecprocessor/lpcm_test.go @@ -3,7 +3,7 @@ package codecprocessor import ( "testing" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/unit" "github.com/pion/rtp" "github.com/stretchr/testify/require" diff --git a/internal/codecprocessor/mjpeg.go b/internal/codecprocessor/mjpeg.go index 1df30f47..61938ed1 100644 --- a/internal/codecprocessor/mjpeg.go +++ b/internal/codecprocessor/mjpeg.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmjpeg" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpmjpeg" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/mpeg1_audio.go b/internal/codecprocessor/mpeg1_audio.go index 6ef4cff7..d2fb0a3f 100644 --- a/internal/codecprocessor/mpeg1_audio.go +++ b/internal/codecprocessor/mpeg1_audio.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmpeg1audio" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpmpeg1audio" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/mpeg1_video.go b/internal/codecprocessor/mpeg1_video.go index e5d9b53e..f9c58e8c 100644 --- a/internal/codecprocessor/mpeg1_video.go +++ b/internal/codecprocessor/mpeg1_video.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmpeg1video" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpmpeg1video" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/mpeg4_audio.go b/internal/codecprocessor/mpeg4_audio.go index 7e1f757c..063bb4e8 100644 --- a/internal/codecprocessor/mpeg4_audio.go +++ b/internal/codecprocessor/mpeg4_audio.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmpeg4audio" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpmpeg4audio" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/mpeg4_audio_latm.go b/internal/codecprocessor/mpeg4_audio_latm.go index d3333429..122520f1 100644 --- a/internal/codecprocessor/mpeg4_audio_latm.go +++ b/internal/codecprocessor/mpeg4_audio_latm.go @@ -5,9 +5,9 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpfragmented" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmpeg4audio" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpfragmented" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpmpeg4audio" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/mpeg4_video.go b/internal/codecprocessor/mpeg4_video.go index f8483358..9a786785 100644 --- a/internal/codecprocessor/mpeg4_video.go +++ b/internal/codecprocessor/mpeg4_video.go @@ -6,8 +6,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpfragmented" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpfragmented" "github.com/bluenviron/mediacommon/v2/pkg/codecs/mpeg4video" "github.com/pion/rtp" diff --git a/internal/codecprocessor/mpeg4_video_test.go b/internal/codecprocessor/mpeg4_video_test.go index 810022e9..add59722 100644 --- a/internal/codecprocessor/mpeg4_video_test.go +++ b/internal/codecprocessor/mpeg4_video_test.go @@ -3,7 +3,7 @@ package codecprocessor import ( "testing" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/codecs/mpeg4video" "github.com/bluenviron/mediamtx/internal/unit" "github.com/stretchr/testify/require" diff --git a/internal/codecprocessor/opus.go b/internal/codecprocessor/opus.go index 153cb964..d82c33f1 100644 --- a/internal/codecprocessor/opus.go +++ b/internal/codecprocessor/opus.go @@ -4,8 +4,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpsimpleaudio" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpsimpleaudio" mcopus "github.com/bluenviron/mediacommon/v2/pkg/codecs/opus" "github.com/pion/rtp" diff --git a/internal/codecprocessor/opus_test.go b/internal/codecprocessor/opus_test.go index 58d91634..41c1ca80 100644 --- a/internal/codecprocessor/opus_test.go +++ b/internal/codecprocessor/opus_test.go @@ -3,7 +3,7 @@ package codecprocessor import ( "testing" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/unit" "github.com/pion/rtp" "github.com/stretchr/testify/require" diff --git a/internal/codecprocessor/processor.go b/internal/codecprocessor/processor.go index a6595823..e13ab0d0 100644 --- a/internal/codecprocessor/processor.go +++ b/internal/codecprocessor/processor.go @@ -5,7 +5,7 @@ import ( "crypto/rand" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/processor_test.go b/internal/codecprocessor/processor_test.go index 06211bb1..fd33e5e5 100644 --- a/internal/codecprocessor/processor_test.go +++ b/internal/codecprocessor/processor_test.go @@ -3,7 +3,7 @@ package codecprocessor import ( "testing" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/stretchr/testify/require" ) diff --git a/internal/codecprocessor/vp8.go b/internal/codecprocessor/vp8.go index 856b487a..6d76a0d9 100644 --- a/internal/codecprocessor/vp8.go +++ b/internal/codecprocessor/vp8.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpvp8" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpvp8" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/codecprocessor/vp9.go b/internal/codecprocessor/vp9.go index 3787d1ea..bc1c82cd 100644 --- a/internal/codecprocessor/vp9.go +++ b/internal/codecprocessor/vp9.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpvp9" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpvp9" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/logger" diff --git a/internal/conf/conf.go b/internal/conf/conf.go index 2a32e331..66565dcf 100644 --- a/internal/conf/conf.go +++ b/internal/conf/conf.go @@ -14,8 +14,8 @@ import ( "time" "github.com/bluenviron/gohlslib/v2" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/auth" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/auth" "github.com/bluenviron/mediamtx/internal/conf/decrypt" "github.com/bluenviron/mediamtx/internal/conf/env" @@ -362,9 +362,9 @@ func (conf *Conf) setDefaults() { // RTSP server conf.RTSP = true conf.RTSPTransports = RTSPTransports{ - gortsplib.TransportUDP: {}, - gortsplib.TransportUDPMulticast: {}, - gortsplib.TransportTCP: {}, + gortsplib.ProtocolUDP: {}, + gortsplib.ProtocolUDPMulticast: {}, + gortsplib.ProtocolTCP: {}, } conf.RTSPAddress = ":8554" conf.RTSPSAddress = ":8322" diff --git a/internal/conf/conf_test.go b/internal/conf/conf_test.go index d868617d..8534087b 100644 --- a/internal/conf/conf_test.go +++ b/internal/conf/conf_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4" + "github.com/bluenviron/gortsplib/v5" "github.com/stretchr/testify/require" "golang.org/x/crypto/nacl/secretbox" @@ -138,7 +138,7 @@ func TestConfFromFileAndEnv(t *testing.T) { require.NoError(t, err) require.Equal(t, tmpf, confPath) - require.Equal(t, RTSPTransports{gortsplib.TransportTCP: {}}, conf.RTSPTransports) + require.Equal(t, RTSPTransports{gortsplib.ProtocolTCP: {}}, conf.RTSPTransports) require.Equal(t, false, conf.RTMP) pa, ok := conf.Paths["cam1"] diff --git a/internal/conf/path.go b/internal/conf/path.go index 1afaf578..16c38607 100644 --- a/internal/conf/path.go +++ b/internal/conf/path.go @@ -11,7 +11,7 @@ import ( "strings" "time" - "github.com/bluenviron/gortsplib/v4/pkg/base" + "github.com/bluenviron/gortsplib/v5/pkg/base" "github.com/bluenviron/mediamtx/internal/logger" ) diff --git a/internal/conf/rtsp_auth_methods.go b/internal/conf/rtsp_auth_methods.go index 2cd637e8..06587dbe 100644 --- a/internal/conf/rtsp_auth_methods.go +++ b/internal/conf/rtsp_auth_methods.go @@ -6,7 +6,7 @@ import ( "sort" "strings" - "github.com/bluenviron/gortsplib/v4/pkg/auth" + "github.com/bluenviron/gortsplib/v5/pkg/auth" "github.com/bluenviron/mediamtx/internal/conf/jsonwrapper" ) diff --git a/internal/conf/rtsp_transport.go b/internal/conf/rtsp_transport.go index ecb1bf0f..bda08c36 100644 --- a/internal/conf/rtsp_transport.go +++ b/internal/conf/rtsp_transport.go @@ -4,27 +4,27 @@ import ( "encoding/json" "fmt" - "github.com/bluenviron/gortsplib/v4" + "github.com/bluenviron/gortsplib/v5" "github.com/bluenviron/mediamtx/internal/conf/jsonwrapper" ) // RTSPTransport is the rtspTransport parameter. type RTSPTransport struct { - *gortsplib.Transport + *gortsplib.Protocol } // MarshalJSON implements json.Marshaler. func (d RTSPTransport) MarshalJSON() ([]byte, error) { var out string - if d.Transport == nil { + if d.Protocol == nil { out = "automatic" } else { - switch *d.Transport { - case gortsplib.TransportUDP: + switch *d.Protocol { + case gortsplib.ProtocolUDP: out = "udp" - case gortsplib.TransportUDPMulticast: + case gortsplib.ProtocolUDPMulticast: out = "multicast" default: @@ -44,19 +44,19 @@ func (d *RTSPTransport) UnmarshalJSON(b []byte) error { switch in { case "udp": - v := gortsplib.TransportUDP - d.Transport = &v + v := gortsplib.ProtocolUDP + d.Protocol = &v case "multicast": - v := gortsplib.TransportUDPMulticast - d.Transport = &v + v := gortsplib.ProtocolUDPMulticast + d.Protocol = &v case "tcp": - v := gortsplib.TransportTCP - d.Transport = &v + v := gortsplib.ProtocolTCP + d.Protocol = &v case "automatic": - d.Transport = nil + d.Protocol = nil default: return fmt.Errorf("invalid transport '%s'", in) diff --git a/internal/conf/rtsp_transports.go b/internal/conf/rtsp_transports.go index e13a2310..25ee3fdd 100644 --- a/internal/conf/rtsp_transports.go +++ b/internal/conf/rtsp_transports.go @@ -6,12 +6,12 @@ import ( "sort" "strings" - "github.com/bluenviron/gortsplib/v4" + "github.com/bluenviron/gortsplib/v5" "github.com/bluenviron/mediamtx/internal/conf/jsonwrapper" ) // RTSPTransports is the rtspTransports parameter. -type RTSPTransports map[gortsplib.Transport]struct{} +type RTSPTransports map[gortsplib.Protocol]struct{} // MarshalJSON implements json.Marshaler. func (d RTSPTransports) MarshalJSON() ([]byte, error) { @@ -22,10 +22,10 @@ func (d RTSPTransports) MarshalJSON() ([]byte, error) { var v string switch p { - case gortsplib.TransportUDP: + case gortsplib.ProtocolUDP: v = "udp" - case gortsplib.TransportUDPMulticast: + case gortsplib.ProtocolUDPMulticast: v = "multicast" default: @@ -53,13 +53,13 @@ func (d *RTSPTransports) UnmarshalJSON(b []byte) error { for _, proto := range in { switch proto { case "udp": - (*d)[gortsplib.TransportUDP] = struct{}{} + (*d)[gortsplib.ProtocolUDP] = struct{}{} case "multicast": - (*d)[gortsplib.TransportUDPMulticast] = struct{}{} + (*d)[gortsplib.ProtocolUDPMulticast] = struct{}{} case "tcp": - (*d)[gortsplib.TransportTCP] = struct{}{} + (*d)[gortsplib.ProtocolTCP] = struct{}{} default: return fmt.Errorf("invalid transport: %s", proto) diff --git a/internal/core/api_test.go b/internal/core/api_test.go index 6762db50..6e80f199 100644 --- a/internal/core/api_test.go +++ b/internal/core/api_test.go @@ -15,9 +15,9 @@ import ( "time" "github.com/bluenviron/gortmplib" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/formats/mpegts" srt "github.com/datarhei/gosrt" "github.com/google/uuid" diff --git a/internal/core/core.go b/internal/core/core.go index fb9f3a0e..31642013 100644 --- a/internal/core/core.go +++ b/internal/core/core.go @@ -15,7 +15,7 @@ import ( "time" "github.com/alecthomas/kong" - "github.com/bluenviron/gortsplib/v4" + "github.com/bluenviron/gortsplib/v5" "github.com/gin-gonic/gin" "github.com/bluenviron/mediamtx/internal/api" @@ -389,8 +389,8 @@ func (p *Core) createResources(initial bool) error { (p.conf.RTSPEncryption == conf.EncryptionNo || p.conf.RTSPEncryption == conf.EncryptionOptional) && p.rtspServer == nil { - _, useUDP := p.conf.RTSPTransports[gortsplib.TransportUDP] - _, useMulticast := p.conf.RTSPTransports[gortsplib.TransportUDPMulticast] + _, useUDP := p.conf.RTSPTransports[gortsplib.ProtocolUDP] + _, useMulticast := p.conf.RTSPTransports[gortsplib.ProtocolUDPMulticast] i := &rtsp.Server{ Address: p.conf.RTSPAddress, @@ -430,8 +430,8 @@ func (p *Core) createResources(initial bool) error { (p.conf.RTSPEncryption == conf.EncryptionStrict || p.conf.RTSPEncryption == conf.EncryptionOptional) && p.rtspsServer == nil { - _, useUDP := p.conf.RTSPTransports[gortsplib.TransportUDP] - _, useMulticast := p.conf.RTSPTransports[gortsplib.TransportUDPMulticast] + _, useUDP := p.conf.RTSPTransports[gortsplib.ProtocolUDP] + _, useMulticast := p.conf.RTSPTransports[gortsplib.ProtocolUDPMulticast] i := &rtsp.Server{ Address: p.conf.RTSPSAddress, diff --git a/internal/core/core_test.go b/internal/core/core_test.go index b882b725..1466b600 100644 --- a/internal/core/core_test.go +++ b/internal/core/core_test.go @@ -6,8 +6,8 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/bluenviron/mediamtx/internal/test" "github.com/stretchr/testify/require" ) diff --git a/internal/core/metrics_test.go b/internal/core/metrics_test.go index a0d56bc6..6c73ef10 100644 --- a/internal/core/metrics_test.go +++ b/internal/core/metrics_test.go @@ -13,9 +13,9 @@ import ( "time" "github.com/bluenviron/gortmplib" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/formats/mpegts" srt "github.com/datarhei/gosrt" "github.com/pion/rtp" diff --git a/internal/core/path.go b/internal/core/path.go index 23b93356..118f23ee 100644 --- a/internal/core/path.go +++ b/internal/core/path.go @@ -8,7 +8,7 @@ import ( "sync" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/defs" diff --git a/internal/core/path_manager_test.go b/internal/core/path_manager_test.go index c4c66b50..f3bed21b 100644 --- a/internal/core/path_manager_test.go +++ b/internal/core/path_manager_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/headers" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/base" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/headers" "github.com/pion/rtp" "github.com/stretchr/testify/require" diff --git a/internal/core/path_test.go b/internal/core/path_test.go index 521b469b..7a93bc97 100644 --- a/internal/core/path_test.go +++ b/internal/core/path_test.go @@ -15,11 +15,11 @@ import ( "time" "github.com/bluenviron/gortmplib" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/headers" - "github.com/bluenviron/gortsplib/v4/pkg/sdp" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/base" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/headers" + "github.com/bluenviron/gortsplib/v5/pkg/sdp" srt "github.com/datarhei/gosrt" "github.com/pion/rtp" "github.com/stretchr/testify/require" @@ -414,7 +414,7 @@ func TestPathRunOnRead(t *testing.T) { Host: u.Host, } - err = reader.Start2() + err = reader.Start() require.NoError(t, err) defer reader.Close() @@ -439,7 +439,7 @@ func TestPathRunOnRead(t *testing.T) { TLSConfig: &tls.Config{InsecureSkipVerify: true}, } - err = reader.Start2() + err = reader.Start() require.NoError(t, err) defer reader.Close() @@ -682,7 +682,7 @@ func TestPathMaxReaders(t *testing.T) { Host: u.Host, } - err = reader.Start2() + err = reader.Start() require.NoError(t, err) defer reader.Close() @@ -830,7 +830,7 @@ func TestPathFallback(t *testing.T) { Host: u.Host, } - err = dest.Start2() + err = dest.Start() require.NoError(t, err) defer dest.Close() @@ -897,7 +897,7 @@ func TestPathResolveSource(t *testing.T) { Host: u.Host, } - err = reader.Start2() + err = reader.Start() require.NoError(t, err) defer reader.Close() @@ -953,7 +953,7 @@ func TestPathOverridePublisher(t *testing.T) { Host: u.Host, } - err = c.Start2() + err = c.Start() require.NoError(t, err) defer c.Close() diff --git a/internal/core/test_on_demand/main.go b/internal/core/test_on_demand/main.go index c18b00f3..baba11dd 100644 --- a/internal/core/test_on_demand/main.go +++ b/internal/core/test_on_demand/main.go @@ -6,9 +6,9 @@ import ( "os/signal" "syscall" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" ) func main() { diff --git a/internal/defs/path.go b/internal/defs/path.go index 438c58d3..592063d0 100644 --- a/internal/defs/path.go +++ b/internal/defs/path.go @@ -3,7 +3,7 @@ package defs import ( "fmt" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/externalcmd" diff --git a/internal/defs/source.go b/internal/defs/source.go index e0a42bca..ae5fd893 100644 --- a/internal/defs/source.go +++ b/internal/defs/source.go @@ -4,8 +4,8 @@ import ( "fmt" "strings" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/logger" ) diff --git a/internal/protocols/hls/from_stream.go b/internal/protocols/hls/from_stream.go index a3b4e003..1015e3b9 100644 --- a/internal/protocols/hls/from_stream.go +++ b/internal/protocols/hls/from_stream.go @@ -7,8 +7,8 @@ import ( "github.com/bluenviron/gohlslib/v2" "github.com/bluenviron/gohlslib/v2/pkg/codecs" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/codecs/mpeg4audio" "github.com/bluenviron/mediamtx/internal/logger" "github.com/bluenviron/mediamtx/internal/stream" diff --git a/internal/protocols/hls/from_stream_test.go b/internal/protocols/hls/from_stream_test.go index ac7fe0a8..de227bc8 100644 --- a/internal/protocols/hls/from_stream_test.go +++ b/internal/protocols/hls/from_stream_test.go @@ -5,8 +5,8 @@ import ( "testing" "github.com/bluenviron/gohlslib/v2" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/logger" "github.com/bluenviron/mediamtx/internal/stream" "github.com/bluenviron/mediamtx/internal/test" diff --git a/internal/protocols/hls/to_stream.go b/internal/protocols/hls/to_stream.go index fede1d56..db19275b 100644 --- a/internal/protocols/hls/to_stream.go +++ b/internal/protocols/hls/to_stream.go @@ -6,8 +6,8 @@ import ( "github.com/bluenviron/gohlslib/v2" "github.com/bluenviron/gohlslib/v2/pkg/codecs" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/logger" "github.com/bluenviron/mediamtx/internal/stream" "github.com/bluenviron/mediamtx/internal/unit" diff --git a/internal/protocols/hls/to_stream_test.go b/internal/protocols/hls/to_stream_test.go index 11307cb9..9e9b602a 100644 --- a/internal/protocols/hls/to_stream_test.go +++ b/internal/protocols/hls/to_stream_test.go @@ -8,8 +8,8 @@ import ( "time" "github.com/bluenviron/gohlslib/v2" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/formats/mpegts" "github.com/bluenviron/mediamtx/internal/stream" "github.com/bluenviron/mediamtx/internal/test" diff --git a/internal/protocols/mpegts/from_stream.go b/internal/protocols/mpegts/from_stream.go index aa58b837..80772315 100644 --- a/internal/protocols/mpegts/from_stream.go +++ b/internal/protocols/mpegts/from_stream.go @@ -5,8 +5,8 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/codecs/ac3" "github.com/bluenviron/mediacommon/v2/pkg/codecs/h264" "github.com/bluenviron/mediacommon/v2/pkg/codecs/h265" diff --git a/internal/protocols/mpegts/from_stream_test.go b/internal/protocols/mpegts/from_stream_test.go index 589cab5f..e9a79a03 100644 --- a/internal/protocols/mpegts/from_stream_test.go +++ b/internal/protocols/mpegts/from_stream_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/logger" "github.com/bluenviron/mediamtx/internal/stream" "github.com/bluenviron/mediamtx/internal/test" diff --git a/internal/protocols/mpegts/to_stream.go b/internal/protocols/mpegts/to_stream.go index 012adca0..55d89c9a 100644 --- a/internal/protocols/mpegts/to_stream.go +++ b/internal/protocols/mpegts/to_stream.go @@ -7,8 +7,8 @@ import ( "reflect" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/codecs/mpeg4audio" "github.com/bluenviron/mediacommon/v2/pkg/formats/mpegts" diff --git a/internal/protocols/mpegts/to_stream_test.go b/internal/protocols/mpegts/to_stream_test.go index 6be5c5d8..26c4ffa6 100644 --- a/internal/protocols/mpegts/to_stream_test.go +++ b/internal/protocols/mpegts/to_stream_test.go @@ -7,8 +7,8 @@ import ( "testing" "github.com/asticode/go-astits" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/codecs/mpeg4audio" "github.com/bluenviron/mediamtx/internal/logger" "github.com/bluenviron/mediamtx/internal/test" diff --git a/internal/protocols/rtmp/from_stream.go b/internal/protocols/rtmp/from_stream.go index 60bc6e52..7634a498 100644 --- a/internal/protocols/rtmp/from_stream.go +++ b/internal/protocols/rtmp/from_stream.go @@ -9,7 +9,7 @@ import ( "github.com/bluenviron/gortmplib" "github.com/bluenviron/gortmplib/pkg/message" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/codecs/ac3" "github.com/bluenviron/mediacommon/v2/pkg/codecs/h264" "github.com/bluenviron/mediacommon/v2/pkg/codecs/h265" diff --git a/internal/protocols/rtmp/from_stream_test.go b/internal/protocols/rtmp/from_stream_test.go index 2a210fb8..52e5e896 100644 --- a/internal/protocols/rtmp/from_stream_test.go +++ b/internal/protocols/rtmp/from_stream_test.go @@ -9,8 +9,8 @@ import ( "time" "github.com/bluenviron/gortmplib" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/codecprocessor" "github.com/bluenviron/mediamtx/internal/logger" "github.com/bluenviron/mediamtx/internal/stream" diff --git a/internal/protocols/rtmp/to_stream.go b/internal/protocols/rtmp/to_stream.go index 05df8bc2..4dc43677 100644 --- a/internal/protocols/rtmp/to_stream.go +++ b/internal/protocols/rtmp/to_stream.go @@ -6,8 +6,8 @@ import ( "github.com/bluenviron/gortmplib" "github.com/bluenviron/gortmplib/pkg/message" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/stream" "github.com/bluenviron/mediamtx/internal/unit" ) diff --git a/internal/protocols/rtsp/credentials.go b/internal/protocols/rtsp/credentials.go index e3323cfc..dd73c0ee 100644 --- a/internal/protocols/rtsp/credentials.go +++ b/internal/protocols/rtsp/credentials.go @@ -1,8 +1,8 @@ package rtsp import ( - "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/headers" + "github.com/bluenviron/gortsplib/v5/pkg/base" + "github.com/bluenviron/gortsplib/v5/pkg/headers" "github.com/bluenviron/mediamtx/internal/auth" ) diff --git a/internal/protocols/rtsp/credentials_test.go b/internal/protocols/rtsp/credentials_test.go index 4c8fba2f..6e9a6201 100644 --- a/internal/protocols/rtsp/credentials_test.go +++ b/internal/protocols/rtsp/credentials_test.go @@ -3,7 +3,7 @@ package rtsp import ( "testing" - "github.com/bluenviron/gortsplib/v4/pkg/base" + "github.com/bluenviron/gortsplib/v5/pkg/base" "github.com/bluenviron/mediamtx/internal/auth" "github.com/stretchr/testify/require" ) diff --git a/internal/protocols/rtsp/to_stream.go b/internal/protocols/rtsp/to_stream.go index 0a833b12..44f7647e 100644 --- a/internal/protocols/rtsp/to_stream.go +++ b/internal/protocols/rtsp/to_stream.go @@ -4,9 +4,9 @@ package rtsp import ( "time" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/logger" "github.com/bluenviron/mediamtx/internal/stream" @@ -22,7 +22,7 @@ const ( ) type rtspSource interface { - PacketPTS2(*description.Media, *rtp.Packet) (int64, bool) + PacketPTS(*description.Media, *rtp.Packet) (int64, bool) PacketNTP(*description.Media, *rtp.Packet) (time.Time, bool) OnPacketRTP(*description.Media, format.Format, gortsplib.OnPacketRTPFunc) } @@ -72,7 +72,7 @@ func ToStream( } source.OnPacketRTP(cmedi, cforma, func(pkt *rtp.Packet) { - pts, ok := source.PacketPTS2(cmedi, pkt) + pts, ok := source.PacketPTS(cmedi, pkt) if !ok { return } diff --git a/internal/protocols/udp/udp.go b/internal/protocols/udp/udp.go index 9424dc51..639de038 100644 --- a/internal/protocols/udp/udp.go +++ b/internal/protocols/udp/udp.go @@ -8,8 +8,8 @@ import ( "syscall" "time" - "github.com/bluenviron/gortsplib/v4/pkg/multicast" - "github.com/bluenviron/gortsplib/v4/pkg/readbuffer" + "github.com/bluenviron/gortsplib/v5/pkg/multicast" + "github.com/bluenviron/gortsplib/v5/pkg/readbuffer" "github.com/bluenviron/mediamtx/internal/restrictnetwork" ) diff --git a/internal/protocols/webrtc/from_stream.go b/internal/protocols/webrtc/from_stream.go index 82907554..12ac4a7e 100644 --- a/internal/protocols/webrtc/from_stream.go +++ b/internal/protocols/webrtc/from_stream.go @@ -6,13 +6,13 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpav1" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtph264" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtph265" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtplpcm" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpvp8" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpvp9" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpav1" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtph264" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtph265" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtplpcm" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpvp8" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpvp9" "github.com/bluenviron/mediacommon/v2/pkg/codecs/g711" "github.com/bluenviron/mediamtx/internal/logger" "github.com/bluenviron/mediamtx/internal/stream" diff --git a/internal/protocols/webrtc/from_stream_test.go b/internal/protocols/webrtc/from_stream_test.go index 57679816..6e2737d4 100644 --- a/internal/protocols/webrtc/from_stream_test.go +++ b/internal/protocols/webrtc/from_stream_test.go @@ -4,8 +4,8 @@ import ( "fmt" "testing" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/logger" "github.com/bluenviron/mediamtx/internal/stream" "github.com/bluenviron/mediamtx/internal/test" diff --git a/internal/protocols/webrtc/incoming_track.go b/internal/protocols/webrtc/incoming_track.go index 93cbe9c8..9917d21a 100644 --- a/internal/protocols/webrtc/incoming_track.go +++ b/internal/protocols/webrtc/incoming_track.go @@ -4,7 +4,7 @@ import ( "sync/atomic" "time" - "github.com/bluenviron/gortsplib/v4/pkg/rtcpreceiver" + "github.com/bluenviron/gortsplib/v5/pkg/rtpreceiver" "github.com/pion/rtcp" "github.com/pion/rtp" "github.com/pion/webrtc/v4" @@ -248,7 +248,7 @@ type IncomingTrack struct { rtpPacketsLost *uint64 packetsLost *counterdumper.CounterDumper - rtcpReceiver *rtcpreceiver.RTCPReceiver + rtcpReceiver *rtpreceiver.Receiver } func (t *IncomingTrack) initialize() { @@ -285,7 +285,7 @@ func (t *IncomingTrack) start() { } t.packetsLost.Start() - t.rtcpReceiver = &rtcpreceiver.RTCPReceiver{ + t.rtcpReceiver = &rtpreceiver.Receiver{ ClockRate: int(t.track.Codec().ClockRate), UnrealiableTransport: true, Period: 1 * time.Second, @@ -348,7 +348,7 @@ func (t *IncomingTrack) start() { return } - packets, lost, err2 := t.rtcpReceiver.ProcessPacket2(pkt, time.Now(), true) + packets, lost, err2 := t.rtcpReceiver.ProcessPacket(pkt, time.Now(), true) if err2 != nil { t.log.Log(logger.Warn, err2.Error()) continue diff --git a/internal/protocols/webrtc/outgoing_track.go b/internal/protocols/webrtc/outgoing_track.go index 42aeb8fb..b1b63120 100644 --- a/internal/protocols/webrtc/outgoing_track.go +++ b/internal/protocols/webrtc/outgoing_track.go @@ -5,7 +5,7 @@ import ( "sync/atomic" "time" - "github.com/bluenviron/gortsplib/v4/pkg/rtcpsender" + "github.com/bluenviron/gortsplib/v5/pkg/rtpsender" "github.com/pion/rtcp" "github.com/pion/rtp" "github.com/pion/webrtc/v4" @@ -26,7 +26,7 @@ type OutgoingTrack struct { track *webrtc.TrackLocalStaticRTP ssrc uint32 - rtcpSender *rtcpsender.RTCPSender + rtcpSender *rtpsender.Sender rtpPacketsSent *uint64 } @@ -59,7 +59,7 @@ func (t *OutgoingTrack) setup(p *PeerConnection) error { t.ssrc = uint32(sender.GetParameters().Encodings[0].SSRC) - t.rtcpSender = &rtcpsender.RTCPSender{ + t.rtcpSender = &rtpsender.Sender{ ClockRate: int(t.track.Codec().ClockRate), Period: 1 * time.Second, TimeNow: time.Now, diff --git a/internal/protocols/webrtc/to_stream.go b/internal/protocols/webrtc/to_stream.go index 8512bea8..3150a8a2 100644 --- a/internal/protocols/webrtc/to_stream.go +++ b/internal/protocols/webrtc/to_stream.go @@ -6,9 +6,9 @@ import ( "strings" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/rtptime" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/rtptime" "github.com/bluenviron/mediamtx/internal/stream" "github.com/pion/rtp" "github.com/pion/webrtc/v4" @@ -24,7 +24,7 @@ func ToStream( stream **stream.Stream, ) ([]*description.Media, error) { var medias []*description.Media //nolint:prealloc - timeDecoder := &rtptime.GlobalDecoder2{} + timeDecoder := &rtptime.GlobalDecoder{} timeDecoder.Initialize() for _, track := range pc.incomingTracks { diff --git a/internal/protocols/webrtc/to_stream_test.go b/internal/protocols/webrtc/to_stream_test.go index 9336c8dd..66767295 100644 --- a/internal/protocols/webrtc/to_stream_test.go +++ b/internal/protocols/webrtc/to_stream_test.go @@ -4,7 +4,7 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/stream" "github.com/bluenviron/mediamtx/internal/test" diff --git a/internal/recorder/format_fmp4.go b/internal/recorder/format_fmp4.go index 35ce6e10..2bd98ac9 100644 --- a/internal/recorder/format_fmp4.go +++ b/internal/recorder/format_fmp4.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - rtspformat "github.com/bluenviron/gortsplib/v4/pkg/format" + rtspformat "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/codecs/ac3" "github.com/bluenviron/mediacommon/v2/pkg/codecs/av1" "github.com/bluenviron/mediacommon/v2/pkg/codecs/g711" diff --git a/internal/recorder/format_mpegts.go b/internal/recorder/format_mpegts.go index e5000ceb..f016d1b8 100644 --- a/internal/recorder/format_mpegts.go +++ b/internal/recorder/format_mpegts.go @@ -7,7 +7,7 @@ import ( "io" "time" - rtspformat "github.com/bluenviron/gortsplib/v4/pkg/format" + rtspformat "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/codecs/ac3" "github.com/bluenviron/mediacommon/v2/pkg/codecs/h264" "github.com/bluenviron/mediacommon/v2/pkg/codecs/h265" diff --git a/internal/recorder/recorder_test.go b/internal/recorder/recorder_test.go index 55054d93..5ead56d7 100644 --- a/internal/recorder/recorder_test.go +++ b/internal/recorder/recorder_test.go @@ -7,8 +7,8 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" - rtspformat "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + rtspformat "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/codecs/mpeg4audio" "github.com/bluenviron/mediacommon/v2/pkg/formats/fmp4" "github.com/bluenviron/mediacommon/v2/pkg/formats/mp4" diff --git a/internal/servers/hls/server_test.go b/internal/servers/hls/server_test.go index 3d843b77..1244616d 100644 --- a/internal/servers/hls/server_test.go +++ b/internal/servers/hls/server_test.go @@ -11,7 +11,7 @@ import ( "github.com/bluenviron/gohlslib/v2" "github.com/bluenviron/gohlslib/v2/pkg/codecs" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/bluenviron/mediacommon/v2/pkg/codecs/mpeg4audio" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/defs" diff --git a/internal/servers/rtmp/conn.go b/internal/servers/rtmp/conn.go index 078b0576..ea793e06 100644 --- a/internal/servers/rtmp/conn.go +++ b/internal/servers/rtmp/conn.go @@ -10,7 +10,7 @@ import ( "time" "github.com/bluenviron/gortmplib" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/google/uuid" "github.com/bluenviron/mediamtx/internal/auth" diff --git a/internal/servers/rtmp/server_test.go b/internal/servers/rtmp/server_test.go index faa71729..f685a02b 100644 --- a/internal/servers/rtmp/server_test.go +++ b/internal/servers/rtmp/server_test.go @@ -9,8 +9,8 @@ import ( "time" "github.com/bluenviron/gortmplib" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/defs" "github.com/bluenviron/mediamtx/internal/externalcmd" diff --git a/internal/servers/rtsp/conn.go b/internal/servers/rtsp/conn.go index ffff7132..bf18e025 100644 --- a/internal/servers/rtsp/conn.go +++ b/internal/servers/rtsp/conn.go @@ -8,11 +8,11 @@ import ( "strings" "time" - "github.com/bluenviron/gortsplib/v4" - rtspauth "github.com/bluenviron/gortsplib/v4/pkg/auth" - "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/headers" - "github.com/bluenviron/gortsplib/v4/pkg/liberrors" + "github.com/bluenviron/gortsplib/v5" + rtspauth "github.com/bluenviron/gortsplib/v5/pkg/auth" + "github.com/bluenviron/gortsplib/v5/pkg/base" + "github.com/bluenviron/gortsplib/v5/pkg/headers" + "github.com/bluenviron/gortsplib/v5/pkg/liberrors" "github.com/google/uuid" "github.com/bluenviron/mediamtx/internal/auth" diff --git a/internal/servers/rtsp/server.go b/internal/servers/rtsp/server.go index a2db0400..ecc2fc37 100644 --- a/internal/servers/rtsp/server.go +++ b/internal/servers/rtsp/server.go @@ -12,10 +12,10 @@ import ( "sync" "time" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/auth" - "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/liberrors" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/auth" + "github.com/bluenviron/gortsplib/v5/pkg/base" + "github.com/bluenviron/gortsplib/v5/pkg/liberrors" "github.com/google/uuid" "github.com/bluenviron/mediamtx/internal/certloader" diff --git a/internal/servers/rtsp/server_test.go b/internal/servers/rtsp/server_test.go index febc2169..7488eda4 100644 --- a/internal/servers/rtsp/server_test.go +++ b/internal/servers/rtsp/server_test.go @@ -4,11 +4,11 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4" - rtspauth "github.com/bluenviron/gortsplib/v4/pkg/auth" - "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5" + rtspauth "github.com/bluenviron/gortsplib/v5/pkg/auth" + "github.com/bluenviron/gortsplib/v5/pkg/base" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/auth" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/defs" @@ -110,7 +110,7 @@ func TestServerPublish(t *testing.T) { ReadTimeout: conf.Duration(10 * time.Second), WriteTimeout: conf.Duration(10 * time.Second), WriteQueueSize: 512, - Transports: conf.RTSPTransports{gortsplib.TransportTCP: {}}, + Transports: conf.RTSPTransports{gortsplib.ProtocolTCP: {}}, PathManager: pathManager, Parent: test.NilLogger, } @@ -249,7 +249,7 @@ func TestServerRead(t *testing.T) { ReadTimeout: conf.Duration(10 * time.Second), WriteTimeout: conf.Duration(10 * time.Second), WriteQueueSize: 512, - Transports: conf.RTSPTransports{gortsplib.TransportTCP: {}}, + Transports: conf.RTSPTransports{gortsplib.ProtocolTCP: {}}, PathManager: pathManager, Parent: test.NilLogger, } @@ -265,7 +265,7 @@ func TestServerRead(t *testing.T) { Host: u.Host, } - err = reader.Start2() + err = reader.Start() require.NoError(t, err) defer reader.Close() @@ -366,7 +366,7 @@ func TestServerRedirect(t *testing.T) { ReadTimeout: conf.Duration(10 * time.Second), WriteTimeout: conf.Duration(10 * time.Second), WriteQueueSize: 512, - Transports: conf.RTSPTransports{gortsplib.TransportTCP: {}}, + Transports: conf.RTSPTransports{gortsplib.ProtocolTCP: {}}, PathManager: pathManager, Parent: test.NilLogger, } @@ -382,7 +382,7 @@ func TestServerRedirect(t *testing.T) { Host: u.Host, } - err = reader.Start2() + err = reader.Start() require.NoError(t, err) defer reader.Close() diff --git a/internal/servers/rtsp/session.go b/internal/servers/rtsp/session.go index 68d6e2dc..e1cd5065 100644 --- a/internal/servers/rtsp/session.go +++ b/internal/servers/rtsp/session.go @@ -6,12 +6,11 @@ import ( "fmt" "net" "slices" - "sync" "time" - "github.com/bluenviron/gortsplib/v4" - rtspauth "github.com/bluenviron/gortsplib/v4/pkg/auth" - "github.com/bluenviron/gortsplib/v4/pkg/base" + "github.com/bluenviron/gortsplib/v5" + rtspauth "github.com/bluenviron/gortsplib/v5/pkg/auth" + "github.com/bluenviron/gortsplib/v5/pkg/base" "github.com/google/uuid" "github.com/bluenviron/mediamtx/internal/auth" @@ -41,11 +40,6 @@ type session struct { path defs.Path stream *stream.Stream onUnreadHook func() - mutex sync.Mutex - state defs.APIRTSPSessionState - transport *gortsplib.Transport - pathName string - query string packetsLost *counterdumper.CounterDumper decodeErrors *counterdumper.CounterDumper discardedFrames *counterdumper.CounterDumper @@ -54,7 +48,6 @@ type session struct { func (s *session) initialize() { s.uuid = uuid.New() s.created = time.Now() - s.state = defs.APIRTSPSessionStateIdle s.packetsLost = &counterdumper.CounterDumper{ OnReport: func(val uint64) { @@ -185,11 +178,6 @@ func (s *session) onAnnounce(c *conn, ctx *gortsplib.ServerHandlerOnAnnounceCtx) s.pathConf = pathConf - s.mutex.Lock() - s.pathName = ctx.Path - s.query = ctx.Query - s.mutex.Unlock() - return &base.Response{ StatusCode: base.StatusOK, }, nil @@ -207,10 +195,10 @@ func (s *session) onSetup(c *conn, ctx *gortsplib.ServerHandlerOnSetupCtx, // in case the client is setupping a stream with UDP or UDP-multicast, and these // transport protocols are disabled, gortsplib already blocks the request. - // we have only to handle the case in which the transport protocol is TCP + // we only have to handle the case in which the transport protocol is TCP // and it is disabled. - if ctx.Transport == gortsplib.TransportTCP { - if _, ok := s.transports[gortsplib.TransportTCP]; !ok { + if ctx.Transport.Protocol == gortsplib.ProtocolTCP { + if _, ok := s.transports[gortsplib.ProtocolTCP]; !ok { return &base.Response{ StatusCode: base.StatusUnsupportedTransport, }, nil, nil @@ -262,11 +250,6 @@ func (s *session) onSetup(c *conn, ctx *gortsplib.ServerHandlerOnSetupCtx, s.path = path s.stream = stream - s.mutex.Lock() - s.pathName = ctx.Path - s.query = ctx.Query - s.mutex.Unlock() - var rstream *gortsplib.ServerStream if !s.isTLS { rstream = stream.RTSPStream(s.rserver) @@ -292,8 +275,8 @@ func (s *session) onPlay(_ *gortsplib.ServerHandlerOnPlayCtx) (*base.Response, e if s.rsession.State() == gortsplib.ServerSessionStatePrePlay { s.Log(logger.Info, "is reading from path '%s', with %s, %s", s.path.Name(), - s.rsession.SetuppedTransport(), - defs.MediasInfo(s.rsession.SetuppedMedias())) + s.rsession.Transport().Protocol, + defs.MediasInfo(s.rsession.Medias())) s.onUnreadHook = hooks.OnRead(hooks.OnReadParams{ Logger: s, @@ -301,13 +284,8 @@ func (s *session) onPlay(_ *gortsplib.ServerHandlerOnPlayCtx) (*base.Response, e Conf: s.path.SafeConf(), ExternalCmdEnv: s.path.ExternalCmdEnv(), Reader: s.APIReaderDescribe(), - Query: s.rsession.SetuppedQuery(), + Query: s.rsession.Query(), }) - - s.mutex.Lock() - s.state = defs.APIRTSPSessionStateRead - s.transport = s.rsession.SetuppedTransport() - s.mutex.Unlock() } return &base.Response{ @@ -324,8 +302,8 @@ func (s *session) onRecord(_ *gortsplib.ServerHandlerOnRecordCtx) (*base.Respons GenerateRTPPackets: false, ConfToCompare: s.pathConf, AccessRequest: defs.PathAccessRequest{ - Name: s.pathName, - Query: s.query, + Name: s.rsession.Path()[1:], + Query: s.rsession.Query(), Publish: true, SkipAuth: true, }, @@ -346,11 +324,6 @@ func (s *session) onRecord(_ *gortsplib.ServerHandlerOnRecordCtx) (*base.Respons stream, s) - s.mutex.Lock() - s.state = defs.APIRTSPSessionStatePublish - s.transport = s.rsession.SetuppedTransport() - s.mutex.Unlock() - return &base.Response{ StatusCode: base.StatusOK, }, nil @@ -362,16 +335,8 @@ func (s *session) onPause(_ *gortsplib.ServerHandlerOnPauseCtx) (*base.Response, case gortsplib.ServerSessionStatePlay: s.onUnreadHook() - s.mutex.Lock() - s.state = defs.APIRTSPSessionStateIdle - s.mutex.Unlock() - case gortsplib.ServerSessionStateRecord: s.path.RemovePublisher(defs.PathRemovePublisherReq{Author: s}) - - s.mutex.Lock() - s.state = defs.APIRTSPSessionStateIdle - s.mutex.Unlock() } return &base.Response{ @@ -414,23 +379,33 @@ func (s *session) onStreamWriteError(_ *gortsplib.ServerHandlerOnStreamWriteErro } func (s *session) apiItem() *defs.APIRTSPSession { - s.mutex.Lock() - defer s.mutex.Unlock() - stats := s.rsession.Stats() return &defs.APIRTSPSession{ ID: s.uuid, Created: s.created, RemoteAddr: s.remoteAddr().String(), - State: s.state, - Path: s.pathName, - Query: s.query, + State: func() defs.APIRTSPSessionState { + state := s.rsession.State() + switch state { + case gortsplib.ServerSessionStatePlay: + return defs.APIRTSPSessionStateRead + + case gortsplib.ServerSessionStateRecord: + return defs.APIRTSPSessionStatePublish + + default: + return defs.APIRTSPSessionStateIdle + } + }(), + Path: s.rsession.Path()[1:], + Query: s.rsession.Query(), Transport: func() *string { - if s.transport == nil { + transport := s.rsession.Transport() + if transport == nil { return nil } - v := s.transport.String() + v := transport.Protocol.String() return &v }(), BytesReceived: stats.BytesReceived, diff --git a/internal/servers/srt/conn.go b/internal/servers/srt/conn.go index 61b9efeb..b14e2460 100644 --- a/internal/servers/srt/conn.go +++ b/internal/servers/srt/conn.go @@ -9,7 +9,7 @@ import ( "sync" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" srt "github.com/datarhei/gosrt" "github.com/google/uuid" diff --git a/internal/servers/srt/server_test.go b/internal/servers/srt/server_test.go index 532291dc..d8ec9dbf 100644 --- a/internal/servers/srt/server_test.go +++ b/internal/servers/srt/server_test.go @@ -5,7 +5,7 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/bluenviron/mediacommon/v2/pkg/formats/mpegts" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/defs" diff --git a/internal/servers/webrtc/server_test.go b/internal/servers/webrtc/server_test.go index 5c2efef4..3e3b5f8a 100644 --- a/internal/servers/webrtc/server_test.go +++ b/internal/servers/webrtc/server_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/defs" "github.com/bluenviron/mediamtx/internal/externalcmd" diff --git a/internal/servers/webrtc/session.go b/internal/servers/webrtc/session.go index 84d561d8..151e0170 100644 --- a/internal/servers/webrtc/session.go +++ b/internal/servers/webrtc/session.go @@ -10,7 +10,7 @@ import ( "sync" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/google/uuid" "github.com/pion/ice/v4" "github.com/pion/sdp/v3" diff --git a/internal/staticsources/hls/source.go b/internal/staticsources/hls/source.go index ce3113fb..89d7f990 100644 --- a/internal/staticsources/hls/source.go +++ b/internal/staticsources/hls/source.go @@ -7,7 +7,7 @@ import ( "time" "github.com/bluenviron/gohlslib/v2" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/counterdumper" diff --git a/internal/staticsources/mpegts/source.go b/internal/staticsources/mpegts/source.go index 348a7d5b..b2912bf8 100644 --- a/internal/staticsources/mpegts/source.go +++ b/internal/staticsources/mpegts/source.go @@ -7,7 +7,7 @@ import ( "net/url" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/counterdumper" diff --git a/internal/staticsources/rpicamera/source.go b/internal/staticsources/rpicamera/source.go index 829db9bb..f3b53c7a 100644 --- a/internal/staticsources/rpicamera/source.go +++ b/internal/staticsources/rpicamera/source.go @@ -7,10 +7,10 @@ import ( "fmt" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtph264" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtpmjpeg" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtph264" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtpmjpeg" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/conf" diff --git a/internal/staticsources/rtmp/source.go b/internal/staticsources/rtmp/source.go index 91f66295..731deb48 100644 --- a/internal/staticsources/rtmp/source.go +++ b/internal/staticsources/rtmp/source.go @@ -9,7 +9,7 @@ import ( "time" "github.com/bluenviron/gortmplib" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/defs" diff --git a/internal/staticsources/rtmp/source_test.go b/internal/staticsources/rtmp/source_test.go index 7028db07..14963342 100644 --- a/internal/staticsources/rtmp/source_test.go +++ b/internal/staticsources/rtmp/source_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/require" "github.com/bluenviron/gortmplib" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/defs" "github.com/bluenviron/mediamtx/internal/test" diff --git a/internal/staticsources/rtp/source.go b/internal/staticsources/rtp/source.go index 55a1f337..6c08aabd 100644 --- a/internal/staticsources/rtp/source.go +++ b/internal/staticsources/rtp/source.go @@ -7,10 +7,10 @@ import ( "net/url" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" - "github.com/bluenviron/gortsplib/v4/pkg/rtptime" - "github.com/bluenviron/gortsplib/v4/pkg/sdp" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/rtptime" + "github.com/bluenviron/gortsplib/v5/pkg/sdp" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/counterdumper" "github.com/bluenviron/mediamtx/internal/defs" @@ -114,7 +114,7 @@ func (s *Source) runReader(desc *description.Session, nc net.Conn) error { var stream *stream.Stream - timeDecoder := &rtptime.GlobalDecoder2{} + timeDecoder := &rtptime.GlobalDecoder{} timeDecoder.Initialize() mediasByPayloadType := make(map[uint8]*description.Media) diff --git a/internal/staticsources/rtp/source_test.go b/internal/staticsources/rtp/source_test.go index 8c955de6..faf6ce5f 100644 --- a/internal/staticsources/rtp/source_test.go +++ b/internal/staticsources/rtp/source_test.go @@ -8,7 +8,7 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4/pkg/format/rtph264" + "github.com/bluenviron/gortsplib/v5/pkg/format/rtph264" "github.com/stretchr/testify/require" "github.com/bluenviron/mediamtx/internal/conf" diff --git a/internal/staticsources/rtsp/source.go b/internal/staticsources/rtsp/source.go index e8741585..9c09d65d 100644 --- a/internal/staticsources/rtsp/source.go +++ b/internal/staticsources/rtsp/source.go @@ -4,9 +4,9 @@ package rtsp import ( "time" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/headers" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/base" + "github.com/bluenviron/gortsplib/v5/pkg/headers" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/counterdumper" @@ -124,7 +124,7 @@ func (s *Source) Run(params defs.StaticSourceRunParams) error { c := &gortsplib.Client{ Scheme: u.Scheme, Host: u.Host, - Transport: params.Conf.RTSPTransport.Transport, + Protocol: params.Conf.RTSPTransport.Protocol, TLSConfig: tls.MakeConfig(u.Hostname(), params.Conf.SourceFingerprint), ReadTimeout: time.Duration(s.ReadTimeout), WriteTimeout: time.Duration(s.WriteTimeout), @@ -148,7 +148,7 @@ func (s *Source) Run(params defs.StaticSourceRunParams) error { }, } - err = c.Start2() + err = c.Start() if err != nil { return err } diff --git a/internal/staticsources/rtsp/source_test.go b/internal/staticsources/rtsp/source_test.go index f461972a..7f15ece9 100644 --- a/internal/staticsources/rtsp/source_test.go +++ b/internal/staticsources/rtsp/source_test.go @@ -7,10 +7,10 @@ import ( "testing" "time" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/auth" - "github.com/bluenviron/gortsplib/v4/pkg/base" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/auth" + "github.com/bluenviron/gortsplib/v5/pkg/base" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/pion/rtp" "github.com/stretchr/testify/require" diff --git a/internal/staticsources/srt/source.go b/internal/staticsources/srt/source.go index f750aa67..c8bdb031 100644 --- a/internal/staticsources/srt/source.go +++ b/internal/staticsources/srt/source.go @@ -4,7 +4,7 @@ package srt import ( "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" srt "github.com/datarhei/gosrt" "github.com/bluenviron/mediamtx/internal/conf" diff --git a/internal/staticsources/webrtc/source.go b/internal/staticsources/webrtc/source.go index fda5ab03..dfa3211b 100644 --- a/internal/staticsources/webrtc/source.go +++ b/internal/staticsources/webrtc/source.go @@ -8,7 +8,7 @@ import ( "strings" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/description" "github.com/bluenviron/mediamtx/internal/conf" "github.com/bluenviron/mediamtx/internal/defs" diff --git a/internal/stream/stream.go b/internal/stream/stream.go index 99c558a7..4eeeccb2 100644 --- a/internal/stream/stream.go +++ b/internal/stream/stream.go @@ -6,9 +6,9 @@ import ( "sync/atomic" "time" - "github.com/bluenviron/gortsplib/v4" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/counterdumper" diff --git a/internal/stream/stream_format.go b/internal/stream/stream_format.go index 87c08e96..2a3f396f 100644 --- a/internal/stream/stream_format.go +++ b/internal/stream/stream_format.go @@ -4,8 +4,8 @@ import ( "sync/atomic" "time" - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/pion/rtp" "github.com/bluenviron/mediamtx/internal/codecprocessor" diff --git a/internal/stream/stream_media.go b/internal/stream/stream_media.go index 07b019b5..b1d1e183 100644 --- a/internal/stream/stream_media.go +++ b/internal/stream/stream_media.go @@ -1,8 +1,8 @@ package stream import ( - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediamtx/internal/counterdumper" "github.com/bluenviron/mediamtx/internal/logger" ) diff --git a/internal/stream/stream_reader.go b/internal/stream/stream_reader.go index 44b18bb8..42b536be 100644 --- a/internal/stream/stream_reader.go +++ b/internal/stream/stream_reader.go @@ -3,7 +3,7 @@ package stream import ( "fmt" - "github.com/bluenviron/gortsplib/v4/pkg/ringbuffer" + "github.com/bluenviron/gortsplib/v5/pkg/ringbuffer" "github.com/bluenviron/mediamtx/internal/counterdumper" "github.com/bluenviron/mediamtx/internal/logger" ) diff --git a/internal/test/formats.go b/internal/test/formats.go index 39490343..11639756 100644 --- a/internal/test/formats.go +++ b/internal/test/formats.go @@ -1,7 +1,7 @@ package test import ( - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/format" "github.com/bluenviron/mediacommon/v2/pkg/codecs/mpeg4audio" ) diff --git a/internal/test/medias.go b/internal/test/medias.go index 1fa1d79f..ea01ecfd 100644 --- a/internal/test/medias.go +++ b/internal/test/medias.go @@ -1,8 +1,8 @@ package test import ( - "github.com/bluenviron/gortsplib/v4/pkg/description" - "github.com/bluenviron/gortsplib/v4/pkg/format" + "github.com/bluenviron/gortsplib/v5/pkg/description" + "github.com/bluenviron/gortsplib/v5/pkg/format" ) // MediaH264 is a dummy H264 media.