mirror of
https://github.com/aler9/rtsp-simple-server
synced 2025-09-26 19:51:26 +08:00
switch to gortsplib/v5 (#4978)
This commit is contained in:
@@ -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"
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
)
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
)
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"]
|
||||
|
@@ -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"
|
||||
)
|
||||
|
||||
|
@@ -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"
|
||||
)
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
|
@@ -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,
|
||||
|
@@ -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"
|
||||
)
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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()
|
||||
|
||||
|
@@ -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() {
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
)
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
)
|
||||
|
@@ -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"
|
||||
)
|
||||
|
||||
|
@@ -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"
|
||||
)
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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"
|
||||
)
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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
|
||||
|
@@ -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,
|
||||
|
@@ -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 {
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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()
|
||||
|
||||
|
@@ -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,
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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)
|
||||
|
@@ -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"
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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"
|
||||
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
|
@@ -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"
|
||||
)
|
||||
|
@@ -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"
|
||||
)
|
||||
|
@@ -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"
|
||||
)
|
||||
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user